Skip to main content
POST
Discover companies using natural language

How It Works

Describe what companies you’re looking for in plain English. The API translates your query into SQL and returns matching companies. We treat the query as yours. A query that asks for nothing to find, that tells the search how to behave instead of what to find, that is written in another script, or that needs a field your contract does not include answers 400 and is not billed (see Refused Queries). If your product passes along text from its users or from documents, check it first: the refusal check is not a filter for injected text.

Example Queries

For precise control over filtering, use Company Search with SQL syntax instead.

A Company’s Name on Its Own

A query that is only a company’s name, such as Apple, Goldman Sachs or Home Depot, returns that company: every record with its website domain, largest first. A phrase that names a kind of company, such as Fintech or Renewable Energy, is searched as that kind. To search for companies like a named one, say so: companies like Stripe.

What Cannot Be Filtered On

A query can ask for something the data has no filter for. The API names it instead of answering as if it had applied it: The request answers 400 with error unsupported_filter, and nothing is billed:
Rephrase the query without that part. Companies like or competing with a named company are searched by that company’s industry and size. A query that asks for nothing else (profitable companies) answers the same 400, and its message says the query names nothing else to search on.

Refused Queries

These queries answer 400 without running a search, and nothing is billed:
For instructions_in_query the message reads: “This query reads as instructions to the search itself. Say only who or what you are looking for, including anything to leave out of the results.” For not_in_latin_letters the message reads: “Write the query in English, in Latin letters: Discover reads the places, names and other details it filters on in English.” Accented letters are fine (software companies in Montréal); a query in another script (software engineers в Остине) answers not_in_latin_letters. For field_not_in_contract the message names what to leave out, and details.fields names the field: “Your contract does not include the linkedin_employee_count field, so Discover cannot filter on it. Leave that part out of the query and try again.”

Pagination

Page with a cursor. A page with more results after it carries next_cursor; send it back as cursor, without offset, with the same query. Every page belongs to the same search, and paging can go past 10,000 results. On the last page next_cursor is null.
A cursor belongs to one query on one dataset build. A cursor sent with different query text, or from before a new build, returns a 400 saying so: start again from the first page. offset (up to 10,000) also works, but each request with an offset reads your query again, so pages can overlap or skip records. For anything past the first page, use the cursor.

Authorizations

API-Key
string
header
required

Body

application/json

Request model for Company Discover (plain-English search).

query
string
required

Natural language description of companies you're looking for

Required string length: 3 - 1000
limit
integer
default:1

Maximum number of results to return (default 1, max 100).

Required range: 1 <= x <= 100
offset
integer
default:0

Number of results to skip (0-10000). Each request with an offset reads the query again and may word the search differently, so pages can overlap or skip records: page with cursor instead.

Required range: 0 <= x <= 10000
cursor
string | null

Continue from the previous page's next_cursor: the next page of the same search, without asking the model again (it may word the same query differently), and past offset's 10,000-row reach. Send the same query, and no offset, in a POST body (a long cursor won't fit in a GET's URL). A cursor works for the dataset build it came from.

Maximum string length: 65536
titlecase
boolean
default:false

If true, format text fields in title case (names, company names, locations). Raw fields, IDs, URLs, codes, and confidence fields are excluded.

include_fields
string | null

Comma-separated list of fields to include in response. If omitted, all fields are returned.

exclude_fields
string | null

Comma-separated list of fields to exclude from response. Applied after include_fields filter.

pretty_print
boolean
default:false

If true, pretty-print JSON response with indentation.

Response

Success - companies found matching natural language query.

Company Discover response.

matches
CompanyMatchResponse · object[]
required

List of matches sorted by confidence (descending). Capped at the request's limit.

total
integer
required

For /company/search and /company/discover, the total number of rows matching the query's WHERE clause across the database (not just this page). On search/discover, if the exact count exceeds its time budget (broad, low-selectivity queries) it falls back to the matches counted before the budget ran out (a lower bound), and if that does not cover this page, to the offset plus the rows returned; the response header Total-Count-Status reports which (exact, estimate, or page).

next_cursor
string | null

The cursor for the next page when more results follow: send it as cursor, with the same query (on Discover it reruns the same search). Null on the last page.