temp-api
← Back to Mock APIs

Mock Posts & Comments API

6 posts and 12 comments for content lists, detail pages, author relations, and comment threads.

Data6 posts · 12 comments Base URLhttps://www.temp-api.com/en/mock Response{ code, message, data, meta }

Endpoints

GET/en/mock/posts

Post list with page, limit, q, and userId.

Open
GET/en/mock/posts/1

Single post detail.

Open
GET/en/mock/posts/1/comments

Comments for a post.

Open
GET/en/mock/comments?postId=1

Filter comments by post.

Open
POST/en/mock/posts

Simulated create; stores nothing.

Related routes

GET/en/mock/posts/1/comments

Comments for this post

Open
GET/en/mock/posts/1/user

Post author

Open
GET/en/mock/comments/1/post

Post this comment belongs to

Open

Filters

Posts: page, limit, q, userId; comments: postId, userId

Fields

FieldTypeDescription
idnumberPost ID
user_idnumberAuthor ID
titlestringTitle
bodystringBody
tagsarrayTags
created_atstringISO timestamp

Notes

  • Comment fields: id, post_id, user_id, author, body, created_at.
  • Writes are simulated and never stored.

Example

curl "https://www.temp-api.com/en/mock/posts/1/comments"
{
  "code": 200,
  "message": "ok",
  "data": [
    { "id": 1, "post_id": 1, "author": "Olivia Bennett", "body": "This is a useful pattern." }
  ],
  "meta": { "total": 2 }
}

Related resources