How to use the Data Solutions API
The Data Solutions API provides access to Trustpilot’s data for all Business Units (domains).
To get information about a domain, 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 units endpoint and searching by the company’s domain name. If you don’t know the company’s domain name, or if you want to get data for a cohort of domains, you can also search by country code and/or category.
For example, to use trustpilot.com’s domain name to find the 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" }, "address": { "countryCode": "GB" } } ]}Expand to view response table
The Find business units response includes the following:
| Response | Description |
|---|---|
| id | The business unit’s ID on Trustpilot. |
| name | Container for the business’s names. |
| name.display | The name of the business as shown on Trustpilot. |
| name.identifying | The base URL of the business website. |
| address.countryCode | The ISO 3166-1 alpha-2 code for the country. |
If your search returns a high volume of responses, the results will be limited to 100 responses per page. You’ll receive a nextToken to navigate through pages of results.
Step 2: Get business data
Section titled “Step 2: Get business data”Once you’ve got the Business Unit ID, you can retrieve specific details for that business, such as the business unit details, latest reviews or all service reviews.
Get business unit details
Section titled “Get business unit details”To get a Business Unit’s TrustScore, star rating, category 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"Expand to view response table
The Get business unit details response includes the following:
| Response | Description |
|---|---|
| id | The business unit’s ID on Trustpilot. |
| name | Container for the business’s names. |
| name.display | The name of the business as shown on Trustpilot. |
| name.identifying | The base URL of the business website. |
| name.referring | A list of domains associated with the business. |
| categories | Container for the business’s category information. |
| categories[].categoryId | Category identifier. |
| categories[].isPrimary | Returns true if this is the primary category for the business. |
| isClaimed | Returns true if the business has claimed its Trustpilot profile. |
| status | The current operational status of the business profile on Trustpilot. This can return active or closed. |
| isSubscriber | Returns true if the business pays for Trustpilot. |
| address | The physical address of the business. |
| address.street | Street address. |
| address.city | City. |
| address.state | State. |
| address.country | The country where the business is primarily based or registered. |
| address.countryCode | The ISO 3166-1 alpha-2 code for the country. |
| address.postcode | Postal code. |
| score | Container for performance scores. |
| score.stars | The business’s overall star rating, which is the trustScore rounded to the nearest 0.5. |
| score.trustScore | The business’s overall TrustScore, calculated from all its reviews. It ranges from 1.0 to 5.0. |
| numberOfReviews | A breakdown of review counts. |
| numberOfReviews.total | The total number of reviews the business has received on Trustpilot. |
| numberOfReviews.usedForTrustScoreCalculation | The number of reviews used to calculate the TrustScore. |
| numberOfReviews.oneStar | The number of active one star reviews. |
| numberOfReviews.twoStars | The number of active two star reviews. |
| numberOfReviews.threeStars | The number of active three star reviews. |
| numberOfReviews.fourStars | The number of active four star reviews. |
| numberOfReviews.fiveStars | The number of active five star reviews. |
| description | The business’s self-reported description. |
| description.header | Description header. |
| description.text | Description text. |
| contactEmail | The public contact email or link to a contact form. |
| contactPhoneNumber | The public contact phone number. |
| socialMedia | Links to the business’s social media profiles. |
| socialMedia.facebook | Facebook profile URL. |
| socialMedia.linkedin | LinkedIn profile URL. |
| socialMedia.twitter | Twitter profile URL. |
| socialMedia.youtube | Youtube profile URL. |
| socialMedia.instagram | Instagram profile URL. |
| websiteUrl | The URL that links out from a business’s Trustpilot profile to their website. This is either set by the business or automatically when the domain gets its first customer review. |
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 unit endpoint. 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" Expand to view response table
The Get latest reviews for business unit response 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. |
| isVerfied | Returns true if the review is Verified. For more information, see Why are some reviews marked “Verified”? |
| language | The language the review is written in |
| createdAt | The time the review was submitted. |
| consumer.id | The unique ID for the reviewer. |
| consumer.displayName | The consumer’s Trustpilot display name |
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" Expand to view response table
The Get service reviews response 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. |
| isVerified | Returns true if the review is Verified. For more information, see Why are some reviews marked “Verified”? |
| 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. |
| language | The language the review is written in |
If your search returns a high volume of responses, the results will be limited to 10 responses per page. You’ll receive a nextToken to navigate through pages of results.