Skip to content

API Overview

https://api.phantomjson.app/v1

All API endpoints use URI versioning:

/v1/users
/v1/posts
/v1/products

All responses use a consistent envelope format.

{
"data": [...],
"meta": {
"total": 100,
"page": 1,
"limit": 20,
"totalPages": 5
}
}
{
"data": {
"id": 1,
"firstName": "John",
"lastName": "Doe"
}
}
{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found",
"path": "/v1/users/999",
"timestamp": "2026-01-15T10:30:00.000Z"
}
Method Description
GET Retrieve resources
POST Create resources
PUT Update resources
PATCH Partially update resources
DELETE Delete resources

Most endpoints support the following query parameters:

Parameter Description Example
page Page number (default: 1) ?page=2
limit Items per page (default: 20, max: 100) ?limit=10
sort Sort by field(s) ?sort=firstName:asc
q Search query ?q=john
fields Select specific fields ?fields=id,firstName

See Pagination, Filtering, Sorting, Search, and Field Selection for details.

All requests and responses use JSON:

Content-Type: application/json

PhantomJSON enforces rate limiting:

  • 100 requests per minute per IP address
  • Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 60

When rate limited, you’ll receive a 429 Too Many Requests response.

A complete Postman collection is available for all API endpoints.

  1. Download the collection file from the GitHub repository
  2. Open Postman
  3. Select ImportFile → choose the JSON file
  4. The collection appears in your workspace with all endpoints organized by domain

The collection uses variables so you can switch environments:

Variable Default Description
baseUrl https://api.phantomjson.app API host
apiVersion v1 API version prefix

To run against a local instance, change baseUrl to http://localhost:5000.

  • 87 requests across 6 domains (Users, Posts, E-commerce, Social, Organizations, Travel)
  • Test scripts that validate status codes and response structure
  • Query parameter examples (pagination, search, filtering, sorting)
  • Nested relationship endpoints (e.g. /users/:id/posts, /products/:id/reviews)