Dev.to WebDev 🛠 Dev 👁 2 📖 8 min read

Scraping Public Map Data Without Getting Burned: Rate Limits, ToS, and What's Actually Fair Game

We build MapsScraper.dev, a Google Maps data-extraction service for local-business research, and this guide is the rulebook we hold our own product to — disclosure up front, because it's the honest thing to do. Everythin

Scraping Public Map Data Without Getting Burned: Rate Limits, ToS, and What's Actually Fair Game

We build MapsScraper.dev, a Google Maps data-extraction service for local-business research, and this guide is the rulebook we hold our own product to — disclosure up front, because it's the honest thing to do. Everything below is general engineering knowledge you can act on regardless of whose tooling you use, and none of it is legal advice; where the law is genuinely uncertain, we say so.

Map data is where a lot of engineering projects quietly go wrong. The data looks public — you can see every business name, rating, and phone number in your browser right now — and the gap between "I can see it" and "I may store, reuse, or resell it" is where teams get their IPs banned, their accounts terminated, and occasionally their companies sued. This is a field guide to staying on the right side of that line, written for the engineer who just got handed a task like "get all the dentists in Austin with their ratings into a spreadsheet."

The open-data hierarchy: where the data actually lives

Before writing a single line of scraping code, place your target on this ladder. The higher the tier, the less you fight:

  1. Official open APIs and open datasets. OpenStreetMap exposes the whole planet under an open license — the Overpass API returns every café and bench in a bounding box for free, and periodic planet extracts can be downloaded in bulk. Transit agencies publish GTFS feeds. Governments publish address registers. If your question can be answered from an open dataset, nothing below this tier is justified.
  2. Official commercial APIs. Google's Places API, Bing Local Search, Foursquare, and similar products sell structured access with explicit terms, quotas, and pricing. It costs money, but you get a contract: sanctioned access, predictable limits, and someone to email when things break.
  3. Public web surfaces. The map search results page you see in a browser. There is no contract saying you may harvest it; usually there's a terms-of-service document saying you may not, enforced technically by rate limits and bot detection rather than by a paywall.
  4. Gated or private surfaces. Anything behind a login, a captcha, or a user agreement you accepted as an end user. Scraping these while pretending to be an ordinary user is where technical gray zones start turning into fraud or contract-breach claims. Don't.

Most scraping pain comes from teams that start at tier 3 because it's free, then discover tier 3 has teeth. Check tiers 1 and 2 first, every time. The math often surprises: a weekend of tier-3 scraping maintenance (proxies, retries, parser rot after every redesign) frequently costs more than a tier-2 API bill.

The four-layer checklist before you write a crawler

Layer 1: robots.txt — the sign, not the law

robots.txt is a convention, not a technical or legal barrier. Many high-value map endpoints don't even expose one. Treat it as the site owner's posted intent: if robots.txt disallows the path and you crawl it anyway through some third door, you have knowingly acted against the operator's stated wishes — which matters later if anyone ever asks a court or a judge what your intent was. It costs nothing to read it first, and it's evidence of good faith.

Layer 2: Terms of service — the contract layer

This is the layer that actually bites. Google Maps' terms, like most commercial map providers', prohibit scraping and prohibit copying content — business names, reviews, ratings — except through sanctioned APIs. The enforceability and legal weight of ToS clauses varies by jurisdiction (browse the hiQ v. LinkedIn litigation saga for a decade-long demonstration of how contested this area is in the US; note that litigation continued long after initial wins and losses), but "the contract might not hold up" is not a plan any engineering manager should accept.

Two practical reads of any map ToS:

  • What's prohibited: automated bulk collection of the content (reviews, photos, descriptions are almost always the most protected), and any access that impersonates ordinary user traffic.
  • What's typically less contested: factual data — a business's name, address, phone number, and coordinates are facts, not creative expression. Fact-only extraction from a public page is a lower-risk profile than content mirroring, everywhere in the world. Lower-risk is not no-risk: the access method can still violate the ToS even when the data itself is factual.

Layer 3: data licensing — the afterlife of your dataset

