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).
https://api.mapsharvest.comAuthentication
Every request must include an Authorization header with a Bearer token. Two token types are accepted:
Generated from the dashboard → Integrations → API access. Recommended for server-side integrations.
curl https://api.mapsharvest.com/jobs/abc123 \
-H "Authorization: Bearer mh_live_your_key_here"Short-lived token from your Supabase session. Used by the dashboard itself. Fine for quick scripts.
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.).
| Limit | Value |
|---|---|
Scrapes at a time | 1 per account, every plan |
API keys per account | 10 active keys |
Results per city | Up to about 120 (a Google Maps limit). API default 60; the dashboard asks for 120 |
Webhook payload size | Unbounded (streamed) |
POST /scrape
POSTStart a new scrape job. Returns a job_id immediately; the scrape runs asynchronously.
| Field | Type | Required | Description |
|---|---|---|---|
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). | string | us · uk · canada · australia · germany · egypt (default us). | |
citiesComma-separated city names. Omit to scrape all cities in the states. | string | Comma-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. | integer | Cap 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. | string | Optional 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. | string | Optional 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). | string | Strict category to match (exact GMB category name). | |
related_categoriesComma-separated additional categories to include. | string | Comma-separated additional categories to include. | |
min_ratingOnly keep businesses with rating ≥ this value. | number | Only keep businesses with rating ≥ this value. | |
min_reviewsOnly keep businesses with review count ≥ this value. | integer | Only keep businesses with review count ≥ this value. | |
max_reviewsOnly keep businesses with review count ≤ this value. | integer | Only keep businesses with review count ≤ this value. | |
require_websitetrue = only businesses with a website. | boolean | true = only businesses with a website. | |
exclude_websitetrue = only businesses without a website. | boolean | true = only businesses without a website. | |
require_phonetrue = only businesses with a phone number. | boolean | true = only businesses with a phone number. | |
exclude_phonetrue = only businesses without a phone number. | boolean | true = only businesses without a phone number. | |
webhook_urlURL to POST results to when the job finishes (every plan). | string | URL 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. | string | completed · 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). | string | Human-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. | string | ID 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. |
{
"job_id": "a7f3c2d1e8b94f56...",
"status": "queued"
}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}
GETPoll the live status of a scrape job.
| Field | Type | Description |
|---|---|---|
job_idUnique job identifier | string | Unique job identifier |
statusqueued · running · stopping · stopped · completed · failed · interrupted (see Statuses below) | string | queued · running · stopping · stopped · completed · failed · interrupted (see Statuses below) |
rows_writtenLeads collected so far | integer | Leads collected so far |
cities_doneCities fully scraped | integer | Cities fully scraped |
cities_totalTotal cities to scrape | integer | Total cities to scrape |
cities_remainingCities left | integer | Cities left |
last_cityMost recently scraped city | string | null | Most recently scraped city |
started_atUnix timestamp when the job started | number | Unix timestamp when the job started |
eta_secondsEstimated seconds remaining | number | null | Estimated 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 | null | Why the job ended early, when known: for example what went wrong (failed), "Credits exhausted" (stopped) or "Server restarted" (interrupted). Otherwise null. |
| Status | Meaning |
|---|---|
queued · running · stopping | Still working. Keep polling. |
completed | Finished. |
stopped | Ended early, for example because you stopped it or the account ran out of credits. |
failed | Ended by an error. |
interrupted | The 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.
curl https://api.mapsharvest.com/jobs/a7f3c2d1e8b94f56 \
-H "Authorization: Bearer mh_live_..."GET /jobs/{id}/download
GETDownload 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.
| Param | Values | Default |
|---|---|---|
fmtcsv | csv · xlsx · json | csv |
# 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.jsonPOST /scrape/{id}/stop
POSTSignal a running job to stop gracefully. The job transitions to stopping and then stopped. Any leads already collected are preserved and downloadable.
curl -X POST https://api.mapsharvest.com/scrape/a7f3c2d1e8b94f56/stop \
-H "Authorization: Bearer mh_live_..."POST /jobs/{id}/resume
POSTContinue 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.
{
"job_id": "c91e04b7a2d35f68...",
"status": "queued",
"message": "Scrape started. Poll /jobs/c91e04b7a2d35f68... for status.",
"resumed_from": "a7f3c2d1e8b94f56..."
}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
GETReturns 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.
curl https://api.mapsharvest.com/fields \
-H "Authorization: Bearer mh_live_..."GET /cities
GETReturns all cities available for the given states. Used to build the city picker in the dashboard.
| Param | Type | Description |
|---|---|---|
statesComma-separated state names (e.g. states=Florida,Texas) | string | Comma-separated state names (e.g. states=Florida,Texas) |
curl "https://api.mapsharvest.com/cities?states=Florida,Texas" \
-H "Authorization: Bearer mh_live_..."GET /api-keys
GETList all API keys for the authenticated account. Key hashes are never returned.
{
"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
POSTCreate 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.
| Field | Type | Required | Description |
|---|---|---|---|
nameLabel for this key (max 100 chars). e.g. "Zapier integration" | string | ✓ | Label for this key (max 100 chars). e.g. "Zapier integration" |
{
"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}
DELETEPermanently delete an API key. Any integrations using it will stop authenticating immediately. Returns 204 No Content on success.
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.
| Field | Type | Description |
|---|---|---|
querySearch query used to find this business | string | Search query used to find this business |
nameBusiness name | string | Business name |
categoryPrimary Google Business category | string | Primary Google Business category |
phonePhone number | string | Phone number |
addressFull street address | string | Full street address |
cityCity | string | City |
stateState | string | State |
latitudeLatitude, parsed from the Google Maps URL | number | Latitude, parsed from the Google Maps URL |
longitudeLongitude, parsed from the Google Maps URL | number | Longitude, parsed from the Google Maps URL |
ratingAverage star rating (1 to 5) | number | Average star rating (1 to 5) |
review_countTotal number of reviews | integer | Total number of reviews |
google_maps_urlDirect Google Maps URL | string | Direct Google Maps URL |
scraped_atISO 8601 timestamp of when the row was scraped | string | ISO 8601 timestamp of when the row was scraped |
websiteBusiness website URL | string | Business website URL |
website_domainRoot domain (e.g. example.com) | string | Root domain (e.g. example.com) |
plus_codeGoogle Plus Code location | string | Google Plus Code location |
descriptionBusiness description from Google | string | Business description from Google |
hoursOpening hours (JSON string) | string | Opening hours (JSON string) |
price_level$ $$ $$$ $$$$ | string | $ $$ $$$ $$$$ |
temporarily_closedWhether the business is temporarily closed | boolean | Whether the business is temporarily closed |
review_breakdownStar-count histogram, e.g. "5★:120, 4★:45..." | string | Star-count histogram, e.g. "5★:120, 4★:45..." |
last_updated_by_ownerListing freshness, e.g. "Updated by this business 3 weeks ago" | string | Listing freshness, e.g. "Updated by this business 3 weeks ago" |
service_optionse.g. "Dine-in; Takeaway; Delivery" | string | e.g. "Dine-in; Takeaway; Delivery" |
Error codes
| Status | Meaning |
|---|---|
400 Bad Request | Missing or invalid request parameters. |
401 Unauthorized | Missing, invalid, or revoked auth token. |
402 Payment Required | No credits left. Upgrade to a bigger plan or credit amount, then try again. |
403 Forbidden | You don't have access to this job or resource (for example, it belongs to another account). |
404 Not Found | Job or resource does not exist (or belongs to another user). |
409 Conflict | Continuing 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 Requests | You already have a job running (every plan runs one job at a time), or you already have 10 API keys. |
500 Internal Server Error | Something went wrong on our end. Retry after a moment. |
503 Service Unavailable | Scraping 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:
{ "detail": "No credits remaining." }Code examples
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")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();# 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)
EnterpriseThe 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
Requires Python 3.9+ and pip. One-time Playwright browser install needed.
# 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# 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| Flag | Default | Description |
|---|---|---|
--states / -sComma-separated US state names or abbreviations | (required) | Comma-separated US state names or abbreviations |
--cities / -cComma-separated city names to restrict the scrape | all cities | Comma-separated city names to restrict the scrape |
--max-results / -nMax leads per city (up to 120) | 60 | Max leads per city (up to 120) |
--output / -oWhere to save the CSV | ./results/<job_id>.csv | Where to save the CSV |
--nameHuman-readable label shown in the dashboard | Human-readable label shown in the dashboard | |
--campaign-idLink this job to an existing campaign UUID | Link this job to an existing campaign UUID | |
--presetField preset: core · cold_caller · email_outreach · full | core | Field 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 this | Skip businesses with fewer reviews than this | |
--max-reviewsSkip businesses with more reviews than this | Skip businesses with more reviews than this | |
--require-websiteSkip businesses with no website | off | Skip businesses with no website |
--require-phoneSkip businesses with no phone | off | Skip businesses with no phone |
--headless / --no-headlessShow or hide the Chrome window | --headless | Show or hide the Chrome window |
# 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- Register: the CLI calls
POST /jobs/local-startwith your query and states. The backend validates your Enterprise plan and returns ajob_idplus the list of cities to scrape. - Scrape: Playwright launches on your machine, navigates Google Maps, and writes results to a local CSV. Progress is sent to
PATCH /jobs/{id}/progressafter each city so your dashboard updates live. - 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). - 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.
| Problem | Fix |
|---|---|
No API key configured | Run: mapsharvest config --api-key mh_live_... |
403 Local worker is an Enterprise feature | Apply for Enterprise at mapsharvest.com/enterprise |
playwright: command not found | Run: pip install playwright && playwright install chromium |
0 results for a city | Google 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 saved | Your local file is at ./results/<job_id>.csv. You can re-upload or import it manually. |