Categories API
-
List categories
Get a list of all categories.
HTTP method: GET
Authentication: API Key
URL: https://api.trustpilot.com/v1/categories
Parameters
-
country, Optional string
Specify country using ISO 3166-1-alpha-2.
Example: ?country=DK
-
locale, Optional string
The locale to get translated category names for.
Example: ?locale=da-DK
-
parentId, Optional string
Optional id of a parent category to list children of.
Example: ?parentId=animals_pets
curl -X GET "https://api.trustpilot.com/v1/categories" \-H "apikey: YOUR-API-KEY-HERE"Response
{"categories": [{"categoryId": "pet_store","displayName": "Pet Store","name": "pet_store"}]} -
-
Get category
Get details of a specific category.
HTTP method: GET
Authentication: API Key
URL: https://api.trustpilot.com/v1/categories/{categoryId}
Parameters
-
categoryId, Required string
The id of the category to get details about.
Example: .../v1/categories/pet_store
-
country, Required string
Specify country using ISO 3166-1-alpha-2.
Example: ?country=US
-
locale, Optional string
The locale to get translated category names for.
Example: ?locale=da-DK
curl -X GET "https://api.trustpilot.com/v1/categories/{categoryId}" \-G \--data-urlencode "country=US" \-H "apikey: YOUR-API-KEY-HERE"Response
{"businessUnitCount": 42,"parentId": "animals_pets","displayName": "Pet Store","categoryId": "pet_store","name": "pet_store"} -
-
List business units in category
Get a list of business units in a specific category. NOTE rank result values are obsolete.
HTTP method: GET
Authentication: API Key
URL: https://api.trustpilot.com/v1/categories/{categoryId}/business-units
Parameters
-
categoryId, Required string
The id of the category to get business unit list for.
Example: .../v1/categories/building_materials_supplier/business-units
-
country, Optional string
The country of the business units.
Example: ?country=US
-
locale, Optional string
The locale to get translated category names for.
Example: ?locale=en-US
-
page, Optional number
The page to retrieve. If the page number requested is higher than the available number of pages an empty array will be returned.
Example: ?page=1
-
perPage, Optional number
The number of business units to retrieve per page.
Example: ?perPage=20
curl -X GET "https://api.trustpilot.com/v1/categories/{categoryId}/business-units" \-H "apikey: YOUR-API-KEY-HERE"Response
{"totalNumberOfBusinesses": 3456,"businessUnits": [{"businessUnitId": "507f191e810c19729de860ea","displayName": "Trustpilot","identifyingName": "Trustpilot","trustScore": 4.5,"numberOfReviews": 308,"rank": 0,"location": {"city": "Copenhagen","zipCode": 2100,"address": "Ved Stranden 18"},"logoUrl": "https://example.com/logo.png","categories": [{"categoryId": "pet_store","displayName": "Pet Store","name": "pet_store","isPrimary": true,"ranking": {"position": 1,"cardinality": 13},"source": "business","relevance": 1}]}]} -