Black Friday: 50% off paid plans, 25% more credits. Ends 30 November.See prices →

API documentation

Scrape Google Maps programmatically: start jobs, poll status, and download business leads as CSV, XLSX, or JSON over a simple REST API.

6 countries · nearly 4,000 business categories · up to 23 fields per lead.

Overview

The Maps Harvest API lets you start and manage Google Maps scrape jobs programmatically, with no browser required. You can launch scrapes, poll for progress, download results in CSV, XLSX, or JSON, and manage your API keys.

API access is included on every plan, including Free: each scrape uses your account's own credits, exactly as in the dashboard. So are webhooks, every download format (CSV, XLSX and JSON) and every field. All endpoints accept and return JSON. Dates are ISO 8601 (UTC).

Base URL: https://api.mapsharvest.com

Authentication

Every request must include an Authorization header with a Bearer token. Two token types are accepted:

API key mh_live_...

Generated from the dashboard → Integrations → API access. Recommended for server-side integrations.

bash
curl https://api.mapsharvest.com/jobs/abc123 \
  -H "Authorization: Bearer mh_live_your_key_here"
Supabase session JWT

Short-lived token from your Supabase session. Used by the dashboard itself. Fine for quick scripts.

bash
curl https://api.mapsharvest.com/jobs/abc123 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR..."

Rate limits

Every plan, Enterprise included, runs one scrape at a time. Starting another while one is queued or running returns 429 Too Many Requests; start it once the current job finishes or is stopped. There is no per-minute rate limit on read endpoints (/jobs, /fields, etc.).

LimitValue
Scrapes at a time1 per account, every plan
API keys per account10 active keys
Results per cityUp to about 120 (a Google Maps limit). API default 60; the dashboard asks for 120
Webhook payload sizeUnbounded (streamed)

POST /scrape

POST

Start a new scrape job. Returns a job_id immediately; the scrape runs asynchronously.

Request body
FieldTypeRequiredDescription
queryBusiness type to search (e.g. "dentists")string✓Business type to search (e.g. "dentists")
statesComma-separated state or region names (e.g. "Florida,Texas")string✓Comma-separated state or region names (e.g. "Florida,Texas")
countryus · uk · canada · australia · germany · egypt (default us).stringus · uk · canada · australia · germany · egypt (default us).
citiesComma-separated city names. Omit to scrape all cities in the states.stringComma-separated city names. Omit to scrape all cities in the states.
max_results_per_cityCap per city. Default 60 for API calls (the dashboard asks for 120). Google Maps shows up to about 120 per city.integerCap per city. Default 60 for API calls (the dashboard asks for 120). Google Maps shows up to about 120 per city.
presetOptional field preset: essentials · cold_caller · full (GET /fields lists each one's fields). Leave it out to get every column.stringOptional field preset: essentials · cold_caller · full (GET /fields lists each one's fields). Leave it out to get every column.
fieldsOptional comma-separated field keys (see GET /fields). On their own they set the columns; with a preset they are added to its fields.stringOptional comma-separated field keys (see GET /fields). On their own they set the columns; with a preset they are added to its fields.
category_filterStrict category to match (exact GMB category name).stringStrict category to match (exact GMB category name).
related_categoriesComma-separated additional categories to include.stringComma-separated additional categories to include.
min_ratingOnly keep businesses with rating ≥ this value.numberOnly keep businesses with rating ≥ this value.
min_reviewsOnly keep businesses with review count ≥ this value.integerOnly keep businesses with review count ≥ this value.
max_reviewsOnly keep businesses with review count ≤ this value.integerOnly keep businesses with review count ≤ this value.
require_websitetrue = only businesses with a website.booleantrue = only businesses with a website.
exclude_websitetrue = only businesses without a website.booleantrue = only businesses without a website.
require_phonetrue = only businesses with a phone number.booleantrue = only businesses with a phone number.
exclude_phonetrue = only businesses without a phone number.booleantrue = only businesses without a phone number.
webhook_urlURL to POST results to when the job finishes (every plan).stringURL to POST results to when the job finishes (every plan).
webhook_triggercompleted · any (completed or stopped) · manual (default manual). Nothing is sent for a job with no leads, or one that failed or was interrupted.stringcompleted · any (completed or stopped) · manual (default manual). Nothing is sent for a job with no leads, or one that failed or was interrupted.
webhook_fieldsArray of field names to include in the webhook payload.string[]Array of field names to include in the webhook payload.
campaign_idAssign this scrape to a campaign.string (uuid)Assign this scrape to a campaign.
nameHuman-readable label for this scrape run (max 200 chars).stringHuman-readable label for this scrape run (max 200 chars).
resume_job_idID of a stopped, failed or interrupted job to continue with the settings in this request. POST /jobs/{id}/resume continues one with its own settings.stringID of a stopped, failed or interrupted job to continue with the settings in this request. POST /jobs/{id}/resume continues one with its own settings.
Response
json
{
  "job_id": "a7f3c2d1e8b94f56...",
  "status": "queued"
}
Example
bash
curl -X POST https://api.mapsharvest.com/scrape \
  -H "Authorization: Bearer mh_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "query": "dentists",
    "states": "Florida,Texas",
    "preset": "essentials",
    "min_rating": 4,
    "webhook_url": "https://hooks.zapier.com/hooks/catch/...",
    "webhook_trigger": "completed"
  }'

