Category tree endpoint

GEThttps://api.scrapereviews.com/v1/categories1 credit

The categories endpoint returns the whole Trustpilot category tree in one response: the top-level categories (Animals & Pets, Money & Insurance, Shopping & Fashion and the others) and, nested under each one, its subcategories with their own subcategories.

Every node has an id and an English name. The id is what the category companies endpoint expects: bank, shoe_store, car_dealer, electronics_technology and so on. The tree changes rarely, so fetch it once, store it and refresh it every few weeks.

The endpoint takes no parameters. Use it to build a category picker, to map your own industry codes to Trustpilot categories, or to iterate over every subcategory of a sector when you rank companies.

Parameters

This endpoint takes no parameters.

Authenticate with your API key in the X-API-Key header or as Authorization: Bearer (see authentication).

Example request

curl "https://api.scrapereviews.com/v1/categories" \
  -H "X-API-Key: sr_your_api_key"

Response

Shape
{ "data": Category[], "meta": BaseMeta }
Example (shortened)
{
  "data": [
    {
      "id": "animals_pets",
      "name": "Animals & Pets",
      "subcategories": [
        { "id": "animal_health", "name": "Animal Health", "subcategories": [] },
        { "id": "pet_store", "name": "Pet Store", "subcategories": [] }
      ]
    }
  ],
  "meta": { "credits_used": 1, "cache_hit": true }
}

Every field is described in the response models. Successful responses also carry the X-Credits-Used header.

Cost

The whole tree costs 1 credit, whatever its size. It is cached for 24 hours.

Only successful calls are billed: every error costs 0 credits. You get 100 free credits every month; see pricing for credit packs.

Errors

Errors come with an HTTP status and this JSON body: branch on detail.error, show detail.message to humans.

Example error
{
  "detail": {
    "error": "invalid_api_key",
    "message": "Invalid or inactive API key."
  }
}
HTTPerrorMeaning
401missing_api_keyNo API key in X-API-Key or Authorization: Bearer.
401invalid_api_keyThe key does not exist or has been revoked.
402insufficient_creditsYour credit balance is 0.
429rate_limit_exceededToo many requests per minute.
429insufficient_credits_retry_laterThe balance ran out on recent calls and the key is cooling down.
502upstream_changedTrustpilot changed its page format and the response could not be read.
503upstream_blockedTrustpilot is temporarily blocking requests.
504upstream_timeoutTrustpilot did not answer in time.

What to do for each code: error handling.

Use cases

  • Build a category selector for a market research tool.
  • Walk every subcategory of a sector (for example all of Money & Insurance) and rank its companies by country.
  • Map Trustpilot categories to your own taxonomy once and store the ids.

Related endpoints

  • Category companies GET /v1/categories/{category_id}/companies: The companies of a category in a country.
  • Company search GET /v1/companies/search: Search companies by name or domain. An exact domain returns that company.

ScrapeReviews is an independent service and is not affiliated with or endorsed by Trustpilot.