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.

Base URL https://app.leadsonar.io/api/v1

Quick start

From a new key to your first contacts in four calls.

1
Create an API key
In the app, open Settings → API Keys and click Create API Key. The key starts with ls_live_ and is shown once, so store it in your secret manager.
2
Count a segment (free)
cURL
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"]}'
JSON
{
  "firmographic_total": 77958,
  "estimated_total": 27311,
  "basis": "sampled",
  "narrowed_by": null
}
3
Browse the rows, masked (free)
cURL
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}'
4
Reveal the ones you want (1 credit each)
cURL
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
curl https://app.leadsonar.io/api/v1/credits \
  -H "X-API-Key: $LEADSONAR_API_KEY"
JSON
{ "balance": 4820, "total_earned": 5300, "total_spent": 480 }
⚠️
Use X-API-Key, not Authorization: Bearer. A Bearer token is read as an app session, so an API key sent that way returns 401.
🔑
A key acts as your account. It spends your credits, so keep it server-side and out of repos and browser code. Revoke it in Settings → API Keys if it leaks.
Errors
Errors are JSON with an error code and a human message. Status codes you should handle:
StatusMeaning
400Bad input. The body says which field and, for filters, which values are valid.
401Missing or invalid key.
402Not enough credits. Nothing was revealed or charged, so top up and retry the same call.
404No such job on your account. Jobs are private to the account that created them.
409Result not ready yet. Keep polling.
410Endpoint retired. See Retired endpoints.
502 / 503An 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.

StepEndpointCost
Get valid filter valuesGET /leads/filtersFree
Count what matchesPOST /leads/searchFree
Look at the rows, maskedPOST /leads/browseFree
Unmask chosen rowsPOST /leads/reveal1 credit / new lead
Pull a segment in bulkPOST /leads/exports1 credit / delivered lead
GET/api/v1/leads/filtersFree

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
curl "https://app.leadsonar.io/api/v1/leads/filters?field=seniority" -H "X-API-Key: $LEADSONAR_API_KEY"
JSON
{
  "field": "seniority",
  "values": [
    { "value": "Staff", "count": "46030856" },
    { "value": "Manager", "count": "13846020" },
    { "value": "Cxo", "count": "5565033" },
    { "value": "Director", "count": "3555477" },
    { "value": "Vp", "count": "2096093" }
  ]
}
POST/api/v1/leads/searchFree

Counts leads matching a filter set. Returns counts only, never contact rows.

Filters (shared by search, browse and exports)
ParameterTypeDescription
industryoptionalstring[]From /leads/filters?field=industry.
seniorityoptionalstring[]Cxo, Vp, Director, Manager, Staff.
countryoptionalstring[]ISO codes. The database is ~99.9% US.
companySizeoptionalstring[]Employee bands, e.g. 11-50.
revenueoptionalstring[]Revenue bands. Revenue is estimated from headcount.
departmentoptionalstring[]Matched against each job title.
companyTypeoptionalstring[]private, government, nonprofit, education. Derived from industry; public/listed is not available.
jobTitlesoptionalstring[]Free text, whole-word matched against the title.
excludeTitlesoptionalstring[]Free text. Drops leads whose title matches.
includeKeywordsoptionalstring[]Matched against the company description, not the person.
excludeKeywordsoptionalstring[]Same field, negated.
maxPerCompanyoptionalnumberCap contacts per company.
Response
JSON
{
  "firmographic_total": 77958,
  "firmographic_is_exact": true,
  "estimated_total": 27311,
  "basis": "sampled",
  "narrowed_by": null,
  "keywords": null
}
📏
Plan around 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.
POST/api/v1/leads/browseFree

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.

JSON
{
  "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.

POST/api/v1/leads/reveal1 credit / new lead

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).

ParameterTypeDescription
leadIdsrequiredstring[]Up to 100,000 ids from /leads/browse. One malformed id rejects the batch uncharged.
JSON
{
  "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
}
POST/api/v1/leads/exports1 credit / delivered lead

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
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}'
JSON
{
  "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"
}
GET/api/v1/leads/exports/{id}Free

Export status. Poll until status is completed. GET /api/v1/leads/exports lists your recent jobs.

GET/api/v1/leads/exports/{id}/csvFree

Downloads the CSV. Before completion this returns 409 EXPORT_NOT_READY. The X-Delivered-Rows header is the number of leads billed.

cURL
curl -L https://app.leadsonar.io/api/v1/leads/exports/JOB_ID/csv -H "X-API-Key: $LEADSONAR_API_KEY" -o leads.csv

AI 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.

POST/api/v1/enrich-csvCredits per filled cell

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.

