Batch

Create a batch

To create a new categorization batch, use the following endpoint:

POST https://api.categoryapi.com/prod/batch

The payload should look like the following:

{
  "name": "E-commerce websites",
  "urls": [
    "devialet.com",
    "aesop.com"
  ],
  "webhook_url": "https://hooks.zapier.com/hooks/catch/1234567/f8f22dgg/"
}

Parameters

  • name (Required): Name for your batch

  • urls (Required): List of URLs to categorize. Each URL counts as one credit.

  • webhook_url (Optional): URL we should trigger with the results to when the batch is complete.

Response

This endpoint responds with 202 Accepted including the batch ID, after which your URLs will be queued to categorize.

{
  "id": "631c049168a3baf449afd1b4"
}

Batch processing time depends on the number of URLs and current workload. It can vary from a few seconds up to a few hours.

When completed, the status changes to complete.

You can poll the GET endpoint using the batch ID for status updates or optionally use a webhook URL to get the categorized batch posted to you automatically.

Credit usage

This API endpoint counts toward your credit usage. Each URL in a batch counts as one credit, which are immediately debited from your account balance.

When the batch processing is complete, we'll automatically refund your credits pro-rata for any URL(s) we haven't been able to categorize, if any.