GET /jobs/{id}

GET

Poll the live status of a scrape job.

Response
FieldTypeDescription
job_idUnique job identifierstringUnique job identifier
statusqueued · running · stopping · stopped · completed · failed · interrupted (see Statuses below)stringqueued · running · stopping · stopped · completed · failed · interrupted (see Statuses below)
rows_writtenLeads collected so farintegerLeads collected so far
cities_doneCities fully scrapedintegerCities fully scraped
cities_totalTotal cities to scrapeintegerTotal cities to scrape
cities_remainingCities leftintegerCities left
last_cityMost recently scraped citystring | nullMost recently scraped city
started_atUnix timestamp when the job startednumberUnix timestamp when the job started
eta_secondsEstimated seconds remainingnumber | nullEstimated seconds remaining
dropped_fieldsColumns you asked for that were left out of the file. Every plan includes every column, so this is normally empty.string[]Columns you asked for that were left out of the file. Every plan includes every column, so this is normally empty.
errorWhy the job ended early, when known: for example what went wrong (failed), "Credits exhausted" (stopped) or "Server restarted" (interrupted). Otherwise null.string | nullWhy the job ended early, when known: for example what went wrong (failed), "Credits exhausted" (stopped) or "Server restarted" (interrupted). Otherwise null.
Statuses
StatusMeaning
queued · running · stoppingStill working. Keep polling.
completedFinished.
stoppedEnded early, for example because you stopped it or the account ran out of credits.
failedEnded by an error.
interruptedThe server restarted while the job ran. Continue it with POST /jobs/{id}/resume.

Stop polling once the status is anything other than queued, running or stopping. A stopped, failed or interrupted job keeps the leads it found, and all three can be continued.

Example
bash
curl https://api.mapsharvest.com/jobs/a7f3c2d1e8b94f56 \
  -H "Authorization: Bearer mh_live_..."

GET /jobs/{id}/download

GET

Download a job's leads. A job that ended early (stopped, failed or interrupted) gives the leads it found before it ended. Format is controlled by the fmt query parameter. Every format is available on every plan.

Query parameters
ParamValuesDefault
fmtcsvcsv · xlsx · jsoncsv
Example
bash
# CSV (all plans)
curl "https://api.mapsharvest.com/jobs/a7f3c2d1e8b94f56/download?fmt=csv" \
  -H "Authorization: Bearer mh_live_..." \
  -o leads.csv

# JSON (all plans)
curl "https://api.mapsharvest.com/jobs/a7f3c2d1e8b94f56/download?fmt=json" \
  -H "Authorization: Bearer mh_live_..." \
  -o leads.json

POST /scrape/{id}/stop

POST

Signal a running job to stop gracefully. The job transitions to stopping and then stopped. Any leads already collected are preserved and downloadable.

Example
bash
curl -X POST https://api.mapsharvest.com/scrape/a7f3c2d1e8b94f56/stop \
  -H "Authorization: Bearer mh_live_..."

POST /jobs/{id}/resume

POST

Continue a job that ended as stopped, failed or interrupted, with the settings it was started with. The continuation is a new job: it skips the cities the earlier run finished, so they are not charged again, and its download includes the leads found before. Its rows_written counts every lead in that file, the earlier ones included. Poll the new job_id like any other job.

Response
json
{
  "job_id": "c91e04b7a2d35f68...",
  "status": "queued",
  "message": "Scrape started. Poll /jobs/c91e04b7a2d35f68... for status.",
  "resumed_from": "a7f3c2d1e8b94f56..."
}
Example
bash
curl -X POST https://api.mapsharvest.com/jobs/a7f3c2d1e8b94f56/resume \
  -H "Authorization: Bearer mh_live_..."

