Amazon API
Categories
List all Amazon top-level browse categories and their IDs for a given country.
POST
$0.01/call/v1/amazon/categoriesUsage
const res = await fetch('https://api.yepapi.com/v1/amazon/categories', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ country: 'US' }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/amazon/categories \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"country": "US"}'import requests
res = requests.post(
"https://api.yepapi.com/v1/amazon/categories",
headers={"x-api-key": "YOUR_API_KEY"},
json={"country": "US"},
)
print(res.json()["data"])Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
country | string | No | ISO alpha-2 country code | US |
Response
{
"ok": true,
"data": {
"status": "OK",
"request_id": "e2a81e08-6840-48e0-b793-8490cd956386",
"parameters": { "country": "US" },
"data": [
{ "name": "All Departments", "id": "aps" },
{ "name": "Alexa Skills", "id": "alexa-skills" },
{ "name": "Amazon Devices", "id": "amazon-devices" },
{ "name": "Appliances", "id": "appliances" },
{ "name": "Baby", "id": "baby-products" },
{ "name": "Beauty & Personal Care", "id": "beauty" },
{ "name": "Books", "id": "stripbooks" },
{ "name": "Cell Phones & Accessories", "id": "mobile" },
{ "name": "Clothing, Shoes & Jewelry", "id": "fashion" },
{ "name": "Electronics", "id": "electronics" },
{ "name": "Home & Kitchen", "id": "garden" },
{ "name": "Software", "id": "software" }
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.data | array | Ordered list of top-level category nodes |
data.data[].name | string | Display name (may include leading whitespace for nested subcategories) |
data.data[].id | string | Category slug/ID (e.g. stripbooks, software) used by /best-sellers |
Info
These IDs are the Amazon leaf slugs used by /v1/amazon/best-sellers. They differ from the numeric browse-node IDs used by /v1/amazon/products-by-category (e.g. 2478868012).