Posts and comments are a common shape for a first frontend, a tutorial or a demo: a list, a detail view and a nested resource. The blog template gives you these endpoints behind a real URL, with content generated on every call.
What you get
The template creates a project with the base path /blog and 4 endpoints. Each endpoint has one ready response, so the API answers as soon as the project exists.
| Method | Path | What it answers |
|---|---|---|
GET |
/posts |
200 with six generated posts. |
GET |
/posts/:id |
200 with one post. The id is the one from the path. |
GET |
/posts/:id/comments |
200 with four generated comments for the post in the path. |
POST |
/posts/:id/comments |
201 with author and text from the request body and a generated id. |
A post in the list has id, title, slug, excerpt, author, tag (news, guide, release or opinion), commentCount and publishedAt. The single post has a body instead of the excerpt, and its author is an object with name and avatarUrl. A comment has id, postId, author, text and createdAt. Titles and texts are generated filler sentences, not readable articles.
Sample response
$ curl -s -X POST $URL/blog/posts/7/comments \
-H "Content-Type: application/json" \
-d '{"author":"Mira Keller","text":"Clear and short."}'
{
"id": "5312",
"postId": "7",
"author": "Mira Keller",
"text": "Clear and short.",
"createdAt": "2026-11-15T09:12:44Z"
}
postId is the id from the path, author and text come from your request. The id and createdAt are generated on every call, and so is everything in the two lists and the single post.
How to start
- Sign up at
https://app.mockhop.com/register. The quickstart explains the account and the address of your organization. - Open Projects and select Start from a template.
- Choose Example blog and select Use template.
Then call the mock. Replace acme with your organization's address. Your mocks answer from outside once you've confirmed your email address.
$ URL=https://acme.mockhop.cloud
$ curl -s $URL/blog/posts
$ curl -s $URL/blog/posts/7/comments
The first call returns six posts, the second four comments with the postId 7.
What to do next
- Change the responses. Open an endpoint and edit the status code, headers and body of its response, or add more responses with matching rules.
- Add error cases and delays. For example a
404for a post that doesn't exist, a422for an empty comment, or a delay on the post list. See Simulate API errors, timeouts and rate limits. - Use scenarios for flows. For example a comment list that is empty on the first call and filled on the next one. See Scenarios; scenarios are included from the Pro plan.
- Export the project. Under Import/Export you can download the project as an OpenAPI 3.0 file.
Good to know
- Responses are generated per request and the mock keeps no state. A comment you post does not appear in
GET /posts/:id/comments. commentCountis a random number between 0 and 40, not the number of comments the comment list returns.- Every call generates new content: the post behind
/posts/7has a different title each time, and itsslugis not derived from the title. - The lists always have six posts and four comments. There is no paging.
- The template creates a new project, and no other project in your organization may use the base path
/blog. The Free plan includes one project. - You can change or delete the project and each of its endpoints at any time.
New to Mockhop? Start with the quickstart. Plans: pricing.