Products
Overview
Section titled “Overview”The Products resource provides fake product data with names, prices, descriptions, and categories.
Endpoints
Section titled “Endpoints”Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/products | List all products |
| GET | /v1/products/:id | Get a specific product |
Product Object
Section titled “Product Object”{ "id": 1, "name": "Ergonomic Rubber Keyboard", "description": "Carbonite neutralizes our open-source, virtual RAM drive.", "price": 299.99, "category": "smartphones", "createdAt": "2026-01-15T10:30:00.000Z", "updatedAt": "2026-01-15T10:30:00.000Z"}| Field | Type | Description |
|---|---|---|
id |
number |
Unique identifier |
name |
string |
Product name |
description |
string |
Product description |
price |
number |
Product price |
category |
string |
Product category |
createdAt |
string |
ISO 8601 timestamp |
updatedAt |
string |
ISO 8601 timestamp |
List Products
Section titled “List Products”curl https://api.phantomjson.app/v1/productsQuery 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 |
name |
string |
— | Filter by name |
category |
string |
— | Filter by category |
Response
Section titled “Response”{ "data": [ { "id": 1, "name": "Ergonomic Rubber Keyboard", "description": "Carbonite neutralizes our open-source, virtual RAM drive.", "price": 299.99, "category": "smartphones" } ], "meta": { "total": 100, "page": 1, "limit": 20, "totalPages": 5 }}Get Product by ID
Section titled “Get Product by ID”curl https://api.phantomjson.app/v1/products/1Response
Section titled “Response”{ "data": { "id": 1, "name": "Ergonomic Rubber Keyboard", "description": "Carbonite neutralizes our open-source, virtual RAM drive.", "price": 299.99, "category": "smartphones" }}Examples
Section titled “Examples”Search Products
Section titled “Search Products”curl "https://api.phantomjson.app/v1/products?q=keyboard"Filter by Category
Section titled “Filter by Category”curl "https://api.phantomjson.app/v1/products?category=smartphones"Filter by Price Range
Section titled “Filter by Price Range”curl "https://api.phantomjson.app/v1/products?price[gte]=50&price[lte]=200"Sort by Price
Section titled “Sort by Price”# Cheapest firstcurl "https://api.phantomjson.app/v1/products?sort=price:asc"
# Most expensive firstcurl "https://api.phantomjson.app/v1/products?sort=price:desc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/products?fields=id,name,price,category"Combined Query
Section titled “Combined Query”# Cheap smartphones sorted by pricecurl "https://api.phantomjson.app/v1/products?category=smartphones&price[lte]=500&sort=price:asc&fields=id,name,price"Categories
Section titled “Categories”Available product categories:
smartphoneslaptopstabletsaccessoriescamerasaudio
Relations
Section titled “Relations”- Products are standalone resources with no relationships to other endpoints.
