What type of API does Trustpilot provide?
Trustpilot provides a REST API.
The API uses authentication via an API key, which can be passed as a query parameter or HTTP header.
It utilizes "business units" as the collection point for company-related content.
The API implements rate limiting and offers guidelines to prevent hitting rate limits.
Does the Trustpilot API have webhooks?
Yes, the official Trustpilot API does have webhooks. Here are the key points about Trustpilot's webhook functionality:
Webhook Availability
Trustpilot offers webhooks as part of their API, allowing users to receive real-time notifications about various events.
Event Types
Trustpilot's webhooks allow you to subscribe to several types of events, including:
- New reviews
- Deleted reviews
- Revised reviews
Additionally, there are plans to support more events in the future, such as:
- Service review replies
- Product review creation
How Webhooks Work
- Webhooks send HTTP POST requests to a specified URL on your server when an event occurs.
- The payload of the request contains relevant data about the triggering event, typically in JSON format.
- This allows you to receive updates in real-time without having to poll Trustpilot's APIs periodically.
Use Cases
Trustpilot's webhooks can be used for various purposes, such as:
- Creating custom internal notifications
- Automatically matching consumers with their reviews
- Triggering support tickets
- Integrating with other systems (e.g., Slack)
Implementation Considerations
When implementing webhooks with Trustpilot:
- Your server should respond with a success code (HTTP Status code 2xx) when receiving a webhook.
- In case of errors or timeouts, Trustpilot will retry sending the event up to 5 times over 8 minutes.
- You can manage multiple subscriptions per event type.
Best Practices
- Use webhooks instead of constantly pulling data to avoid rate limiting issues.
- Store webhook data in your own backend and update it regularly, rather than calling Trustpilot APIs each time your website front-end loads.
It's worth noting that while this feature started as a prototype, it has since become a fully supported feature for users with the appropriate API plan.
Rate Limits and other limitations
The Trustpilot API has certain rate limits and guidelines for usage, though specific thresholds are not publicly published. Here are the key points regarding API rate limits for Trustpilot:
Rate Limiting Policy
- Trustpilot does not publish a specific rate limiting policy with exact thresholds.
- They do have limits in place for API usage, but do not disclose the exact numbers.
General Guidelines
- For normal use cases, the rate limits should not be an issue.
- If APIs are called at more than a "reasonable rate", certain limits will apply.
- Users are rate limited if performing more than one request per second.
Tips to Avoid Rate Limiting
Trustpilot provides some recommendations to avoid hitting rate limits:
- Use webhooks instead of constantly pulling data
- Reuse valid OAuth 2.0 access tokens rather than generating new ones for each request
- Don't call APIs on every page load - cache data on your backend and update periodically
Considerations
- The API returns 20 reviews per request.
- Reviews are returned in descending date order (newest to oldest).
- There are different levels of API access, with some endpoints requiring special permissions or paid subscriptions.
Best Practices
- Implement proper error handling for rate limit errors
- Use pagination and limit parameters to control data volume
- Cache data where possible to reduce API calls
- Monitor your usage and stay well below limits
While exact numbers are not provided, following these guidelines and best practices should help avoid issues with Trustpilot's API rate limits for most normal use cases. For high-volume needs, contacting Trustpilot directly may be advisable.
Latest API Version
Based on the search results provided, the most recent version of the Trustpilot API appears to be v1. Here are the key points:
API Version
- The Trustpilot API is currently at version 1 (v1).
Key Points
- The API uses the business unit concept as the collection point for all Trustpilot content for a website.
- Authentication is required and can be provided either as a query parameter or an HTTP header.
- The API supports various endpoints, including resources for images, locales, countries, and more.
API Usage
- The API can be accessed using various methods, including GET, POST, PUT, and DELETE requests.
- There are endpoints for retrieving star images, logos, icons, and other resources.
Python Client
- There is a Python client library available for the Trustpilot API, with the latest version being 10.0.1 as of October 19, 2023.
- The Python client can be installed using pip:
pip install trustpilot
.
Best Practices
- To avoid rate limiting, it's recommended to use webhooks instead of constantly pulling data.
- Reuse valid OAuth 2.0 access tokens rather than generating a new one for each transaction.
- When displaying reviews or ratings on a website, it's better to store the data in your own backend and update it regularly using webhooks.
It's important to note that while the search results provide information about the API, they don't explicitly state a more recent version than v1. Therefore, based on the available information, v1 appears to be the most recent version of the Trustpilot API.
How to get a Trustpilot developer account and API Keys?
To get a developer account for Trustpilot and create an API integration, you'll need to follow these steps:
1. Sign up for a Trustpilot Business Account
First, you need to have a Trustpilot Business Account. If you don't already have one, you'll need to sign up for one on the Trustpilot website.
2. Access the Developer Portal
Once you have a Trustpilot Business Account, you can access the Developer Portal. This is where you'll find all the necessary resources for API integration.
3. Create an API Key
In the Developer Portal, you'll need to create an API key. This key is essential for authenticating your requests to the Trustpilot API.
4. Understand the Business Unit Concept
Trustpilot uses the business unit concept as the collection point for all Trustpilot content for a website. It hosts a company's rating, reviews, and company responses. You'll need to figure out your Business Unit ID to use in your API requests.
5. Learn About Authentication
Trustpilot API requires authentication for most endpoints. You can provide your API key either as a query parameter or as an HTTP header. For example:
- As a query parameter:
?apikey={key}
- As an HTTP header:
apikey:{key}
6. Familiarize Yourself with Rate Limiting
Trustpilot has rate limiting guidelines to prevent overuse of their API. To avoid rate limiting:
- Use webhooks instead of constantly pulling data
- Reuse valid OAuth 2.0 access tokens instead of generating new ones for each transaction
- Store data in your own backend and update it regularly, rather than calling the API each time your website loads
7. Explore the API Documentation
Trustpilot provides comprehensive API documentation. Make sure to read through it to understand the available endpoints, data formats, and best practices.
What can you do with the Trustpilot API?
Based on the search results provided, here is a list of data models that can be interacted with using the Trustpilot API, along with what is possible for each:
Business Units
- The business unit is the central concept in the Trustpilot API
- It hosts a company's rating, reviews, and company responses
- You can retrieve information about a specific business unit using its ID
Reviews
- Access detailed reviews and ratings for businesses
- Extract customer feedback and sentiment
- Retrieve new reviews, deleted reviews, or revised reviews
- Analyze review content for insights into customer sentiment
Ratings
- Access overall ratings for businesses
- Retrieve rating data to display on websites or applications
Customer Data
- Extract customer sentiment and feedback
- Analyze customer behavior patterns and motivations
API Keys
- Generate API keys on behalf of customers (for partner integrations)
OAuth Tokens
- Generate and manage OAuth 2.0 access tokens for authentication
Webhooks
- Set up webhooks to receive notifications about events like new reviews
Sentiment Analysis
- Perform sentiment analysis on review content
- Extract topics, aspects, and themes from reviews
- Calculate sentiment scores for different aspects of a business
Entities
- Recognize and extract named entities from review content
Multilingual Data
- Process reviews in multiple languages
Trends and Patterns
- Analyze trends and patterns in review data over time
- Compare data across different time periods
Competitor Data
- Monitor competitor reviews and ratings
It's important to note that the exact capabilities and data models available may depend on the specific Trustpilot API plan and access level. Additionally, some of these features may require using third-party tools or services in conjunction with the Trustpilot API.