Aller au contenu

Social Comments

Ce contenu n’est pas encore disponible dans votre langue.

The Social Comments resource provides fake social media comment data with content, engagement metrics, and author information.

MethodEndpointDescription
GET/v1/social-commentsList all social comments
GET/v1/social-comments/:idGet a specific social comment
{
"id": 1,
"socialPostId": 1,
"userId": 2,
"content": "Congrats on the launch!",
"likesCount": 3,
"createdAt": "2026-01-15T11:00:00.000Z",
"updatedAt": "2026-01-15T11:00:00.000Z"
}
Field Type Description
id number Unique identifier
socialPostId number ID of the parent post
userId number ID of the comment author
content string Comment text content
likesCount number Number of likes on the comment
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Terminal window
curl https://api.phantomjson.app/v1/social-comments
Parameter Type Default Description
page number 1 Page number
limit number 20 Items per page (max: 100)
sort string Sort field and direction
q string Search query
fields string Fields to return
socialPostId number Filter by post ID
userId number Filter by user ID
{
"data": [
{
"id": 1,
"socialPostId": 1,
"userId": 2,
"content": "Congrats on the launch!",
"likesCount": 3
}
],
"meta": {
"total": 50,
"page": 1,
"limit": 20,
"totalPages": 3
}
}
Terminal window
curl https://api.phantomjson.app/v1/social-comments/1
{
"data": {
"id": 1,
"socialPostId": 1,
"userId": 2,
"content": "Congrats on the launch!",
"likesCount": 3,
"createdAt": "2026-01-15T11:00:00.000Z",
"updatedAt": "2026-01-15T11:00:00.000Z"
}
}
Terminal window
curl "https://api.phantomjson.app/v1/social-comments?q=congrats"
Terminal window
curl "https://api.phantomjson.app/v1/social-comments?socialPostId=1"
Terminal window
curl "https://api.phantomjson.app/v1/social-comments?userId=2"
Terminal window
# Newest first
curl "https://api.phantomjson.app/v1/social-comments?sort=createdAt:desc"
# Oldest first
curl "https://api.phantomjson.app/v1/social-comments?sort=createdAt:asc"
Terminal window
curl "https://api.phantomjson.app/v1/social-comments?fields=id,content,userId,likesCount"
Terminal window
# Comments on post 1 from user 2, sorted by newest
curl "https://api.phantomjson.app/v1/social-comments?socialPostId=1&userId=2&sort=createdAt:desc"
  • Social Post — Each comment belongs to a social post (socialPostId)
  • User — Each comment belongs to a user (userId)