Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Maps Scraper

Search Google Maps for local businesses and get structured place listings, ratings, coordinates, and contact fields. The Python, Node.js, curl, n8n, and MCP examples call deepmine/google-maps-scraper on Apify.

GitHub topics: google-maps-scraper google-maps-api google-places-api mcp-server n8n-workflow lead-generation apify-actor web-scraping

How it works

The example searches coffee shops in Selinsgrove, Pennsylvania, with website contact extraction, reviews, and images turned off. The Actor runs on Apify and stores each result in a dataset under your account.

The three command line examples run the Actor and print its default dataset as a JSON array. Apify stores the results under your account, so you can inspect the dataset later or pass the JSON to another program.

Quick start

Set APIFY_TOKEN in your shell using a token from Apify integrations. Run one command from the repository root. Each command starts a separate run.

Client Requirement Command
Python Python 3.10+ python3 examples/python/run.py
Node.js Node.js 20+ node examples/node/run.mjs
curl Bash and curl 7.55+ bash examples/curl/run.sh

Append --dry-run to print the input without a token or API call, or pass the path to your JSON input. For long jobs, use the asynchronous runs API and fetch the completed run's dataset. The synchronous endpoint waits up to 300 seconds.

Actor input

The commands and n8n workflow use this example input:

{
  "searchStringsArray": [
    "coffee shops"
  ],
  "locationQuery": "Selinsgrove, PA",
  "countryCode": "us",
  "maxCrawledPlacesPerSearch": 10,
  "scrapeContacts": false,
  "language": "en",
  "maxReviews": 0,
  "reviewsSort": "mostRelevant",
  "scrapeReviewsPersonalData": false,
  "maxImages": 0
}

Find more options in the hosted input form. Set a small result limit while testing. Runs are billed under your Apify account.

MCP for Claude Desktop and Cursor

These snippets launch the official Apify MCP server with npx and select this Actor as a tool. The MCP server requires Node.js 22 or later. Merge the mcpServers entry into the configuration for Claude Desktop or Cursor. Replace YOUR_APIFY_TOKEN in your local copy and restart the client.

Example prompt:

Find up to 10 coffee shops in Selinsgrove, Pennsylvania. Return names, ratings, and Maps URLs.

n8n workflow

Import workflow.json in n8n. In the Run Actor HTTP Request node, create or select a Header Auth credential with name Authorization and value Bearer YOUR_APIFY_TOKEN, using your actual token. Run Manual Trigger to fetch the default dataset. Edit the JSON body to change the search.

Output fields

This sample is a real dataset item from the November 27, 2026 benchmark, with only the fields below shown. Values vary by result.

{
  "title": "The Kind Cafe",
  "categoryName": "Coffee shop",
  "city": "Selinsgrove",
  "countryCode": "US",
  "totalScore": 4.8,
  "reviewsCount": 495,
  "placeId": "ChIJ68cGbQU_z4kRA0Emg_ex6ZE",
  "location": {
    "lat": 40.7999141,
    "lng": -76.861977
  },
  "url": "https://www.google.com/maps/search/?api=1&query=The%20Kind%20Cafe&query_place_id=ChIJ68cGbQU_z4kRA0Emg_ex6ZE"
}
Field Meaning
title Name shown on Google Maps.
categoryName Primary business category.
city City of the listing.
countryCode Country code reported by Google Maps.
totalScore Average listing rating.
reviewsCount Number of reviews.
placeId Google Place ID.
location Latitude and longitude.
url Link to the Maps listing.

See the Actor page for more fields. Apify datasets can also be exported as CSV or XLSX.

Pricing

USD per 1,000 results or events, checked against Apify pricing on November 30, 2026 (UTC). The table uses the API's tier names. Your Apify account tier determines the rate.

Event FREE BRONZE SILVER GOLD
Base (places) $0.49 $0.45 $0.39 $0.29

Website contacts, reviews, and photos are included in the place event when requested. See the Store page for current rates.

Benchmark

Historical Apify cloud measurements, November 27, 2026. Coffee shops in Selinsgrove and hair salons in Austin. Only the second case requested website contacts. The suite targeted 10 rows per case. Times are means for reported runs; field fill is the share of selected fields that had values. N/A means there was no measurement.

Actor Mean time Field fill Complete cases
deepmine/google-maps-scraper 5.59 s 93.6% 2/2
scraperlink/google-maps-scraper 6.74 s 88.6% 2/2
compass/crawler-google-places N/A N/A 0/2 (both skipped before launch)
kaix/google-maps-places-scraper 13.74 s 96.1% 2/2

Inspect the historical inputs with python3 bench/reproduce.py --dry-run. Run python3 bench/reproduce.py to replay both inputs on the current build and measure wall time and row count. Replay starts two billable runs. Times and results can change as sources update.

FAQ

Do I need a Google Maps API key?

No. Authenticate to Apify and send searchStringsArray with a locationQuery.

Does it return phone numbers and websites?

When Google Maps lists them, the fields are available even with scrapeContacts off. Turn it on to look for contact details on business websites too.

Can I also collect opening hours and reviews?

Look for openingHours when published. Set maxReviews above zero to request review text. The listing's overall rating and review count are separate.

How much do 10,000 places cost?

The place events cost $4.50 on BRONZE or $2.90 on GOLD.

Can I export the results to a spreadsheet?

Export CSV or XLSX from the Apify dataset, or connect the n8n workflow to your spreadsheet node.

Local checks

Install pytest and jsonschema, then run python3 -m pytest -q with Node.js and Bash on your path. The tests use captured schema constraints and do not run the Actor. Set COMPANION_CHECK_LIVE=1 to also compare the examples and pricing snapshot with public Apify metadata.

The companion code is available under the MIT License.

Releases

Packages

Contributors

Languages