LeadSonar API
Search 168M B2B contacts (strongest in the US), reveal the ones you want, and enrich them with AI research and copy. Everything is grounded in each company's own website. The same metering as the app, from your code or your AI agent.
Quick start
From a new key to your first contacts in four calls.
ls_live_ and is shown once, so store it in your secret manager.curl -X POST https://app.leadsonar.io/api/v1/leads/search \
-H "X-API-Key: $LEADSONAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"industry": ["Software Development"], "seniority": ["Cxo"], "country": ["US"], "companySize": ["11-50"]}'{
"firmographic_total": 77958,
"estimated_total": 27311,
"basis": "sampled",
"narrowed_by": null
}curl -X POST https://app.leadsonar.io/api/v1/leads/browse \
-H "X-API-Key: $LEADSONAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"industry": ["Software Development"], "seniority": ["Cxo"], "country": ["US"], "page": 1, "limit": 25}'curl -X POST https://app.leadsonar.io/api/v1/leads/reveal \
-H "X-API-Key: $LEADSONAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"leadIds": ["3ddf2080-4244-5f4d-b673-6a25b21fbd67"]}'Authentication
Send your key in the X-API-Key header on every request.
curl https://app.leadsonar.io/api/v1/credits \
-H "X-API-Key: $LEADSONAR_API_KEY"{ "balance": 4820, "total_earned": 5300, "total_spent": 480 }X-API-Key, not Authorization: Bearer. A Bearer token is read as an app session, so an API key sent that way returns 401.error code and a human message. Status codes you should handle:| Status | Meaning |
|---|---|
400 | Bad input. The body says which field and, for filters, which values are valid. |
401 | Missing or invalid key. |
402 | Not enough credits. Nothing was revealed or charged, so top up and retry the same call. |
404 | No such job on your account. Jobs are private to the account that created them. |
409 | Result not ready yet. Keep polling. |
410 | Endpoint retired. See Retired endpoints. |
502 / 503 | An upstream service is unavailable. Retry with backoff. |
Lead search
Count and browse for free. Pay only for the contacts you unmask, and never twice for the same one.
| Step | Endpoint | Cost |
|---|---|---|
| Get valid filter values | GET /leads/filters | Free |
| Count what matches | POST /leads/search | Free |
| Look at the rows, masked | POST /leads/browse | Free |
| Unmask chosen rows | POST /leads/reveal | 1 credit / new lead |
| Pull a segment in bulk | POST /leads/exports | 1 credit / delivered lead |
Lists the filter fields. Call again with ?field=<name> for that field's values and lead counts. Values must match exactly: "Software" and "Software Development" are different, and a near-miss returns zero rather than an error.
curl "https://app.leadsonar.io/api/v1/leads/filters?field=seniority" -H "X-API-Key: $LEADSONAR_API_KEY"{
"field": "seniority",
"values": [
{ "value": "Staff", "count": "46030856" },
{ "value": "Manager", "count": "13846020" },
{ "value": "Cxo", "count": "5565033" },
{ "value": "Director", "count": "3555477" },
{ "value": "Vp", "count": "2096093" }
]
}Counts leads matching a filter set. Returns counts only, never contact rows.
| Parameter | Type | Description |
|---|---|---|
| industryoptional | string[] | From /leads/filters?field=industry. |
| seniorityoptional | string[] | Cxo, Vp, Director, Manager, Staff. |
| countryoptional | string[] | ISO codes. The database is ~99.9% US. |
| companySizeoptional | string[] | Employee bands, e.g. 11-50. |
| revenueoptional | string[] | Revenue bands. Revenue is estimated from headcount. |
| departmentoptional | string[] | Matched against each job title. |
| companyTypeoptional | string[] | private, government, nonprofit, education. Derived from industry; public/listed is not available. |
| jobTitlesoptional | string[] | Free text, whole-word matched against the title. |
| excludeTitlesoptional | string[] | Free text. Drops leads whose title matches. |
| includeKeywordsoptional | string[] | Matched against the company description, not the person. |
| excludeKeywordsoptional | string[] | Same field, negated. |
| maxPerCompanyoptional | number | Cap contacts per company. |
{
"firmographic_total": 77958,
"firmographic_is_exact": true,
"estimated_total": 27311,
"basis": "sampled",
"narrowed_by": null,
"keywords": null
}estimated_total. firmographic_total counts the structured filters (industry, size, country, revenue). estimated_total also applies titles, keywords, department and seniority, which are matched per row and sampled. When a result is unexpectedly small, narrowed_by names the filter that collapsed it and keywords shows what each keyword cost.Returns a page of matching leads with email, last name, domain and LinkedIn masked, so you can judge a segment before paying. Accepts the filters above plus page and limit (max 1,000). Leads you have already revealed are left out.
{
"page": 1, "limit": 25, "returned": 25,
"total": 41138, "total_is_estimate": true, "next_page": 2,
"leads": [
{
"id": "3ddf2080-4244-5f4d-b673-6a25b21fbd67",
"firstName": "Shawn", "lastName": "J.",
"email": "•••@•••.org",
"companyName": "Sea Change Health",
"jobTitle": "COO & Director of Innovative Medicine",
"companySize": "1 to 10",
"industryName": "Veterinary Services"
}
]
}next_page is null at the end of the segment.
Unmasks leads by id. This is the app's own reveal: the same transaction, dedup and ledger. Re-revealing a lead returns it again at no charge. If you can't afford the whole batch, nothing is revealed and nothing is charged (402).
| Parameter | Type | Description |
|---|---|---|
| leadIdsrequired | string[] | Up to 100,000 ids from /leads/browse. One malformed id rejects the batch uncharged. |
{
"revealed": [
{ "firstName": "Shawn", "lastName": "Johnson",
"email": "shawn@seachangehealth.org",
"companyDomain": "seachangehealth.org",
"linkedinUrl": "linkedin.com/in/shawn-johnson-72779711" }
],
"credits_charged": 1,
"new_reveals": 1,
"already_revealed": 0
}Starts an asynchronous export of a whole segment. Takes the filters above and a required limit (max 50,000 per job; above that, capped_to_max tells you it was trimmed). An export never re-delivers a lead your account already has, so re-running the same filters returns fewer rows and eventually zero.
curl -X POST https://app.leadsonar.io/api/v1/leads/exports \
-H "X-API-Key: $LEADSONAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"industry": ["Software Development"], "seniority": ["Cxo"], "country": ["US"], "limit": 5000}'{
"job_id": "0f1c…",
"status": "queued",
"requested_limit": 5000,
"capped_to_max": null,
"poll": "/api/v1/leads/exports/0f1c…",
"download": "/api/v1/leads/exports/0f1c…/csv"
}Export status. Poll until status is completed. GET /api/v1/leads/exports lists your recent jobs.
Downloads the CSV. Before completion this returns 409 EXPORT_NOT_READY. The X-Delivered-Rows header is the number of leads billed.
curl -L https://app.leadsonar.io/api/v1/leads/exports/JOB_ID/csv -H "X-API-Key: $LEADSONAR_API_KEY" -o leads.csvAI enrichment
Send a CSV of leads and get it back with research and copy columns. Every row is written from that company's own website. Rows whose site couldn't be read are marked in Website Read and left blank rather than guessed, and blank cells are refunded.
Submits an asynchronous enrichment job. The request is multipart/form-data. The CSV needs a website/domain column or an email column on every row. Name, title and company columns are detected automatically. Credits for every requested cell are held up front, and cells that come back empty are refunded when the job finishes.
| Parameter | Type | Description |
|---|---|---|
| filerequired | file (.csv) | Your leads. No row cap; large files are streamed. |
| fieldsrequired | string | Comma-separated field ids from the table below, e.g. icp_grading,icp,opener. |
| target_icp | string | Who you sell to, in 1–2 sentences (max 500 chars). Required with icp_grading. |
| seller_offeroptional | string | What you sell, used to write the copy (max 500 chars). |
| user_tagoptional | string | Your own label, returned on the job. |
curl -X POST https://app.leadsonar.io/api/v1/enrich-csv \
-H "X-API-Key: $LEADSONAR_API_KEY" \
-F "file=@leads.csv" \
-F "fields=icp_grading,icp,opener,subject_lines" \
-F "target_icp=US property management companies with 20-500 employees" \
-F "seller_offer=Tenant screening that cuts vacancy time in half"{
"id": "5415b5f2-4d3a-45df-81fc-957073fb4f14",
"status": "queued",
"total_rows": 1000,
"credits_charged": 4000
}| Field | What you get | Credits |
|---|---|---|
icp_grading | A/B/C/D grade and 0–100 score for fit against your target_icp | 1 |
icp | Who this company sells to (their buyer persona) | 1 |
opener | Personalized first line, written from the company's own site | 1 |
subject_lines | Subject line for the cold email | 1 |
full_email | One complete cold email. Free with opener/subject_lines | 0 |
custom_company_type | What kind of company this is, e.g. "regional HVAC contractor" | 1 |
custom_buyer_personas | Buyer titles at the kind of company they sell to | 1 |
custom_simplified_job_title | Title cleaned for use in copy ("VP Sales") | 2 |
custom_who_they_work_with | The customers the company serves | 2 |
custom_recent_professional_achievement | A recent, citable company or role achievement | 2 |
custom_subject_line | Alternative subject line | 2 |
custom_personalized_opener | Long-form opener | 2 |
custom_ps_line | P.S. line | 2 |
custom_two_liner | Two-sentence pitch | 2 |
custom_got_me_thinking | Achievement-led email | 2 |
custom_full_email_v1 | Observation-led email | 2 |
custom_full_email_v2 | Short, direct email | 2 |
Job progress: status (queued, running, completed, failed), completed_rows, progress_pct, an ETA range, credits_charged / credits_refunded and a per-field fill field_report. GET /api/v1/enrich-csv/jobs lists your jobs.
{
"id": "5415b5f2-…",
"status": "running",
"total_rows": 1000,
"completed_rows": 640,
"progress_pct": 64.0,
"eta_low_seconds": 90,
"eta_high_seconds": 160,
"credits_charged": 4000,
"credits_refunded": 0,
"download_url": null
}Downloads your original columns plus the enriched ones. Add ?headers=snake for snake_case column names that sequencers can map.
curl -L "https://app.leadsonar.io/api/v1/enrich-csv/jobs/JOB_ID/csv?headers=snake" -H "X-API-Key: $LEADSONAR_API_KEY" -o enriched.csvGrades one company against your ICP, synchronously (typically a few seconds). Use this for per-lead decisions inside an agent loop. For lists, /enrich-csv with icp_grading is cheaper per row to run and to retry.
| Parameter | Type | Description |
|---|---|---|
| target_icprequired | string | Who you sell to, 1–2 sentences (max 500 chars). |
| domain / email / companyrequired | string | At least one, so the company can be identified. A domain gives the best result. |
| first_name, last_name, title, industryoptional | string | Context for the grade. |
| seller_offeroptional | string | What you sell. |
{
"grade": "B",
"score": 75,
"fit": "high",
"company_type": "Financial Infrastructure Providers",
"their_solution": "Payment and Financial Tools",
"buyer_personas": "founders at financial infrastructure providers",
"cost_credits": 1
}Domain scrape
Get the website text LeadSonar reads before it writes anything, so you can run your own prompts and models on it.
Queues up to 50,000 domains. URLs and email addresses are reduced to their domain, and duplicates are scraped once. Credits are held per domain, and domains that come back blocked, no_content or invalid are refunded.
curl -X POST https://app.leadsonar.io/api/v1/scrape/jobs \
-H "X-API-Key: $LEADSONAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domains": ["stripe.com", "https://www.tutera.com/about", "jane@agemark.com"]}'{ "id": "cee00043-…", "status": "queued", "total": 3, "credits_charged": 3, "credits_refunded": 0 }Progress with per-status counts (ok, blocked, no_content, invalid). GET /api/v1/scrape/jobs lists your jobs.
Paged results: ?offset=&limit=&status=ok. Each item has domain, status and text. The text is the homepage, cleaned of navigation and cookie banners (a few thousand characters).
Segmentation
Classify a lead pool into your own campaign segments and pull each segment by API. Enabled per account on request: contact support@leadsonar.io.
exclude, then serves the result as JSON or CSV. Runs are resumable, and labels persist per lead.| Method | Endpoint | Purpose |
|---|---|---|
| GET | /api/v1/segments | Which segment spaces your key can use (empty for accounts without access) |
| GET / PUT / DELETE | /api/v1/segments/{client}/definitions[/{segment}] | Read and edit segment definitions |
| POST | /api/v1/segments/{client}/upload | Upload a lead pool (multipart CSV) |
| POST | /api/v1/segments/{client}/classify | Start a classification run (202) |
| GET | /api/v1/segments/{client}/runs[/{runId}] | Run progress |
| GET | /api/v1/segments/{client} | Counts per segment |
| GET | /api/v1/segments/{client}/leads | Pull leads with their segment (JSON, paged) |
| GET | /api/v1/segments/{client}/export | Pull leads with their segment (CSV) |
Account
Check your balance before large jobs. Every job that spends credits reports what it charged and refunded.
Current balance, all-time credits earned and all-time credits spent.
{ "balance": 4820, "total_earned": 5300, "total_spent": 480 }AI agents (MCP)
Give Claude, Cursor or any MCP-capable agent LeadSonar as a set of tools. The agent can search, browse, reveal, export, enrich, score and scrape with your key. Free calls stay free, and the tools that spend credits say so in their descriptions.
https://app.leadsonar.io/mcp (Streamable HTTP). Authenticate with the same X-API-Key header. Authorization: Bearer ls_live_… also works for clients that can only send a bearer token.claude mcp add --transport http leadsonar https://app.leadsonar.io/mcp \
--header "X-API-Key: $LEADSONAR_API_KEY"{
"mcpServers": {
"leadsonar": {
"url": "https://app.leadsonar.io/mcp",
"headers": { "X-API-Key": "ls_live_…" }
}
}
}mcp-remote (requires Node.js 20+):{
"mcpServers": {
"leadsonar": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://app.leadsonar.io/mcp", "--header", "X-API-Key:${LEADSONAR_API_KEY}"],
"env": { "LEADSONAR_API_KEY": "ls_live_…" }
}
}
}| Tool | What it does | Cost |
|---|---|---|
list_filter_values | Exact filter values. Agents call this first | Free |
count_leads, browse_leads | Count a segment; look at masked rows | Free |
reveal_leads | Unmask chosen leads | 1 credit / new lead |
create_lead_export + get / list / download | Bulk export a segment to CSV | 1 credit / delivered lead |
enrich_leads + get / list / download | AI enrichment on rows or a CSV. dry_run prices it for free | Per filled cell |
score_icp_fit | Grade one company against your ICP | 1 credit |
scrape_domains + get / results | Company website text | 1 credit / domain read |
get_credits | Balance | Free |
list_segment_clients, segment_leads, … | Segmentation (enabled on request) | Free |
Credits
The API uses the same credit balance as the app. Plans and top-ups are on the pricing page.
| Action | Cost |
|---|---|
| Filter values, counts, browsing masked leads | Free |
| Reveal a lead (reveal or export) | 1 credit per new lead. Leads you already have are free |
| AI enrichment: standard field | 1 credit per filled cell |
AI enrichment: custom_* copy field | 2 credits per filled cell |
full_email (with opener or subject lines) | Free |
| ICP score, single company | 1 credit |
| Domain scrape | 1 credit per domain read. Unreadable domains refunded |
Retired endpoints
These return 410 ENDPOINT_RETIRED with a pointer to their replacement.
| Endpoint | Use instead |
|---|---|
POST /api/v1/find-email | /leads/browse + /leads/reveal |
POST /api/v1/find-phone | Not offered through the API |
POST /api/v1/enrich | /leads/reveal for contact data, /enrich-csv for AI enrichment |
GET /api/v1/providers | Removed |
GET /api/v1/enrich/{id} still returns results for jobs created before retirement.OpenAPI spec
Machine-readable spec for client generators and agent frameworks.
https://app.leadsonar.io/api/openapi.json