Trustpilot has reviews for 1M+ businesses. Here's how to extract them for competitive analysis.
Trustpilot's Public API
Trustpilot pages load review data via internal APIs:
async function getTrustpilotReviews(domain, page = 1) {
const url = `https://www.trustpilot.com/review/${domain}?page=${page}`;
const res = await fetch(url, {
headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' }
});
const html = await res.text();
// Trustpilot embeds review data as JSON-LD
const jsonLdMatch = html.match(/<script type="application\/ld\+json">(.*?)<\/script>/gs);
if (jsonLdMatch) {
for (const match of jsonLdMatch) {
const json = JSON.parse(match.replace(/<[^>]+>/g, ''));
if (json['@type'] === 'LocalBusiness' || json.review) {
return json;
}
}
}
}
What Data You Get
- Overall rating (1-5 stars)
- Total review count
- Individual reviews: text, rating, date, author
- Business response to reviews
- Category ranking
Use Cases
- Competitor monitoring — track competitor ratings over time
- Product development — what do customers complain about?
- Market research — which companies lead in customer satisfaction?
- Sales intelligence — identify dissatisfied competitor customers
- Brand reputation — monitor your own brand
Resources
Need review data from Trustpilot, G2, or Capterra? $20. Email: Spinov001@gmail.com | Hire me
Top comments (0)