Brands
Overview
Section titled “Overview”The Brands resource provides fake brand data with names, slugs, descriptions, and logos.
Endpoints
Section titled “Endpoints”| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/brands | List all brands |
| GET | /v1/brands/:id | Get a specific brand |
| GET | /v1/brands/:id/products | Get brand's products |
Brand Object
Section titled “Brand Object”{ "id": 1, "name": "Acme Corp", "slug": "acme-corp", "description": "Innovation meets quality", "logo": "https://example.com/images/acme-logo.png"}| Field | Type | Description |
|---|---|---|
id |
number |
Unique identifier |
name |
string |
Brand name |
slug |
string |
URL-friendly unique slug |
description |
string |
Brand description |
logo |
string |
Brand logo URL |
List Brands
Section titled “List Brands”curl https://api.phantomjson.app/v1/brandsQuery 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 |
Response
Section titled “Response”{ "data": [ { "id": 1, "name": "Acme Corp", "slug": "acme-corp", "description": "Innovation meets quality" } ], "meta": { "total": 30, "page": 1, "limit": 20, "totalPages": 2 }}Get Brand by ID
Section titled “Get Brand by ID”curl https://api.phantomjson.app/v1/brands/1Response
Section titled “Response”{ "data": { "id": 1, "name": "Acme Corp", "slug": "acme-corp", "description": "Innovation meets quality", "logo": "https://example.com/images/acme-logo.png" }}Get Brand’s Products
Section titled “Get Brand’s Products”curl https://api.phantomjson.app/v1/brands/1/productsResponse
Section titled “Response”{ "data": [ { "id": 1, "name": "Ergonomic Rubber Keyboard", "slug": "ergonomic-rubber-keyboard", "price": 299.99, "brandId": 1 } ], "meta": { "total": 40, "page": 1, "limit": 20, "totalPages": 2 }}Examples
Section titled “Examples”Search Brands
Section titled “Search Brands”curl "https://api.phantomjson.app/v1/brands?q=acme"Sort by Name
Section titled “Sort by Name”curl "https://api.phantomjson.app/v1/brands?sort=name:asc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/brands?fields=id,name,slug"Relations
Section titled “Relations”- Products — Each brand has many products (access via
/v1/brands/:id/products)
