gm-review-scraper
v1.0.9
Published
A tool to scrape Google Maps reviews
Maintainers
Readme
Google Maps Review Scraper
A Node.js library for scraping reviews from Google Maps.
Installation
npm install gm-review-scraperUsage
import { GMRScraper } from "gm-review-scraper";
// Google Maps place URL or short URL
const url = "https://www.google.com/maps/place/...";
// const url = "https://maps.app.goo.gl/.....";
// Options
const options = {
sort_type: "newest", // 'relevent', 'newest', 'highest_rating', 'lowest_rating'
search_query: "", // Optional search term to filter reviews
pages: "max", // Number of pages to scrape or 'max'
clean: true, // Return cleaned data
key: "your_google_api_key", // Optional for additional statistics
};
// Initialize scraper with options
const scraper = new GMRScraper(options);
async function getReviews() {
try {
// Pass URL to scrape method
const result = await scraper.scrape(url);
console.log(`Found ${result.reviews.length} reviews`);
console.log(result.statistical);
console.log(result);
} catch (error) {
console.error("Error scraping reviews:", error);
}
}
getReviews();Options
sort_type: How to sort reviews ('relevent', 'newest', 'highest_rating', 'lowest_rating')search_query: Filter reviews by search termpages: Number of pages to scrape or 'max' for all availableclean: Whether to return cleaned datakey: Optional Google API key for additional statistics
License
ISC
