Skip to main content
POST
Count companies matching a search (free)

Authorizations

Authorization
string
header
required

Your API token (af_…) as the Basic-auth username, with an empty password.

Body

application/json

Exactly one filter source, as POST /companies/search takes it: filters, savedSearchId, savedSearchName or query. A count has no paging.

filters
object

Literal filters, one of the four filter sources. Company filters in the search vocabulary: include/exclude fields take [{ status, value, label }] entries (label is required), list fields arrays of strings, ranges { min, max } and date ranges { start, end } — enum vocabularies come from GET /companies/filter-options, names and places from GET /companies/autocomplete. Must contain at least one non-empty value.

savedSearchId
string

Id of one of your COMPANY saved searches to take the filters from instead of filters (a people saved search answers 422 SAVED_SEARCH_TYPE_MISMATCH).

savedSearchName
string

Exact title of one of your company saved searches to take the filters from instead of filters; two searches sharing the title answer 409 SAVED_SEARCH_NAME_AMBIGUOUS.

Required string length: 1 - 255
query
string

Natural-language description of the companies to find (max 2000 chars), converted into filters server-side instead of filters; criteria that could not be mapped come back as unresolvedCriteria, and a query yielding no filter answers 422 QUERY_FILTERS_INVALID.

Required string length: 1 - 2000

Response

Success

status
enum<string>
required

ready (200) with the total, or pending (202) while the count runs: repeat the request.

Available options:
ready,
pending
total
integer | null
required

Companies matching the filters; null while pending.

filters
object
required

The filters counted, in the POST /companies/search vocabulary.

creditsCharged
integer
required

Always 0: counting is free.

unresolvedCriteria
string[]

Only with query: the parts of the sentence no filter could express.