Skip to content

Count leads

POST
/api/v1/leads/search

Cost: Free

Returns counts only and charges nothing. Two totals are reported because they measure different things: structured filters are counted upstream, while titles/keywords/department are applied per row and can only be sampled. Plan exports around estimated_total.

Try it

curl https://app.leadsonar.io/api/v1/leads/search \
  -H "X-API-Key: $LS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobTitles": ["Head of Sales"],
    "exactMatch": true,
    "industry": ["Software Development"],
    "companySize": ["51-200"],
    "country": ["US"]
  }'

Lead Finder filters. Field names ignore case, _ and -, so excludeTitles, exclude_titles and Exclude-Titles are the same field. Older names also work: industryNames, countryCodes / countryCode, seniorities, companySizes, departments, revenues, companyTypes. If two spellings of one field are sent, the one listed here wins. A key that is not a filter is ignored and named in warnings (UNKNOWN_FIELD_IGNORED, with a suggestion).

object
industry
Array<string>
seniority
Array<string>
country

Country as an ISO code or a name (“US”, “United States”). The source is ~99.9% US.

Array<string>
companySize
Array<string>
revenue
Array<string>
department
Array<string>
jobTitles

Free text, whole-word matched against the job title.

Array<string>
includeKeywords

Matched against the company description, not the title.

Array<string>
excludeKeywords
Array<string>
maxPerCompany

Cap contacts per company.

integer
companyType

Company type, derived from each company’s industry (the source has no ownership field). Values OR together. Public (listed) company filtering is not available yet; sending “public” or any other value returns 400 with code COMPANY_TYPE_NOT_AVAILABLE or UNKNOWN_COMPANY_TYPE.

Array<string>
Allowed values: private government nonprofit education
exactMatch

Match jobTitles (and keywords) as whole words. Without it titles match as substrings, so “CFO” can hit unrelated titles. The app always sends true; set it yourself.

boolean
excludeTitles

Drop anyone whose job title contains any of these terms as a whole word, ignoring case, e.g. [“intern”, “assistant”]. “intern” drops “Sales Intern” but not “International Sales Manager”.

Array<string>
Example
{
"jobTitles": ["Head of Sales"],
"exactMatch": true,
"industry": ["Software Development"],
"companySize": ["51-200"],
"country": ["US"]
}

Match counts

object
firmographic_total

Structured filters only (industry, size, country, revenue), counted upstream.

integer
firmographic_is_exact
boolean
estimated_total

After per-row matching (titles, keywords, department, seniority). PLAN EXPORTS AROUND THIS NUMBER.

integer
basis
string
Allowed values: sampled exact
note
string
narrowed_by

Which filter collapsed the result, when one did.

string
nullable
keywords

What each include-keyword cost, per term.

object
filters

The filters as the server understood them — check this when a count looks wrong.

object
key
additional properties
any
warnings

Present when the request succeeded with adjustments. UNKNOWN_FILTER_VALUE_IGNORED: industry/seniority values that matched nothing were left out (ignored lists them with suggestions); the other values in that filter were applied. When EVERY value of a filter is unknown the request fails with 400 UNKNOWN_FILTER_VALUE instead. UNKNOWN_FIELD_IGNORED: body keys that are not filters (usually a misspelling) were ignored, so the search ran without them; fields lists each with the closest accepted name in suggestion.

Array<object>
object
code
string
message
string
ignored
object
key
additional properties
Array<object>
object
value
string
suggestions
Array<string>
fields

UNKNOWN_FIELD_IGNORED only.

Array<object>
object
field
string
suggestion
string
nullable
Example
{
"firmographic_total": 179984,
"firmographic_is_exact": true,
"estimated_total": 607,
"basis": "sampled",
"note": "estimated_total is sampled: keyword/role/department filters are applied per row and cannot be counted upstream. Plan exports around estimated_total.",
"narrowed_by": null,
"keywords": null,
"filters": {
"industryNames": ["Software Development"],
"countryCodes": ["US"],
"companySizes": ["51-200"],
"jobTitles": ["Head of Sales"],
"exactMatch": true,
"matchAny": false
}
}

Lead source unavailable (LEADS_SOURCE_DOWN)

object
error
required

Human-readable error message

string
message

Additional details

string