Aller au contenu

Products

Ce contenu n’est pas encore disponible dans votre langue.

The Products resource provides fake product data with names, prices, descriptions, categories, brands, and stock information.

MethodEndpointDescription
GET/v1/productsList all products
GET/v1/products/:idGet a specific product
GET/v1/products/:id/reviewsGet product's reviews
{
"id": 1,
"name": "Ergonomic Rubber Keyboard",
"slug": "ergonomic-rubber-keyboard",
"description": "Carbonite neutralizes our open-source, virtual RAM drive.",
"price": 299.99,
"currency": "USD",
"discountPercentage": 10,
"stock": 50,
"sku": "KEYB-001",
"brandId": 1,
"categoryId": 1,
"rating": 4.5,
"thumbnail": "https://example.com/images/keyboard.jpg",
"images": [
"https://example.com/images/keyboard.jpg",
"https://example.com/images/keyboard-2.jpg"
],
"status": "active",
"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
slug string URL-friendly unique slug
description string Product description
price number Product price
currency string Currency code (e.g. USD)
discountPercentage number Discount percentage (0–100)
stock number Available stock count
sku string Stock keeping unit
brandId number ID of the brand
categoryId number ID of the category
rating number Average rating (0–5)
thumbnail string Thumbnail image URL
images string[] Array of image URLs
status string Status (active, draft, archived)
category string Legacy category string
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Try it
Terminal window
curl https://api.phantomjson.app/v1/products
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 string
categoryId number Filter by category ID
brandId number Filter by brand ID
status string Filter by status
{
"data": [
{
"id": 1,
"name": "Ergonomic Rubber Keyboard",
"slug": "ergonomic-rubber-keyboard",
"price": 299.99,
"currency": "USD",
"category": "smartphones"
}
],
"meta": {
"total": 100,
"page": 1,
"limit": 20,
"totalPages": 5
}
}
Try it
Terminal window
curl https://api.phantomjson.app/v1/products/1
{
"data": {
"id": 1,
"name": "Ergonomic Rubber Keyboard",
"slug": "ergonomic-rubber-keyboard",
"description": "Carbonite neutralizes our open-source, virtual RAM drive.",
"price": 299.99,
"currency": "USD",
"discountPercentage": 10,
"stock": 50,
"sku": "KEYB-001",
"brandId": 1,
"categoryId": 1,
"rating": 4.5,
"status": "active"
}
}
Terminal window
curl https://api.phantomjson.app/v1/products/1/reviews
{
"data": [
{
"id": 1,
"productId": 1,
"userId": 1,
"rating": 5,
"title": "Great product!",
"comment": "Really love this keyboard."
}
],
"meta": {
"total": 3,
"page": 1,
"limit": 20,
"totalPages": 1
}
}
Terminal window
curl "https://api.phantomjson.app/v1/products?q=keyboard"
Terminal window
curl "https://api.phantomjson.app/v1/products?category=smartphones"
Terminal window
curl "https://api.phantomjson.app/v1/products?brandId=1"
Terminal window
curl "https://api.phantomjson.app/v1/products?price[gte]=50&price[lte]=200"
Terminal window
# Cheapest first
curl "https://api.phantomjson.app/v1/products?sort=price:asc"
# Most expensive first
curl "https://api.phantomjson.app/v1/products?sort=price:desc"
Terminal window
curl "https://api.phantomjson.app/v1/products?fields=id,name,price,category"
Terminal window
# Cheap smartphones sorted by price
curl "https://api.phantomjson.app/v1/products?category=smartphones&price[lte]=500&sort=price:asc&fields=id,name,price"

Available product categories:

  • smartphones
  • laptops
  • tablets
  • accessories
  • cameras
  • audio
  • Brand — Each product may belong to a brand (brandId)
  • Category — Each product may belong to a category (categoryId)
  • Reviews — Each product has many reviews (access via /v1/products/:id/reviews)