How to use the Data Solutions API
The Data Solutions API provides access to Trustpilot’s data for all business profiles.
To retrieve specific information about a business, such as its TrustScore or consumer reviews, you’ll first need to find its unique identifier, known as a business unit ID.
Step 1: Find the Business Unit ID
Section titled “Step 1: Find the Business Unit ID”To get started, you need to find the unique business unit ID for the company you’re interested in. You can do this by using the Find business unit and searching by the company’s domain name.
For example, to find the business unit ID for trustpilot.com:
curl -X GET "https://api.trustpilot.com/data-solutions/v1/business-units?domain=trustpilot.com" \ -H "apikey: YOUR-API-KEY-HERE"
The API will return a response containing the business unit details, including the id. Copy this business unit ID to use in the next step. A typical response will look like this:
{ "businessUnits": [ { "id": "507f191e810c19729de860ea", "displayName": "Trustpilot", "name": { "referring": [ "Trustpilot" ], "identifying": "Trustpilot" } } ]}
Step 2: Get Business Data Using the Business Unit ID
Section titled “Step 2: Get Business Data Using the Business Unit ID”Once you have the business unit ID, you can use it as a path parameter in other endpoints to retrieve specific data for that business.
Get a Business’s TrustScore
Section titled “Get a Business’s TrustScore”To get a business’s TrustScore, star rating, and the total number of reviews, use the Get business unit details endpoint and include the business unit ID in the URL.
curl -X GET "https://api.trustpilot.com/data-solutions/v1/business-units/507f191e810c19729de860ea" \ -H "apikey: YOUR-API-KEY-HERE"
Get a Business’s Reviews
Section titled “Get a Business’s Reviews”To retrieve consumer reviews for a business, use the Get service reviews with the business unit ID. You can also specify a date range to get reviews for a particular period.
For example:
curl -X GET "https://api.trustpilot.com/data-solutions/v1/business-units/507f191e810c19729de860ea/reviews" \ -H "apikey: YOUR-API-KEY-HERE"
The response for a service review includes the following details:
Response | Description |
---|---|
id | The review ID |
stars | How many stars the consumer has given the domain, out of 5. |
title | What the consumer titled the review. |
text | The body of the review. |
language | The language the review is written in |
createdAt | The time the review was submitted. |
updatedAt | The time the review was updated at, if at all. |
experiencedAt | The point in the user journey that the review is about. For example, delivery. |
source | Whether the review was organic or prompted by an invitation. |