If you successfully extract data and put it in a product, licensing governs what you may do next. ODbL (OpenStreetMap's license) requires attribution and share-alike on derived databases — miss that and your "open" dataset quietly infects your product's licensing. Vendor datasets carry their own contracts. And public availability of a fact still doesn't establish your right to store, resell, or contact — a phone number shown on a map listing is not an invitation to add it to your outbound dialer.

Layer 4: personal data — the red line that doesn't move

GDPR, CCPA, and their cousins treat sole traders' business phone numbers and emails as personal data in many jurisdictions. Enrichment ("find the owner's personal email") is the highest-risk activity in this entire field — it's the one that attracts regulators, not just platform bans. If your pipeline touches personal data, you need a lawful basis, a retention limit, and a deletion story before the first request goes out.

Engineering the polite client

Assume you've landed legitimately on tier 2 or 3 work. This is the part that's pure engineering, and it's where "compliant" and "effective" turn out to be the same thing.

Rate limiting is a conversation, not a wall. Start from the documented quota if one exists. If it doesn't, measure: send one request, watch the response headers for RateLimit-* or Retry-After hints, and treat a 429 not as an error to retry faster but as the server telling you your speed. The workhorse pattern is a token bucket per host:

capacity:      N tokens (burst allowance, start ~2-4)
refill rate:   r tokens/sec (start conservative: 1 per 2-4 s)
each request:  cost 1 token; empty bucket = wait, don't hammer

On any 429 or 403: exponential backoff with jitter, delay = base * 2^attempt + random(0, base), honoring Retry-After when present. The jitter matters more than the exponent — a thousand clients backing off in perfect unison is itself a DDoS-shaped traffic pattern, and servers notice.

Cache like the data is expensive, because it is. Send conditional requests (ETag/If-None-Match, If-Modified-Since) and treat a 304 as free. Cache map tiles with their exact z/x/y key — but understand what tile caching is for: serving your own maps, one tile per render. Bulk tile harvesting (walking every zoom level of a city to rebuild someone else's raster database) is the single most instantly-banned pattern in this field, because tile servers bill per render and one tile is meant to equal one render.

Crawl incrementally. A city's business list changes at human speed — openings, closings, renames. Delta windows (re-check only records older than N days, poll high-churn categories weekly and low-churn ones quarterly) cut your request volume by an order of magnitude versus full refreshes, which makes every other discipline above easier to keep.

Identify yourself. A User-Agent with a product name and a contact URL, honoring robots.txt, is the difference between "unknown scraper" (default assumption: hostile) and "identifiable client with a support inbox." It will not save you from a ToS violation, but it changes the conversation when a sysadmin finds your traffic — and if you're on tier 2, a real identity is often required by the API's terms anyway.

Cap concurrency per host. One or two in-flight requests per hostname is the polite ceiling for tier-3 work. Distributing load across rotating proxy pools to evade this ceiling is the moment you cross from "rate-limited client" into "evasion" — that's the technical definition of most anti-circumvention clauses, and it's where bans become permanent.

The signals that you're about to get burned

Every platform escalates differently, but the pattern rhymes: subtle slowdowns first (latency climbing, results thinning — soft rate limiting), then explicit 429/403s, then IP-range blocks, then account and legal escalation if the volume was commercial. If your success rate is quietly decaying across days, you are being told something. The correct response to escalation is to stop and change tiers — go to the official API or the open dataset — not to get better at evasion. Every evasion step you add (rotating fingerprints, residential proxies, captcha solving) converts a contract dispute into a deliberate one, and platforms document it.

When scraping is the wrong tool: the decision path

Run every map-data need through this filter before building a crawler:

  • Is there an open dataset? (OSM/Overpass for points of interest, government registers for addresses, GTFS for transit.) Use it. Costs: learning a query language, an afternoon. License: clean.
  • Is there an official API with a free tier that fits your volume? Do the arithmetic — most commercial location APIs have calculable per-query costs, and at small scale the free tier wins.
  • Is the volume large and ongoing? Then budget for tier 2 properly. At serious scale, sanctioned access is cheaper than any evasion-maintained scraper, because the scraper's real cost is an engineer permanently keeping the parser alive against a counterparty actively resisting it.
  • Is this a one-off research list? A bounded, rate-limited, factual extraction — the "export the dentists of Austin once" job — is the lowest-risk tier-3 use case that exists. Keep it factual, bounded, and slow, and it usually stays a non-event.

This is the architecture pattern we ended up building our own product around, incidentally: bounded tasks with the budget shown before the run, so volume is a decision the operator makes rather than an accident the crawler has. Whatever tooling you use, that shape — estimate first, cap the task, fail loudly — is what keeps a research job from turning into a scraping incident.

Decision tree: which data path should your project take

Honest limits of this guide

Compliance varies by jurisdiction, and this page is engineering experience, not legal advice. For anything commercial at scale — especially anything touching personal data or content redistribution — get an actual lawyer to read the actual terms in your actual market. What this guide can promise is narrower: the tier-1-first habit, the four-layer checklist, and the polite-client mechanics will keep you out of the most common self-inflicted incidents in this field, which are (in order of frequency) bulk tile harvesting, ToS-blind content mirroring, and personal-data enrichment that nobody signed off on.

The engineers who last in this field are the ones who treat every public surface as someone else's machine — because it is. Scrape like a guest, not a locust.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.