API & AutomationOctober 24, 2026· 5 min read
How to Automate Google Maps Exports With the API and Webhooks
If you run the same Google Maps exports every week, stop doing them by hand. Here's how the MapsDaddy API and signed webhooks fit together, with requests you can copy.
By MapsDaddy Team
If you run the same searches every week, it's time to automate Google Maps exports. With the MapsDaddy API, your code starts the search, a signed webhook tells you when the list is ready, and your script downloads the file and sends it where it needs to go. Nobody on your team has to copy, paste or click download. This guide walks through each step with requests you can copy.
When to Automate Google Maps Exports
- You run the same kinds of searches regularly, like one category in a new city each week.
- Your results need to flow into a CRM, a database or a reporting sheet.
- You're building an internal tool or a product that uses local business data.
- Several clients or teams each need their own lists.
If you only need a list now and then, the dashboard is simpler, and you don't need to write any code.
How the Workflow Fits Together
- Trigger: a schedule, a form or your own app decides a list is needed.
- Submit: your code sends the categories, locations, a file name and a callback URL.
- Wait: the search runs on our servers. Your code doesn't need to stay running, and most files are ready in minutes.
- Get notified: a signed webhook tells your app the list is ready.
- Process: your code downloads the file, enriches it if needed, and loads it.
Step 1: Get Your API Key
Owners and admins can create a key on the API Key page. Keys start with md_live_. Store it in an environment variable, never in your code, because anyone with the key can spend your credits. Get Your API Key covers this. Every request sends it as Authorization: Bearer followed by the key.
Step 2: Start the Search
curl -X POST "https://api.mapsdaddy.com/api/v1/google-maps-scraper" \
-H "Authorization: Bearer $MAPSDADDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"categories": ["Dentist", "Orthodontist"],
"locations": ["Austin, Texas, United States", "Cedar Park, Texas, United States"],
"results_file_name": "dentists-austin",
"callback_url": "https://example.com/webhooks/mapsdaddy"
}'
That's 2 categories in 2 locations, so 4 searches. At the time of writing, each search costs a flat 10 credits, so this request uses 40, however many businesses come back. Credits are taken when the order is accepted. You can also send per_search to cap how many businesses to take from each search, and output_format as csv or xlsx.
The response includes an order_id, a status_url and a callback_signing_secret. The secret is only returned once, so save it straight away.
Step 3: Receive and Check the Webhook
MapsDaddy sends a POST to your callback_url when the order changes state. The X-MapsDaddy-Event header tells you which event it is.
| Event | What it means | What to do |
|---|---|---|
order.processing | The search has started. | Update a status, if you track one. |
order.delivered | The list is ready. | Download it and start processing. |
order.cancelled | The order was cancelled and its credits went back. | Alert someone if you didn't expect it. |
The body includes an event and a data object with the order_id, status, delivered_count, credits and a download_url. Before you trust it, check the X-MapsDaddy-Signature header. It's an HMAC SHA-256 of the raw request body, made with your signing secret:
import crypto from "node:crypto";
// Use the raw request body exactly as received (before JSON parsing).
export function isValidSignature(rawBody, signatureHeader, secret) {
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(signatureHeader ?? "");
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
Reply with a 2xx status quickly, then do the heavy work in the background. Redirects aren't followed, so point callback_url at the final HTTPS address.
Step 4: Download the File
You have three options once the order is delivered:
- The
download_urlfrom the webhook. It works without an API key, so treat it like a secret. GET /lists/{list_id}/download?format=xlsxfor the whole list, including any enrichment columns. Theorder_idis also the list ID.GET /lists/{list_id}/rowsto read 50 rows at a time as JSON.
Files stay available for 180 days.
Automating Local Business Database Exports
If the businesses you need are already in the Local Business Database, you don't need to wait for a scrape. Call POST /business-database/search to see how many match (free), POST /business-database/quote to see the exact cost, then POST /business-database/exports to create the list. Send an Idempotency-Key header so a retry doesn't charge you twice. Exports don't take a callback, so check GET /business-database/exports/{export_id} until the status is ready. Most are ready within a minute.
Add Emails in the Same Pipeline
To add contacts, send POST /lists/{list_id}/enrichments with a service like biz_email_finder. Set dry_run to true first to see the rows and the most it could cost, for free. Credits are held when the run starts, and you only pay for what's found. Check progress with GET /lists/{list_id}/enrichments.
Handle Errors Calmly
- 402: not enough credits. Check your balance with
GET /mebefore big jobs. - 409: the list isn't ready yet. Wait and try again.
- 410: the file has expired.
- 429: you hit the rate limit. Responses carry rate-limit headers, so slow down and retry.
Tip: Test with one small search and a callback URL that logs every request it gets, headers and body. Once you see
order.processingand thenorder.delivered, switch to your real endpoint.
A Practical Example
A fictional supplier, Brightline Dental Supply, wants new dental practices in Texas every Monday. A scheduled job sends one request for "Dentist" in the next three cities on its list, which is 3 searches and 30 credits. When the webhook arrives, the script downloads the CSV, runs Find Business Email with a dry run first, then loads practices like Lakeview Family Dental, (512) 555-0174, into the sales team's sheet. Next Monday it moves to the next three cities.
Getting Started
Create your key, then read the full reference in the API documentation. The latest credit costs are on the pricing page, and the Google Maps API page shows everything you can automate.
Put this into practice