Skip to content

Social Posts

The Social Posts resource provides fake social media post data with content, visibility settings, engagement metrics, and author information.

MethodEndpointDescription
GET/v1/social-postsList all social posts
GET/v1/social-posts/:idGet a specific social post
GET/v1/social-posts/:id/commentsGet post's comments
GET/v1/social-posts/:id/likesGet post's likes
GET/v1/social-posts/:id/mediaGet post's media
{
"id": 1,
"authorId": 1,
"content": "Just shipped a new feature! #coding #webdev",
"visibility": "public",
"status": "published",
"likesCount": 42,
"commentsCount": 8,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
Field Type Description
id number Unique identifier
authorId number ID of the post author
content string Post text content
visibility string Visibility (public, friends, private)
status string Status (published, draft, archived)
likesCount number Number of likes
commentsCount number Number of comments
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Terminal window
curl https://api.phantomjson.app/v1/social-posts
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
authorId number Filter by author ID
visibility string Filter by visibility
status string Filter by status
{
"data": [
{
"id": 1,
"authorId": 1,
"content": "Just shipped a new feature! #coding #webdev",
"visibility": "public",
"status": "published",
"likesCount": 42,
"commentsCount": 8
}
],
"meta": {
"total": 100,
"page": 1,
"limit": 20,
"totalPages": 5
}
}
Terminal window
curl https://api.phantomjson.app/v1/social-posts/1
{
"data": {
"id": 1,
"authorId": 1,
"content": "Just shipped a new feature! #coding #webdev",
"visibility": "public",
"status": "published",
"likesCount": 42,
"commentsCount": 8,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
}
Terminal window
curl https://api.phantomjson.app/v1/social-posts/1/comments
{
"data": [
{
"id": 1,
"socialPostId": 1,
"userId": 2,
"content": "Congrats on the launch!",
"likesCount": 3
}
],
"meta": {
"total": 8,
"page": 1,
"limit": 20,
"totalPages": 1
}
}
Terminal window
curl https://api.phantomjson.app/v1/social-posts/1/likes
{
"data": [
{
"id": 1,
"socialPostId": 1,
"userId": 2,
"createdAt": "2026-01-15T11:00:00.000Z"
}
],
"meta": {
"total": 42,
"page": 1,
"limit": 20,
"totalPages": 3
}
}
Terminal window
curl https://api.phantomjson.app/v1/social-posts/1/media
{
"data": [
{
"id": 1,
"socialPostId": 1,
"url": "https://example.com/images/screenshot.jpg",
"type": "image",
"width": 1920,
"height": 1080
}
],
"meta": {
"total": 2,
"page": 1,
"limit": 20,
"totalPages": 1
}
}
Terminal window
curl "https://api.phantomjson.app/v1/social-posts?q=coding"
Terminal window
curl "https://api.phantomjson.app/v1/social-posts?authorId=1"
Terminal window
curl "https://api.phantomjson.app/v1/social-posts?visibility=public"
Terminal window
curl "https://api.phantomjson.app/v1/social-posts?status=published"
Terminal window
# Newest first
curl "https://api.phantomjson.app/v1/social-posts?sort=createdAt:desc"
# Oldest first
curl "https://api.phantomjson.app/v1/social-posts?sort=createdAt:asc"
Terminal window
curl "https://api.phantomjson.app/v1/social-posts?fields=id,content,likesCount,commentsCount"
Terminal window
# Published public posts from author 1, sorted by newest
curl "https://api.phantomjson.app/v1/social-posts?authorId=1&visibility=public&status=published&sort=createdAt:desc"
  • Author — Each post belongs to a user (authorId)
  • Comments — Each post has many comments (access via /v1/social-posts/:id/comments)
  • Likes — Each post has many likes (access via /v1/social-posts/:id/likes)
  • Media — Each post has many media attachments (access via /v1/social-posts/:id/media)