trustpilot-fetcher
v1.0.3
Published
A simple library to scrape Trustpilot data like reviews, ratings, and profile images.
Maintainers
Readme
Trustpilot Fetcher
trustpilot-fetcher is a lightweight Node.js library for scraping Trustpilot data, including reviews, ratings, overall scores, and profile images.
Features
- Fetch total review count.
- Extract ratings such as "Excellent" or "Average".
- Extract overall Trustpilot score.
- Retrieve profile image URL.
Installation
Install the package using npm:
# NPM
npm install trustpilot-fetcher
# Yarn
yarn add trustpilot-fetcherUsage
Here’s how to use the library:
const { scrapeTrustPilot } = require('trustpilot-fetcher');
const url = 'https://www.trustpilot.com/review/example.com';
scrapeTrustPilot(url)
.then(data => console.log(data))
.catch(error => console.error(error));Example Output
{
"totalReviews": 8330,
"reviewsRate": "Excellent",
"score": 4.5,
"imageUrl": "https://example.com/profile-image.jpg"
}License
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to reach out with any feedback or feature requests. Happy coding!
