Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in

Collectors · Lead generation

Lead scraper API in Python

Businesses for a keyword + location enriched with emails, phones and socials from their websites. One POST from Python with query and location, rows back as JSON with 34 fields, $0.01 per delivered lead. No proxies or parsers to maintain.

A Python requests snippet that posts {
A Python requests call to the local_business_leads collector returns one dict per lead, at $0.01 each.

First call

Install, call, read the rows.

pip install requests
The only dependency.
import os, requests

r = requests.post(
    "https://api.quanticdata.io/v1/scraper/collectors/local_business_leads/run",
    headers={"Authorization": f"Bearer {os.environ['QD_API_KEY']}"},
    json={
        "query": "dentist",
        "location": "Austin, TX",
        "country": "us",
        "max_results": 10,
    },
    timeout=120,
)
r.raise_for_status()
run = r.json()["payload"]
print(run["count"], "rows,", run["cost"]["usd"], "USD")
for row in run["results"]:
    print(row.get("name"), row.get("category"), row.get("rating"), row.get("reviews"))
Python: one Local business leads run (Dentists in Austin), printing name, category, rating, reviews

The key comes from an environment variable, never from the code. The run answers in the same request when it finishes in time; payload.results holds the rows and payload.cost what they cost.

Request parameters

What the collector takes.

Input of the Local business leads collector
ParameterTypeRequiredMeaning
querystringyesBusiness type, e.g. "dentist", "officina meccanica".
locationstringyesCity / area, e.g. "Austin, TX".
countrystringnoISO 3166-1 alpha-2 code — proxy exit geo and Google locale (gl). Omit for the default pool.
langstringnoInterface language (hl), e.g. en, it, de.
only_with_contactsbooleanno (default false)Deliver only leads with at least one email or phone.
directoriesarraynoAdd businesses listed in these Italian directories that Google Maps did not return — the operators with no web presence. Off by default: it delivers, and bills, more rows.
cross_checkbooleanno (default false)Resolve the same business across the channels into one record instead of delivering it twice. Matching is on the phone number, on street+civic plus a distinctive word of the name, or on the name alone when it carries two distinctive words. Adds sources, sources_count, matched_by and address_confirmed to every row. Off by default: it changes the shape of the delivered rows.
verify_emailsbooleanno (default false)Add email_check to each row: syntax, whether the domain has a mail server that accepts delivery (MX), whether the address is a role mailbox (info@, segreteria@) and whether the same address appears on other rows of the run.
deep_contactsbooleanno (default false)When the homepage shows no email, try up to three of the site's own pages instead of one — contatti, dove siamo, and the privacy notice, which in Italy has to name the data controller with an address. Stops at the first page that yields an email.
serp_emailsbooleanno (default false)For businesses whose site showed no email, run one web search on their domain and keep any address the search engine quotes in its snippets — only when it is on the business's own domain. One search per such business.
professionalsbooleanno (default false)Read MioDottore for the same category and place and attach the professionals who practise at each business — name, specialty, profile and published prices. Maps gives you the practice and its website; this gives you the person to address the letter to. Matched by phone or by street and civic number, never by name: a dentist is not called like the clinic.
professional_phonesbooleanno (default false)Open each professional's profile to read their phone numbers too. One extra request per professional; only meaningful with professionals.
professionals_as_leadsbooleanno (default true)With professionals: the practices MioDottore lists at addresses that Maps and the directories did not return become rows of their own (source: miodottore, sources_count 1). Set false to only attach professionals to the businesses already found.
enrich_detailsbooleanno (default false)Look up the place card of every business the map listed without its weekly hours or its review count, and fill them in (it can also add a website or phone the list row lacked). One small extra lookup per such business; off by default.
max_resultsintegerno (default 10)How many leads to deliver at most (1–500). You pay only for delivered leads.

Response fields

34 fields per lead.

Fields of each row (lead)
FieldTypeWhat it holds
rankinteger1-based position.
namestringBusiness name.
categorystring, nullableGoogle category.
ratingnumber, nullableStar rating.
reviewsinteger, nullableReview count.
addressstring, nullableAddress.
phonestring, nullablePhone from Google.
websitestring, nullableWebsite URL.
emailsstring[]Emails found on the site (mailto, JSON-LD, page text).
phonesstring[]Phones found on the site (tel: links) + Google phone.
socialsobject{ facebook, instagram, linkedin, twitter, youtube, tiktok } URLs when found.
maps_urlstring, nullableGoogle Maps link.
place_idstring, nullableGoogle place id.
data_idstring, nullableFeature id.
source_pagesstring[]Website pages that were scanned.
site_statusstringscanned | no_website | unreachable | blocked
email_sourcestring, nullableWith serp_emails: "search_snippet" when the address came from a search result rather than from the site itself.
sourcestringWhich channel delivered the row: "google_maps" or the directory name.
sourcesstring[], nullableWith cross_check: every channel that listed this business.
sources_countinteger, nullableWith cross_check: how many independent channels agreed on it. A buyer checking a sample checks this column first.
matched_bystring[], nullableWith cross_check: how the channels were tied together — "phone", "address" (same street and civic plus a distinctive word) or "name".
address_confirmedboolean, nullableWith cross_check: two channels printed the same street and civic number, not merely the same name.
namesstring[], nullableWith cross_check: the other spellings the channels used — the legal name next to the signage.
addressesstring[], nullableWith cross_check: the addresses the channels printed, when they differ.
professionalsobject[], nullableWith professionals: who practises at this address, as { name, specialty, url, phone, prices }. The business card says "Poliambulatorio X"; this says which fifteen doctors receive there.
email_checkobject[], nullableWith verify_emails: per address { email, status: ok | no_mx | duplicate | invalid, mx, shared_with, role }. "duplicate" means the same address is on other rows — a chain's head office, not a practice.
hoursstring, nullableOpening hours as the map shows them: today's line, or the whole week ("Monday: 9 AM–6 PM; …") when the weekly table is known.
weekly_hoursobject, nullableWeekly opening hours as { day: hours }, when the map has them (always looked up with enrich_details).
open_statestring, nullableOpen state as the map states it ("Open", "Closed", "Temporarily closed"…).
latitudenumber, nullableLatitude of the place.
longitudenumber, nullableLongitude of the place.
price_levelstring, nullablePrice level as shown on the map ($, $$, €€…).
checked_atstring, nullableDate (YYYY-MM-DD) the row was last checked: the end of this run.
email_typestring, nullableFirst email of the row: "generic" for a role mailbox (info@, segreteria@, the same rule as email_check.role), "personal" otherwise, null without an email.

Add ?format=csv to the runs endpoint to get the same rows as CSV.

Long runs

Run in the background, then poll.

A run that needs more time can go to the background: send "async": true, get 202 with the run id, and poll the runs endpoint until the status is done. Reading a run is free.

import os, time, requests

H = {"Authorization": f"Bearer {os.environ['QD_API_KEY']}"}
r = requests.post("https://api.quanticdata.io/v1/scraper/collectors/local_business_leads/run", headers=H,
                  json={**{"query":"dentist","location":"Austin, TX","country":"us","max_results":10}, "async": True}, timeout=30)
run_id = r.json()["payload"]["run_id"]
while True:
    run = requests.get(f"https://api.quanticdata.io/v1/scraper/collectors/runs/{run_id}", headers=H, timeout=30).json()["payload"]
    if run["status"] in ("done", "failed"):
        break
    time.sleep(5)
print(run["status"], run["count"])
Python: background run and polling

Errors

What can come back, and what is billed.

Collector run errors
StatusMeaningBilled
400The input does not match the collector (payload.errors)No
401Missing or wrong API keyNo
402Balance and free credit do not cover the run: top upNo
422The input can never resolve; retrying the same input cannot helpNo
424The run failed at the source (blocked, timed out, layout changed); safe to retryNo
429Rate limit or a per-account brake; wait for Retry-AfterNo

Only delivered rows are billed: a run that delivers nothing costs nothing.

Price

$0.01 per delivered lead.

What Local business leads rows cost at list price
RowsCost
1$0.01
1,000$10.00
10,000$100.00

Up to 500 leads per run; split larger jobs into several runs. The $2 free credit every month covers about 200 leads. No subscription; paid tiers lower the unit price. All collector prices: collector pricing.

Before you run it

Questions developers ask

Is there a free Local business leads API?

Every account gets $2 of free usage each month, about 200 leads of this collector at $0.01 each, with no card.

Do I have to handle proxies, retries or blocks?

No. The collector runs on our network and handles them; a run blocked at the source returns 424 and is not billed.

How many rows can one run return?

Up to 500 leads per run (the max_results input, where the collector has one).

Can an AI agent run it?

Yes: the MCP server exposes it as the run_collector tool, with the same input and price. See the MCP server.

Run it on the free credit.

Create an API key, export it as QD_API_KEY and run the example. $0.01 per delivered lead, no subscription.