JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15134F
  • License MIT

A simple Node.js library to fetch Google Maps reviews

Package Exports

  • google-reviews-api
  • google-reviews-api/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (google-reviews-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Google Reviews Library

A simple Node.js library to fetch Google Maps reviews.

Installation

To install the library, run the following command:

npm install google-reviews-api

Usage

const { fetchGoogleMapsReviews } = require('google-reviews-api');

(async () => {

  const placeId = '0x47e66e2964e34e2d:0x8ddca9ee380ef7e0';
  const options = {
    hl: 'en',  // Language (e.g., 'en' for English)
    gl: 'tr',  // Region (e.g., 'tr' for Turkey)
    targetReviews: 50  // The total number of reviews you want to fetch
  };

  const result = await fetchGoogleMapsReviews(placeId, '', options);
  console.log(result.reviews);
})();

Options

Sample Place ID For example, to fetch reviews for the Eiffel Tower, the Place ID can be found in the Google Maps URL:

Google Maps - Eiffel Tower

The Place ID for the Eiffel Tower is: 0x47e66e2964e34e2d:0x8ddca9ee380ef7e0

placeId: The Google Maps Place ID for the location.

nextPageToken: For pagination. You can leave it as an empty string ('') to start from the first page.

hl: Language for the reviews (default: 'en').

gl: Region for the reviews (default: 'us').

targetReviews: The maximum number of reviews to fetch. This will stop fetching once the target number is reached (default: 50).