Social Comments
Ce contenu n’est pas encore disponible dans votre langue.
Overview
Section titled “Overview”The Social Comments resource provides fake social media comment data with content, engagement metrics, and author information.
Endpoints
Section titled “Endpoints”| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/social-comments | List all social comments |
| GET | /v1/social-comments/:id | Get a specific social comment |
Social Comment Object
Section titled “Social Comment Object”{ "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 |
List Social Comments
Section titled “List Social Comments”curl https://api.phantomjson.app/v1/social-commentsQuery Parameters
Section titled “Query Parameters”| 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 |
Response
Section titled “Response”{ "data": [ { "id": 1, "socialPostId": 1, "userId": 2, "content": "Congrats on the launch!", "likesCount": 3 } ], "meta": { "total": 50, "page": 1, "limit": 20, "totalPages": 3 }}Get Social Comment by ID
Section titled “Get Social Comment by ID”curl https://api.phantomjson.app/v1/social-comments/1Response
Section titled “Response”{ "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" }}Examples
Section titled “Examples”Search Comments
Section titled “Search Comments”curl "https://api.phantomjson.app/v1/social-comments?q=congrats"Filter by Post
Section titled “Filter by Post”curl "https://api.phantomjson.app/v1/social-comments?socialPostId=1"Filter by User
Section titled “Filter by User”curl "https://api.phantomjson.app/v1/social-comments?userId=2"Sort by Creation Date
Section titled “Sort by Creation Date”# Newest firstcurl "https://api.phantomjson.app/v1/social-comments?sort=createdAt:desc"
# Oldest firstcurl "https://api.phantomjson.app/v1/social-comments?sort=createdAt:asc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/social-comments?fields=id,content,userId,likesCount"Combined Query
Section titled “Combined Query”# Comments on post 1 from user 2, sorted by newestcurl "https://api.phantomjson.app/v1/social-comments?socialPostId=1&userId=2&sort=createdAt:desc"Relations
Section titled “Relations”- Social Post — Each comment belongs to a social post (
socialPostId) - User — Each comment belongs to a user (
userId)
