screen size not supported

Comment thread JSON example

Last updated 2026-05-20

When to use this

Use this for a comment list under a blog post, a moderation tool, or a forum-style view. Each comment carries a postId and a user reference so you can hydrate authors or sort by post.

Example JSON

Comments tied to post 1, as returned by /comments?postId=1 (paginated).
{
  "comments": [
    {
      "id": 1,
      "body": "This is some awesome thinking!",
      "postId": 1,
      "likes": 3,
      "user": {
        "id": 121,
        "username": "emilys",
        "fullName": "Emily Johnson"
      }
    },
    {
      "id": 2,
      "body": "What terrific math help service!",
      "postId": 1,
      "likes": 14,
      "user": {
        "id": 92,
        "username": "sophiab",
        "fullName": "Sophia Brown"
      }
    },
    {
      "id": 3,
      "body": "I want to learn more.",
      "postId": 1,
      "likes": 1,
      "user": {
        "id": 31,
        "username": "jamesd",
        "fullName": "James Davis"
      }
    }
  ],
  "total": 3,
  "skip": 0,
  "limit": 30
}

Request examples

fetch('https://jsonexamples.com/posts/1/comments')
  .then(res => res.json())
  .then(({ comments }) => console.log(comments.length));

Try the live endpoint

Click below to call /posts/1/comments from your browser.

// click the button to populate this block

Common variations

Single comment
{
  "id": 1,
  "body": "This is some awesome thinking!",
  "postId": 1,
  "likes": 3,
  "user": {
    "id": 121,
    "username": "emilys",
    "fullName": "Emily Johnson"
  }
}
Empty thread

Shape returned when a post has no comments yet.

{
  "comments": [],
  "total": 0,
  "skip": 0,
  "limit": 30
}

Convert this JSON

Generated starting points for TypeScript, JSON Schema, and Zod. Refine before shipping to production.

export interface CommentThread {
  "comments": {
    "id": number;
    "body": string;
    "postId": number;
    "likes": number;
    "user": {
      "id": number;
      "username": string;
      "fullName": string;
    };
  }[];
  "total": number;
  "skip": number;
  "limit": number;
}