It starts a scrape, so the usual limits apply: 402 with no credits left, 429 while another scrape is running, 503 during maintenance. 400 means the job is still running or already completed, or one of its saved settings is no longer accepted (detail says which); 409 means its settings or saved progress are no longer available, so start a new scrape instead.

GET /fields

GET

Returns the full catalog of data fields, grouped by type (basic, contact, location, business details and meta), and the presets with the fields in each. Every plan, Free included, gets all 23 fields, and every lead costs 1 credit whatever fields you pick.

Example
bash
curl https://api.mapsharvest.com/fields \
  -H "Authorization: Bearer mh_live_..."

GET /cities

GET

Returns all cities available for the given states. Used to build the city picker in the dashboard.

Query parameters
ParamTypeDescription
statesComma-separated state names (e.g. states=Florida,Texas)stringComma-separated state names (e.g. states=Florida,Texas)
Example
bash
curl "https://api.mapsharvest.com/cities?states=Florida,Texas" \
  -H "Authorization: Bearer mh_live_..."

GET /api-keys

GET

List all API keys for the authenticated account. Key hashes are never returned.

Response
json
{
  "keys": [
    {
      "id": "uuid",
      "name": "My Zapier integration",
      "key_prefix": "mh_live_a1b2",
      "created_at": "2026-05-24T10:00:00Z",
      "last_used_at": "2026-05-24T14:32:00Z",
      "revoked_at": null
    }
  ]
}

POST /api-keys

POST

Create a new API key. The full raw key is returned once only in the raw_key field and is never stored in plaintext. Save it immediately.

Request body
FieldTypeRequiredDescription
nameLabel for this key (max 100 chars). e.g. "Zapier integration"string✓Label for this key (max 100 chars). e.g. "Zapier integration"
Response
json
{
  "id": "uuid",
  "name": "My Zapier integration",
  "key_prefix": "mh_live_a1b2",
  "created_at": "2026-05-24T10:00:00Z",
  "raw_key": "mh_live_a1b2c3d4e5f6..."
}

DELETE /api-keys/{id}

DELETE

Permanently delete an API key. Any integrations using it will stop authenticating immediately. Returns 204 No Content on success.

Example
bash
curl -X DELETE https://api.mapsharvest.com/api-keys/key-uuid-here \
  -H "Authorization: Bearer mh_live_..."

Fields reference

Every plan, including Free, gets all 23 fields. Not every business has every field filled in; that depends on its Google Maps listing.

All fieldsAll plans
FieldTypeDescription
querySearch query used to find this businessstringSearch query used to find this business
nameBusiness namestringBusiness name
categoryPrimary Google Business categorystringPrimary Google Business category
phonePhone numberstringPhone number
addressFull street addressstringFull street address
cityCitystringCity
stateStatestringState
latitudeLatitude, parsed from the Google Maps URLnumberLatitude, parsed from the Google Maps URL
longitudeLongitude, parsed from the Google Maps URLnumberLongitude, parsed from the Google Maps URL
ratingAverage star rating (1 to 5)numberAverage star rating (1 to 5)
review_countTotal number of reviewsintegerTotal number of reviews
google_maps_urlDirect Google Maps URLstringDirect Google Maps URL
scraped_atISO 8601 timestamp of when the row was scrapedstringISO 8601 timestamp of when the row was scraped
websiteBusiness website URLstringBusiness website URL
website_domainRoot domain (e.g. example.com)stringRoot domain (e.g. example.com)
plus_codeGoogle Plus Code locationstringGoogle Plus Code location
descriptionBusiness description from GooglestringBusiness description from Google
hoursOpening hours (JSON string)stringOpening hours (JSON string)
price_level$ $$ $$$ $$$$string$ $$ $$$ $$$$
temporarily_closedWhether the business is temporarily closedbooleanWhether the business is temporarily closed
review_breakdownStar-count histogram, e.g. "5★:120, 4★:45..."stringStar-count histogram, e.g. "5★:120, 4★:45..."
last_updated_by_ownerListing freshness, e.g. "Updated by this business 3 weeks ago"stringListing freshness, e.g. "Updated by this business 3 weeks ago"
service_optionse.g. "Dine-in; Takeaway; Delivery"stringe.g. "Dine-in; Takeaway; Delivery"

Error codes

