Batch
Retrieve a batch
To retrieve a batch by its ID, use the following endpoint:
GET https://api.categoryapi.com/prod/batch/{batch_id}
Response
This endpoint responds with 200 OK including a list of all the batch URLs including their category ID and names, if processing is complete.
{
"id": "631c049168a3baf449afd1b4",
"name": "E-commerce websites",
"status": "complete",
"urls": [
{
"url": "devialet.com",
"category_id": 249,
"category_names": [
"Electronics",
"Audio",
"Audio Components",
"Speakers"
]
},
{
"url": "aesop.com",
"category_id": 473,
"category_names": [
"Health & Beauty",
"Personal Care",
"Cosmetics"
]
}
]
}
Batch status
The status
parameter within the response will indicate the status of your batch. This can either be:
processing
if the categorization is still in progress.complete
if all URLs have been processed and categorized.
If the batch is still processing, you can retry in a few minutes to get the complete data.
Categories
Each categorized URL consists of:
A
category_id
, which matches the Google product categories. You can get the full list from our API as documented here.An array of
category_names
, also matching the Google product classification.
For each URL, CategoryAPI returns the most popular category found, and the precision can range from 1 to 7 levels deep.
For example, here's what the API would return for apple.com
:
{
"url": "apple.com",
"category_id": 267,
"category_names": [
"Electronics",
"Communications",
"Telephony",
"Mobile Phones"
]
}
In this case, Mobile Phones
is indeed the most popular product category for Apple, but a broader category might be sufficient for your use case. If so, feel free to keep only the first few category names for each URL.
Credit usage
This API endpoint does not count toward your credit usage.