PetSmart API endpoint
Returns PetSmart's category directory: every category path (for example Dog > Food > Dry Food) with its name, parent path and depth, about 1,400 in all, hierarchical so a parent path covers its descendants. A category's path is the value /petsmart/search and /petsmart/search/filters take as category. Filter with query (text in the path), parent (descendants of a path) and depth, and page through with page and limit. Ancestor paths that the directory does not list itself are included, since products carry them and they are valid category filters. Pass country=ca for the Canadian catalog.
/petsmart/categoriesProducts carry every ancestor of their category, so ancestor paths the directory does not list itself (for example Dog > Food) are included as valid category filters; they have no key or id.
Query parameters (all optional): country (us default or ca; the Canadian directory has about 850 paths), query (text in the path, case-insensitive), parent (a path; keeps only its descendants; an unknown path returns a 400), depth (exact depth, 1 for top level), page (1-based, default 1) and limit (default 100, maximum 500).
| Field | Filled in, of 32 checked | Values in the sample |
|---|---|---|
| path | 32 | “Bird” and 31 other values |
| name | 32 | “Bird” and 31 other values |
| depth | 32 | 1 |
| key | 26 | |
| id | 11 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| country | string | No | Optional catalog: us (default) or ca for the Canadian store, which has its own products (about 9,000), categories, filters and prices. Allowed values: us, ca. | us | |
| query | string | No | Optional text; keeps categories whose path contains it (case-insensitive). | treats | |
| parent | string | No | Optional category path; keeps only its descendants. | Dog > Food | |
| depth | integer | No | Optional exact depth: 1 for top-level categories, 2 for their children, and so on. | 2 | |
| page | integer | No | 1 | Optional 1-based page number. Defaults to 1. | 1 |
| limit | integer | No | 100 | Optional categories per page. Defaults to 100, maximum 500. | 100 |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/petsmart/categories?country=us&query=coffee&page=1&limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"country": "us",
"page": 1,
"limit": 100,
"total_results": 9,
"categories": [
{
"path": "Dog > Food > Dry Food",
"name": "Dry Food",
"parent": "Dog > Food",
"depth": 3,
"key": "100246-us",
"id": 100246
}
]
}
}Request schema
No body schema
Response schema
#/definitions/petsmart.categoriesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | Code is the HTTP status code or a custom code used to indicate the result of the request @example 200 | |||
| data | petsmart.CategoriesResponse | No | ||||
| data.categories | array | No | ||||
| data.categories[].depth | integer | No | ||||
| data.categories[].id | integer | No | ||||
| data.categories[].key | string | No | Key is PetSmart's category key and ID its numeric part. | |||
| data.categories[].name | string | No | ||||
| data.categories[].parent | string | No | Parent is the path of the parent category; empty for a top-level one. | |||
| data.categories[].path | string | No | Path is the value /petsmart/search takes as category, for example "Dog > Food > Dry Food". It includes the category's descendants. | |||
| data.country | string | No | ||||
| data.limit | integer | No | ||||
| data.page | integer | No | ||||
| data.total_results | integer | No | ||||
| msg | unknown | No | Msg is the message that describes the result of the request @example "Request successful" |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/petsmart/categories?country=us&query=coffee&page=1&limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"