How to use the Data Solutions API
The Data Solutions API provides access to Trustpilot’s data for all Business Units (domains).
To get specific information about a business, such as its TrustScore or consumer reviews, use the following steps:
Step 1: Find the Business Unit ID
Section titled “Step 1: Find the Business Unit ID”To get started, you need to find the Business Unit ID for the company you’re interested in. You can do this by using the Find business unit endpoint and searching by the company’s domain name.
For example, to find trustpilot.com’s Business Unit ID, use the following code:
curl -X GET "https://api.trustpilot.com/data-solutions/v1/business-units?domain=trustpilot.com" \ -H "apikey: YOUR-API-KEY-HERE"
The API returns the Business Unit ID and other basic company details. Copy the ID to use in the next step. A typical response might look like this:
{ "businessUnits": [ { "id": "507f191e810c19729de860ea", "displayName": "Trustpilot", "name": { "referring": [ "Trustpilot" ], "identifying": "Trustpilot" } } ]}
Step 2: Get business data
Section titled “Step 2: Get business data”If you’ve got the Business Unit ID for a business you’re interested in, use the following scenarios to retrieve specific data for that business.
Get the TrustScore
Section titled “Get the TrustScore”To get a Business Unit’s TrustScore, star rating and the total number of reviews, use the Get business unit details endpoint and provide the Business Unit’s ID as a path parameter.
For example:
curl -X GET "https://api.trustpilot.com/data-solutions/v1/business-units/507f191e810c19729de860ea" \ -H "apikey: YOUR-API-KEY-HERE"
Get the latest reviews for a business unit
Section titled “Get the latest reviews for a business unit”If you want to display an up to date sample of a business’s reviews, use the Get latest reviews for business unitendpoint. To use this endpoint, pass in the Business Unit ID and define the number of reviews (up to five) that you want to receive.
For example:
curl -X GET "https://api.trustpilot.com/data-solutions/v1/business-units/507f191e810c19729de860ea/reviews/latest" \ -H "apikey: YOUR-API-KEY-HERE"
The response for a latest service review includes the following:
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, 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. |
Get service review data
Section titled “Get service review data”To access a Business Unit’s reviews, use the Get service reviews endpoint and provide the Business Unit’s ID as a path parameter.
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:
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, 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. |