Skip to main content
POST
Discover persons using natural language

How It Works

Describe who you’re looking for in plain English. The API translates your query into SQL and returns matching profiles. 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 Person Search with SQL syntax instead.

People Like One Person

Ask for people like someone by their LinkedIn URL, email or legion_id, alone or with the rest of the query:
Results are people in a similar role at similar employers, ranked by how closely their profile reads like the person’s, who is left out; their colleagues are included unless the query leaves the employer out. A role, industry or place the query names takes the place of the person’s own. A name alone is never used: give an identifier. The response carries a Search-Warning header saying the results are ranked by likeness. Page with offset; these results have no next_cursor, and an offset past the last result answers 400 offset_past_end.

New Hires

A query for new hires at a named employer (“people who joined Stripe in the last 6 months”) answers with a Search-Warning header: job changes reach the data four to six weeks after they happen, so the most recent weeks are still filling in. The first page carries it; pages fetched by cursor do not.

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. A city that also exists in the United States is read as the US one when you name its state: product managers in Cambridge, Massachusetts. A query that asks for nothing else (people with a home phone number) 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 (nurses in Cañon City, Colorado); 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 location data, so Discover cannot filter on a place (state_code). Leave the location out of the query and try again.” For any other field: “Your contract does not include the is_decision_maker 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 Person Discover (plain-English search).

query
string
required

Natural language description of who 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 - persons found matching natural language query.

Person Discover response.

matches
PersonMatchResponse · object[]
required

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

total
integer
required

For /person/search and /person/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.