Docsy / docs

API REFERENCE

Comments · OpenAPI sample

A public GET request with an optional postId filter. The query value, curl command, and response example come from the OpenAPI source.

v1.0.0

Comments

List comments for a post

Filter comments using a query parameter. Omit postId to list all comments. No API key is needed.

GET/comments

Query parameters

postIdintegerquery

Return only comments belonging to this post.

GET /comments
curl --request GET \
  --url 'https://jsonplaceholder.typicode.com/comments?postId=1'
Response · 200
[
  {
    "id": 1,
    "postId": 1,
    "name": "Example comment",
    "email": "reader@example.com",
    "body": "Example response content. Live comment text can differ."
  }
]
—