ParameterTypeDescription
filerequiredfile (.csv)Your leads. No row cap; large files are streamed.
fieldsrequiredstringComma-separated field ids from the table below, e.g. icp_grading,icp,opener.
target_icpstringWho you sell to, in 1–2 sentences (max 500 chars). Required with icp_grading.
seller_offeroptionalstringWhat you sell, used to write the copy (max 500 chars).
user_tagoptionalstringYour own label, returned on the job.
cURL
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"
JSON
{
  "id": "5415b5f2-4d3a-45df-81fc-957073fb4f14",
  "status": "queued",
  "total_rows": 1000,
  "credits_charged": 4000
}
Fields and credits per filled cell
FieldWhat you getCredits
icp_gradingA/B/C/D grade and 0–100 score for fit against your target_icp1
icpWho this company sells to (their buyer persona)1
openerPersonalized first line, written from the company's own site1
subject_linesSubject line for the cold email1
full_emailOne complete cold email. Free with opener/subject_lines0
custom_company_typeWhat kind of company this is, e.g. "regional HVAC contractor"1
custom_buyer_personasBuyer titles at the kind of company they sell to1
custom_simplified_job_titleTitle cleaned for use in copy ("VP Sales")2
custom_who_they_work_withThe customers the company serves2
custom_recent_professional_achievementA recent, citable company or role achievement2
custom_subject_lineAlternative subject line2
custom_personalized_openerLong-form opener2
custom_ps_lineP.S. line2
custom_two_linerTwo-sentence pitch2
custom_got_me_thinkingAchievement-led email2
custom_full_email_v1Observation-led email2
custom_full_email_v2Short, direct email2
GET/api/v1/enrich-csv/jobs/{id}Free

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.

JSON
{
  "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
}
GET/api/v1/enrich-csv/jobs/{id}/csvFree

Downloads your original columns plus the enriched ones. Add ?headers=snake for snake_case column names that sequencers can map.

cURL
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.csv
POST/api/v1/icp-score1 credit

Grades 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.

ParameterTypeDescription
target_icprequiredstringWho you sell to, 1–2 sentences (max 500 chars).
domain / email / companyrequiredstringAt least one, so the company can be identified. A domain gives the best result.
first_name, last_name, title, industryoptionalstringContext for the grade.
seller_offeroptionalstringWhat you sell.
JSON
{
  "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.

POST/api/v1/scrape/jobs1 credit / domain read

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
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"]}'
JSON
{ "id": "cee00043-…", "status": "queued", "total": 3, "credits_charged": 3, "credits_refunded": 0 }
GET/api/v1/scrape/jobs/{id}Free

Progress with per-status counts (ok, blocked, no_content, invalid). GET /api/v1/scrape/jobs lists your jobs.

GET/api/v1/scrape/jobs/{id}/resultsFree

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.

You define segments in plain language (who belongs, who doesn't). LeadSonar reads each company's website and assigns every lead to one segment or to exclude, then serves the result as JSON or CSV. Runs are resumable, and labels persist per lead.
MethodEndpointPurpose
GET/api/v1/segmentsWhich 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}/uploadUpload a lead pool (multipart CSV)
POST/api/v1/segments/{client}/classifyStart 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}/leadsPull leads with their segment (JSON, paged)
GET/api/v1/segments/{client}/exportPull leads with their segment (CSV)

Account

Check your balance before large jobs. Every job that spends credits reports what it charged and refunded.

GET/api/v1/creditsFree

Current balance, all-time credits earned and all-time credits spent.

JSON
{ "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.

Hosted server
Endpoint: 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 Code
Shell
claude mcp add --transport http leadsonar https://app.leadsonar.io/mcp \
  --header "X-API-Key: $LEADSONAR_API_KEY"
Cursor (~/.cursor/mcp.json)
JSON
{
  "mcpServers": {
    "leadsonar": {
      "url": "https://app.leadsonar.io/mcp",
      "headers": { "X-API-Key": "ls_live_…" }
    }
  }
}
Claude Desktop (claude_desktop_config.json)
Claude Desktop connects to remote servers through mcp-remote (requires Node.js 20+):
JSON
{
  "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_…" }
    }
  }
}
Tools
ToolWhat it doesCost
list_filter_valuesExact filter values. Agents call this firstFree
count_leads, browse_leadsCount a segment; look at masked rowsFree
reveal_leadsUnmask chosen leads1 credit / new lead
create_lead_export + get / list / downloadBulk export a segment to CSV1 credit / delivered lead
enrich_leads + get / list / downloadAI enrichment on rows or a CSV. dry_run prices it for freePer filled cell
score_icp_fitGrade one company against your ICP1 credit
scrape_domains + get / resultsCompany website text1 credit / domain read
get_creditsBalanceFree
list_segment_clients, segment_leads, …Segmentation (enabled on request)Free
🤖
The agent spends your credits. Tools that cost credits say so, and a call you can't afford fails with 402 before anything is charged. For agents you don't fully trust, use a separate key on an account with a small balance.

Credits

The API uses the same credit balance as the app. Plans and top-ups are on the pricing page.

ActionCost
Filter values, counts, browsing masked leadsFree
Reveal a lead (reveal or export)1 credit per new lead. Leads you already have are free
AI enrichment: standard field1 credit per filled cell
AI enrichment: custom_* copy field2 credits per filled cell
full_email (with opener or subject lines)Free
ICP score, single company1 credit
Domain scrape1 credit per domain read. Unreadable domains refunded
Empty enrichment cells and unreadable domains are refunded when a job settles. A request you can't afford fails with 402 before anything is charged.

Retired endpoints

These return 410 ENDPOINT_RETIRED with a pointer to their replacement.

EndpointUse instead
POST /api/v1/find-email/leads/browse + /leads/reveal
POST /api/v1/find-phoneNot offered through the API
POST /api/v1/enrich/leads/reveal for contact data, /enrich-csv for AI enrichment
GET /api/v1/providersRemoved
GET /api/v1/enrich/{id} still returns results for jobs created before retirement.

OpenAPI spec

Machine-readable spec for client generators and agent frameworks.

URL
https://app.leadsonar.io/api/openapi.json