npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

google-maps-scraper-sdk

v1.0.1

Published

Official TypeScript SDK for the G Maps Extractor Google Maps Scraper API.

Readme

Google Maps Scraper SDK

npm version CI license

The official TypeScript SDK for the G Maps Extractor Google Maps Scraper API.

Search Google Maps businesses, retrieve public place photos, and collect public reviews from Node.js with typed requests and responses.

Features

  • Google Maps business and place search
  • Public place photos and videos
  • Public reviews with documented sorting
  • TypeScript types for the API's original response fields
  • ESM and CommonJS support
  • Structured errors and request timeouts
  • No runtime dependencies

Install

npm install google-maps-scraper-sdk

Node.js 18 or newer is required.

Get an API key

Create an API key in the G Maps Extractor API dashboard. Free monthly requests are available, with higher-volume plans on the API pricing page.

Keep the key in an environment variable:

export GMAPS_EXTRACTOR_API_KEY="your-api-key"

This SDK is intended for server-side Node.js. Do not expose API keys in browser code.

Quick start

import { GoogleMapsScraperClient } from 'google-maps-scraper-sdk'

const client = new GoogleMapsScraperClient({
  apiKey: process.env.GMAPS_EXTRACTOR_API_KEY!,
})

const result = await client.search({
  q: 'coffee shops in Portland',
  ll: '@45.523064,-122.676483,11z',
  hl: 'en',
  gl: 'us',
  extra: true,
})

for (const place of result.data) {
  console.log(place.Name, place['Average Rating'], place.Website)
}

CommonJS is also supported:

const { GoogleMapsScraperClient } = require('google-maps-scraper-sdk')

Search businesses

const result = await client.search({
  q: 'design agency in New York',
  page: 1,
  ll: '@40.6970194,-74.3093048,11z',
  hl: 'en',
  gl: 'us',
  extra: true,
})

q and ll are required. ll uses the Google Maps coordinate format @latitude,longitude,zoom, such as @40.6970194,-74.3093048,11z. page defaults to 1 and accepts values from 1 to 10. Each page can contain up to 20 results. Set extra to true to request emails and social media links.

The SDK preserves API field names exactly:

const place = result.data[0]

console.log(place?.Name)
console.log(place?.['Review Count'])
console.log(place?.['Google Maps URL'])
console.log(place?.emails)

Retrieve photos

Use the Fid returned by a search:

const photos = await client.photos({
  fid: '0x89b7b0fbf994f971:0xccd1567c352422cf',
  page: 1,
})

for (const media of photos.photos) {
  console.log(media.photoUrl ?? media.videoUrl)
}

See the Google Maps Photos Scraper API for product details.

Retrieve reviews

import { ReviewSort } from 'google-maps-scraper-sdk'

const reviews = await client.reviews({
  fid: '0x89b7b0fbf994f971:0xccd1567c352422cf',
  page: 1,
  sort_by: ReviewSort.NEWEST,
})

for (const review of reviews.reviews) {
  console.log(review.rate, review.comment)
}

Available sort values are RELEVANT, NEWEST, HIGHEST_RATING, and LOWEST_RATING. See the Google Maps Reviews Scraper API for more use cases.

Errors and timeouts

import {
  GoogleMapsScraperClient,
  GoogleMapsScraperError,
} from 'google-maps-scraper-sdk'

const client = new GoogleMapsScraperClient({
  apiKey: process.env.GMAPS_EXTRACTOR_API_KEY!,
  timeoutMs: 60_000,
})

try {
  await client.search({
    q: 'restaurants in Austin',
    ll: '@30.3074624,-98.0335911,10z',
  })
} catch (error) {
  if (error instanceof GoogleMapsScraperError) {
    console.error(error.status, error.message, error.response)
  }
}

The SDK does not retry automatically because every API request may consume account usage.

Client options

| Option | Type | Default | Description | | --- | --- | --- | --- | | apiKey | string | Required | G Maps Extractor API key | | baseUrl | string | https://cloud.gmapsextractor.com/api | API base URL | | timeoutMs | number | 60000 | Request timeout in milliseconds | | fetch | typeof fetch | Node global fetch | Custom fetch implementation, useful for testing |

API reference

Development

npm install
npm run check

npm run check runs type checking, unit tests, dual-module build validation, and an npm package dry run.

Publishing

To publish a release manually:

npm login
npm publish --access public

Then configure npm Trusted Publishing for:

  • GitHub owner: GMapsExtractor
  • Repository: Google-Maps-Scraper-SDK
  • Workflow: publish.yml

Future releases:

npm version patch
git push origin main --follow-tags

The v* tag triggers the GitHub Actions publishing workflow using OIDC. No long-lived npm token is required.

License

MIT