Run an advanced search
run_advanced_searchStart an advanced search: many keywords across many US places — the whole US, whole states or single places — run in the background in batches, each business charged once (1 lead), stopping at lead_cap if set. Estimate first with estimate_advanced_search and confirm with the user: it spends leads. Follow it with get_advanced_search; read its leads with query_leads or send them with export_leads (campaign_id). Up to 25 running or paused at once, and 40 new ones (or 250,000 searches) a day.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional name, up to 80 characters. | |
| places | No | Single places by name ('Austin'), 'name, region' when a name is in several ('Springfield, Illinois'), or code (find_places). Up to 25,000 regions and places together; keywords × places may come to at most 50,000 searches. | |
| country | No | 'US' (the default), or a US territory's code ('PR', 'GU', 'VI', 'AS', 'MP') with a place from find_places. | |
| regions | No | Whole US states, by name or code (find_places). | |
| keywords | Yes | What to search for: up to 20 keywords or Google categories, each up to 100 characters. Each a string, or { keyword, exact } where exact keeps only businesses whose main Google category is that one. | |
| lead_cap | No | Stop after this many unique, charged leads: a whole number from 100 to 1,000,000. Omit to search every place. | |
| everywhere | No | Every place in the US (or in the territory sent as country). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| name | No | ||
| leads | No | Unique leads charged so far. | |
| places | No | How many places it searches. | |
| status | No | running | paused | completed | stopped. Paused by itself when a Free account runs out of leads (they don't renew: upgrade, then resume). | |
| estimate | No | { expected_leads, low, high, minutes } as estimated when it started. | |
| keywords | No | Each { keyword, exact }. | |
| lead_cap | No | ||
| next_step | No | ||
| resume_at | No | When a waiting search carries on by itself. | |
| by_keyword | No | Each { keyword, exact, category, searches, searches_done, leads }. | |
| created_at | No | ||
| leads_with | No | How to read its leads: query_leads or export_leads with campaign_id. | |
| top_places | No | Each { place, leads, basis }: basis "leads" — leads delivered there; or basis "businesses_checked" — leads null and businesses_checked the businesses checked there, when leads per place are not known. | |
| campaign_id | Yes | ||
| finished_at | No | ||
| running_now | No | The newest batch running now: { keyword, places, status, verified, of } — places is the batch's place names. | |
| finish_reason | No | all_searched | lead_limit | stopped once finished; null while it runs. | |
| searches_done | No | ||
| status_detail | No | One sentence on where it is — e.g. waiting for the daily city budget, and until when, or why it was paused. | |
| searches_total | No | Keywords × places. |