Skip to content

Quick Start

Terminal window
curl https://api.phantomjson.app/v1/users

That’s it. You get 100 fake users with realistic names, emails, and timestamps.

Terminal window
# Get posts
curl https://api.phantomjson.app/v1/posts
# Get todos
curl https://api.phantomjson.app/v1/todos
# Get products
curl https://api.phantomjson.app/v1/products
Terminal window
# Get page 2 with 10 items
curl "https://api.phantomjson.app/v1/users?page=2&limit=10"
Terminal window
# Search for users
curl "https://api.phantomjson.app/v1/users?q=john"
Terminal window
# Filter by field
curl "https://api.phantomjson.app/v1/todos?completed=true"
# Advanced filtering
curl "https://api.phantomjson.app/v1/products?price[gte]=50&price[lte]=200"
Terminal window
# Sort by name ascending
curl "https://api.phantomjson.app/v1/users?sort=firstName:asc"
Terminal window
# Get only specific fields
curl "https://api.phantomjson.app/v1/users?fields=id,firstName,email"
Terminal window
# Get posts by a specific user
curl "https://api.phantomjson.app/v1/users/1/posts"
# Get comments on a post
curl "https://api.phantomjson.app/v1/posts/1/comments"
# Get photos in an album
curl "https://api.phantomjson.app/v1/photos/album/1"

All responses follow a consistent format:

{
"data": [...],
"meta": {
"total": 100,
"page": 1,
"limit": 20,
"totalPages": 5
}
}

Single resources return:

{
"data": { ... }
}
  • Read the API Conventions to understand pagination, filtering, sorting, and search
  • Browse Resources for detailed endpoint documentation