Comment thread JSON example

Last updated 2026-05-20

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.

GET/posts/1/comments
{
  "hint": "Click 'Run' to call the live endpoint"
}

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;
}
Back to examples

Related examples