StatusMeaning
400 Bad RequestMissing or invalid request parameters.
401 UnauthorizedMissing, invalid, or revoked auth token.
402 Payment RequiredNo credits left. Upgrade to a bigger plan or credit amount, then try again.
403 ForbiddenYou don't have access to this job or resource (for example, it belongs to another account).
404 Not FoundJob or resource does not exist (or belongs to another user).
409 ConflictContinuing a job (POST /jobs/{id}/resume or resume_job_id): its settings or saved progress are no longer available. Start a new scrape.
429 Too Many RequestsYou already have a job running (every plan runs one job at a time), or you already have 10 API keys.
500 Internal Server ErrorSomething went wrong on our end. Retry after a moment.
503 Service UnavailableScraping is paused for maintenance. Nothing was started or charged. Try again later; the Retry-After header says when to check.

All error responses include a JSON body with a detail field explaining the reason:

json
{ "detail": "No credits remaining." }

Code examples

Python: scrape and download
python
import requests, time

API_BASE = "https://api.mapsharvest.com"
API_KEY  = "mh_live_your_key_here"
HEADERS  = {"Authorization": f"Bearer {API_KEY}"}

# 1. Start the scrape
resp = requests.post(f"{API_BASE}/scrape", headers=HEADERS, json={
    "query":  "plumbers",
    "states": "California",
    "preset": "essentials",
    "min_rating": 4.0,
})
job_id = resp.json()["job_id"]
print(f"Job started: {job_id}")

# 2. Poll while the job is working. A 5xx means the API is restarting
#    (a few seconds), so that is retried for up to a minute.
retries = 0
while True:
    r = requests.get(f"{API_BASE}/jobs/{job_id}", headers=HEADERS)
    if r.status_code >= 500 and retries < 12:
        retries += 1
        time.sleep(5)
        continue
    r.raise_for_status()
    retries = 0
    status = r.json()
    print(f"  {status['status']}: {status['rows_written']} leads")
    if status["status"] not in ("queued", "running", "stopping"):
        break  # completed, stopped, failed or interrupted
    time.sleep(5)

# An interrupted job (the server restarted mid-run) keeps its leads, and
# POST /jobs/{job_id}/resume continues it as a new job.

# 3. Download CSV
csv = requests.get(f"{API_BASE}/jobs/{job_id}/download?fmt=csv", headers=HEADERS)
csv.raise_for_status()
with open("leads.csv", "wb") as f:
    f.write(csv.content)
print("Saved leads.csv")
Node.js: scrape and download
javascript
const API_BASE = "https://api.mapsharvest.com";
const API_KEY  = "mh_live_your_key_here";
const headers  = { Authorization: `Bearer ${API_KEY}` };

async function run() {
  // 1. Start scrape
  const start = await fetch(`${API_BASE}/scrape`, {
    method: "POST",
    headers: { ...headers, "Content-Type": "application/json" },
    body: JSON.stringify({ query: "plumbers", states: "California", preset: "essentials" }),
  });
  const { job_id } = await start.json();
  console.log("Job started:", job_id);

  // 2. Poll while the job is working. A 5xx means the API is restarting
  //    (a few seconds), so that is retried for up to a minute.
  let done = false, retries = 0;
  while (!done) {
    await new Promise(r => setTimeout(r, 5000));
    const res = await fetch(`${API_BASE}/jobs/${job_id}`, { headers });
    if (res.status >= 500 && retries++ < 12) continue;
    if (!res.ok) throw new Error(`GET /jobs/${job_id} answered ${res.status}`);
    retries = 0;
    const s = await res.json();
    console.log(`  ${s.status}: ${s.rows_written} leads`);
    // completed, stopped, failed or interrupted
    if (!["queued", "running", "stopping"].includes(s.status)) done = true;
  }
  // An interrupted job (the server restarted mid-run) keeps its leads, and
  // POST /jobs/{id}/resume continues it as a new job.

  // 3. Download CSV
  const csv = await fetch(`${API_BASE}/jobs/${job_id}/download?fmt=csv`, { headers });
  if (!csv.ok) throw new Error(`Download answered ${csv.status}`);
  require("fs").writeFileSync("leads.csv", Buffer.from(await csv.arrayBuffer()));
  console.log("Saved leads.csv");
}

run();
cURL: scrape and download
bash
# Start scrape, poll every 5s, download when it ends
JOB=$(curl -s -X POST https://api.mapsharvest.com/scrape \
  -H "Authorization: Bearer mh_live_..." \
  -H "Content-Type: application/json" \
  -d '{"query":"dentists","states":"Florida","preset":"essentials"}' | jq -r .job_id)

echo "Job: $JOB"

TRIES=0
while true; do
  STATUS=$(curl -s https://api.mapsharvest.com/jobs/$JOB -H 'Authorization: Bearer mh_live_...' | jq -r .status 2>/dev/null)
  case "$STATUS" in
    queued|running|stopping) TRIES=0; sleep 5 ;;  # still working
    "") TRIES=$((TRIES + 1))                       # no answer: the API may be restarting,
        [ "$TRIES" -lt 12 ] || { echo "The API isn't answering"; exit 1; }
        sleep 5 ;;                                 # so try again for up to a minute
    *) break ;;                                    # completed, stopped, failed or interrupted
  esac
done

curl -fsS "https://api.mapsharvest.com/jobs/$JOB/download?fmt=csv" \
  -H "Authorization: Bearer mh_live_..." -o leads.csv &&
  echo "Done ($STATUS): leads.csv ready"

Local Worker (CLI)

Enterprise
This feature is available on the Enterprise plan only, which is by application at mapsharvest.com/enterprise. The CLI is free to install, but running scrapes requires an active Enterprise subscription and a valid API key.

The Maps Harvest CLI runs your searches on your own computer instead of ours. This gives you:

  • Results appear in your dashboard automatically after upload
  • Credits deducted only on successful completion
Installation

Requires Python 3.9+ and pip. One-time Playwright browser install needed.

bash
# 1. Install the CLI
pip install mapsharvest

# 2. Install Playwright's Chromium browser (one-time)
playwright install chromium

# 3. Save your Enterprise API key
mapsharvest config --api-key mh_live_your_key_here
Quick start
bash
# Scrape "roofers" across all cities in Florida, max 60 results per city
mapsharvest scrape "roofers" --states Florida

# Scrape specific cities with filters
mapsharvest scrape "dentists" \
  --states "Texas,Florida" \
  --cities "Miami,Houston,Dallas" \
  --max-results 100 \
  --min-rating 4.0 \
  --require-website \
  --output leads.csv

# Show the browser (useful for debugging)
mapsharvest scrape "plumbers" --states California --no-headless
All flags
FlagDefaultDescription
--states / -sComma-separated US state names or abbreviations(required)Comma-separated US state names or abbreviations
--cities / -cComma-separated city names to restrict the scrapeall citiesComma-separated city names to restrict the scrape
--max-results / -nMax leads per city (up to 120)60Max leads per city (up to 120)
--output / -oWhere to save the CSV./results/<job_id>.csvWhere to save the CSV
--nameHuman-readable label shown in the dashboardHuman-readable label shown in the dashboard
--campaign-idLink this job to an existing campaign UUIDLink this job to an existing campaign UUID
--presetField preset: core · cold_caller · email_outreach · fullcoreField preset: core · cold_caller · email_outreach · full
--min-ratingSkip businesses rated below this (e.g. 4.0)Skip businesses rated below this (e.g. 4.0)
--min-reviewsSkip businesses with fewer reviews than thisSkip businesses with fewer reviews than this
--max-reviewsSkip businesses with more reviews than thisSkip businesses with more reviews than this
--require-websiteSkip businesses with no websiteoffSkip businesses with no website
--require-phoneSkip businesses with no phoneoffSkip businesses with no phone
--headless / --no-headlessShow or hide the Chrome window--headlessShow or hide the Chrome window
Other commands
bash
# View your API key and config
mapsharvest config

# List your 20 most recent jobs
mapsharvest jobs list

# Download a past job as CSV / XLSX / JSON
mapsharvest jobs download <job_id>
mapsharvest jobs download <job_id> --fmt xlsx --output leads.xlsx
How it works
  1. Register: the CLI calls POST /jobs/local-start with your query and states. The backend validates your Enterprise plan and returns a job_id plus the list of cities to scrape.
  2. Scrape: Playwright launches on your machine, navigates Google Maps, and writes results to a local CSV. Progress is sent to PATCH /jobs/{id}/progress after each city so your dashboard updates live.
  3. Upload: when scraping finishes the CLI uploads the CSV to POST /jobs/{id}/local-complete. The backend stores it in Supabase Storage and deducts credits (1 per row).
  4. View results: the job appears in your Maps Harvest dashboard exactly like any server-side scrape. Download in CSV, XLSX, or JSON at any time.
Troubleshooting
ProblemFix
No API key configuredRun: mapsharvest config --api-key mh_live_...
403 Local worker is an Enterprise featureApply for Enterprise at mapsharvest.com/enterprise
playwright: command not foundRun: pip install playwright && playwright install chromium
0 results for a cityGoogle Maps may have stopped returning results for a while. Wait a few minutes, or try --no-headless to watch what happens.
Upload fails but CSV is savedYour local file is at ./results/<job_id>.csv. You can re-upload or import it manually.