SDKs // TypeScript // Resources
client.search
Last verified
Use client.search in the Reverse Contact TypeScript SDK for people and company searches, free counts, filter catalogs and bounded result pagination.
Search people and companies, count matches, and set a limit on the paid results you retrieve.
| Method | Endpoint | Cost |
|---|---|---|
client.search.people() | People search | 1 credit per profile delivered. A page with no profile is free. |
client.search.peopleByPrompt() | Agentic Search | 1 credit per page for the search, plus 1 credit per profile delivered. |
client.search.peopleLookalike() | People lookalike | 1 credit per profile delivered. A page with no profile is free. |
client.search.countPeople() | People search count | Free. |
client.search.peopleAutoSuggestion() | People auto-suggestion | Free. |
client.search.organizations() | Company search | 1 credit per company delivered. A page with no company is free. |
client.search.organizationsByPrompt() | Agentic Company Search | 1 credit per page for the search, plus 1 credit per company delivered. |
client.search.countOrganizations() | Company search count | Free. |
client.search.peopleFields() | People search available fields | Free. |
client.search.organizationsFields() | Company search available fields | Free. |
client.search.iterPeople() | People search | 1 credit per profile delivered. A page with no profile is free. |
client.search.iterPeopleByPrompt() | Agentic Search | 1 credit per page for the search, plus 1 credit per profile delivered. |
client.search.iterPeopleLookalike() | People lookalike | 1 credit per profile delivered. A page with no profile is free. |
client.search.iterOrganizations() | Company search | 1 credit per company delivered. A page with no company is free. |
client.search.iterOrganizationsByPrompt() | Agentic Company Search | 1 credit per page for the search, plus 1 credit per company delivered. |
Create client by following Install and configure. The @reverse-contact/sdk package exports Body, Data, Query and the other types used in the signatures.
JSON responses contain data and optional quotas and metadata. They also include the original response, with its body already read. See First call for response handling.
HTTP errors use the APIError subclasses and retry rules: BadRequestError, AuthenticationError, InsufficientCreditsError, PermissionDeniedError, NotFoundError, ConflictError, GoneError, UnprocessableEntityError, RateLimitError, DailyLimitError, KeyCreditLimitError, UnavailableForLegalReasonsError and InternalServerError, according to the API response. Other statuses use APIError.
Page methods return a Page with the items in data and the next page identified by nextCursor. Use hasNextPage() to check the cursor. Call getNextPage() to request that page, or get null when there is no next page. Prompt pages also expose interpretation. See Search within a budget.
people()
Provide at least one search filter. Pagination alone is not a filter.
Signature
client.search.people(
params: Omit<Body<"searchPeople">, "perPage"> & { perPage?: number },
options?: RequestOptions
): Promise<Page<Data<"searchPeople">["data"][number], undefined>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchPeople">, "perPage"> & { perPage?: number } | At least one search filter. See People search for every filter and its nested fields. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page |
params.perPage | number | Profiles per page (1 to 100, default 25) |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A Page with results in data and pagination through nextCursor, hasNextPage() and getNextPage(). The page also includes optional quotas and metadata, and the original response.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const page = await client.search.people({ firstName: "Jane", perPage: 10 });
for (const person of page.data) console.log(person.firstName);peopleByPrompt()
Signature
client.search.peopleByPrompt(
params: Omit<Body<"searchPeopleByPrompt">, "perPage"> & { perPage?: number },
options?: RequestOptions
): Promise<Page<Data<"searchPeopleByPrompt">["data"][number], Data<"searchPeopleByPrompt">["interpretation"]>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchPeopleByPrompt">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page with the same prompt |
params.prompt required | string | Plain-language description of the people to find, in any language. At least 3 characters and at most 1000 tokens |
params.perPage | number | Profiles per page (1 to 100, default 25) |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A Page with results in data and pagination through nextCursor, hasNextPage() and getNextPage(). The page also includes optional quotas and metadata, and the original response. interpretation contains the filters extracted from the prompt.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const page = await client.search.peopleByPrompt({ prompt: "Software founders in Paris", perPage: 10 });
console.log(page.interpretation, page.data);peopleLookalike()
Provide exactly one seed, url or id. The API rejects additional search filters. The seed must already be in the search index.
Signature
client.search.peopleLookalike(
params: Omit<Body<"searchPeopleLookalike">, "perPage"> & { perPage?: number },
options?: RequestOptions
): Promise<Page<Data<"searchPeopleLookalike">["data"][number], undefined>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchPeopleLookalike">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.url conditional | string | Public Social profile URL of the seed (e.g. https://social.com/in/janedoe). Required unless id is given. |
params.id conditional | string | Reverse Contact person id of the seed (e.g. prs_01jbd5vewyenebxgaz869ffe5t), as returned in the id field of any person response. Required unless url is given. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page |
params.perPage | number | Profiles per page (1 to 100, default 25) |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A Page with results in data and pagination through nextCursor, hasNextPage() and getNextPage(). The page also includes optional quotas and metadata, and the original response.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. A seed absent from the search index raises NotFoundError, rather than returning null.
Example
Example
const page = await client.search.peopleLookalike({ url: "https://social.com/in/janedoe", perPage: 10 });
console.log(page.data);countPeople()
Provide at least one search filter. Count before requesting paid profiles.
Signature
client.search.countPeople(
params: Body<"countPeople">,
options?: RequestOptions
): Promise<Result<Data<"countPeople">>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Body<"countPeople"> | At least one search filter. See People search count for every filter and its nested fields. |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A response envelope with the free match count in data.count.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const result = await client.search.countPeople({ firstName: "Jane" });
console.log("Matches:", result.data.count);peopleAutoSuggestion()
Signature
client.search.peopleAutoSuggestion(
params: Body<"searchPeopleAutoSuggestion">,
options?: RequestOptions
): Promise<Result<Data<"searchPeopleAutoSuggestion">>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Body<"searchPeopleAutoSuggestion"> | Request body. See the fields and their requirements below. |
params.field required | "skills" | The filter to complete. skills is the only value today |
params.query required | string | Text entered so far, 1 to 100 characters. Case and accents are ignored |
params.limit | number | Maximum values returned, from 1 to 25. Defaults to 10 |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A response with suggested skill values in data. The response contains no profiles.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const result = await client.search.peopleAutoSuggestion({ field: "skills", query: "machine l", limit: 10 });
console.log(result.data);organizations()
Provide at least one search filter. Pagination alone is not a filter.
Signature
client.search.organizations(
params: Omit<Body<"searchOrganizations">, "perPage"> & { perPage?: number },
options?: RequestOptions
): Promise<Page<Data<"searchOrganizations">["data"][number], undefined>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchOrganizations">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.companyDomain | string | Filter by website domain (e.g. acme.com). Disposable domains are rejected with 422 |
params.companyName | string | Filter by company name |
params.followersCount | Body<"searchOrganizations">["followersCount"] | Filter accepted by Company search. |
params.location | string | string[] | Filter accepted by Company search. |
params.maxDataAgeDate | string | ISO 8601 datetime. Only returns companies refreshed after this date. Needs at least one other filter |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page |
params.industry | string | string[] | Industry, or array of industries: a company matches if its industry is any of them. See Industry values for the full list |
params.specialities | string | string[] | Speciality, or array of specialities: a company matches if it lists any of them. See Specialities |
params.employeeCountRange | Body<"searchOrganizations">["employeeCountRange"] | Filter accepted by Company search. |
params.foundedYear | Body<"searchOrganizations">["foundedYear"] | Filter accepted by Company search. |
params.perPage | number | Companies per page (1 to 100, default 25) |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A Page with results in data and pagination through nextCursor, hasNextPage() and getNextPage(). The page also includes optional quotas and metadata, and the original response.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const page = await client.search.organizations({ companyName: "Acme", perPage: 10 });
console.log(page.data);organizationsByPrompt()
Signature
client.search.organizationsByPrompt(
params: Omit<Body<"searchOrganizationsByPrompt">, "perPage"> & { perPage?: number },
options?: RequestOptions
): Promise<Page<Data<"searchOrganizationsByPrompt">["data"][number], Data<"searchOrganizationsByPrompt">["interpretation"]>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchOrganizationsByPrompt">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page with the same prompt |
params.prompt required | string | Plain-language description of the companies to find, in any language. At least 3 characters and at most 1000 tokens |
params.perPage | number | Companies per page (1 to 100, default 25) |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A Page with results in data and pagination through nextCursor, hasNextPage() and getNextPage(). The page also includes optional quotas and metadata, and the original response. interpretation contains the filters extracted from the prompt.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const page = await client.search.organizationsByPrompt({ prompt: "Software companies in France", perPage: 10 });
console.log(page.interpretation, page.data);countOrganizations()
Provide at least one search filter. Counting companies is free.
Signature
client.search.countOrganizations(
params: Body<"countOrganizations">,
options?: RequestOptions
): Promise<Result<Data<"countOrganizations">>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Body<"countOrganizations"> | Request body. See the fields and their requirements below. |
params.companyName | string | Filter accepted by Company search count. |
params.companyDomain | string | Filter accepted by Company search count. |
params.industry | string | string[] | Filter accepted by Company search count. |
params.specialities | string | string[] | Filter accepted by Company search count. |
params.employeeCountRange | Body<"countOrganizations">["employeeCountRange"] | Filter accepted by Company search count. |
params.foundedYear | Body<"countOrganizations">["foundedYear"] | Filter accepted by Company search count. |
params.followersCount | Body<"countOrganizations">["followersCount"] | Filter accepted by Company search count. |
params.location | string | string[] | Filter accepted by Company search count. |
params.maxDataAgeDate | string | Filter accepted by Company search count. |
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A response envelope with the free match count in data.count.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const result = await client.search.countOrganizations({ companyName: "Acme" });
console.log("Matches:", result.data.count);peopleFields()
Signature
client.search.peopleFields(
options?: RequestOptions
): Promise<Result<Data<"searchPeopleAvailableFields">>>Parameters
| Name | Type | Description |
|---|---|---|
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A response envelope with the available people search filters in data.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const result = await client.search.peopleFields();
console.log(result.data);organizationsFields()
Signature
client.search.organizationsFields(
options?: RequestOptions
): Promise<Result<Data<"searchOrganizationsAvailableFields">>>Parameters
| Name | Type | Description |
|---|---|---|
options | RequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. |
Returns
A response envelope with the available company search filters in data.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response.
Example
Example
const result = await client.search.organizationsFields();
console.log(result.data);iterPeople()
Use the same input as people(). Set maxResults to cap the results. With maxResults: 0, the iterator sends no request.
Signature
client.search.iterPeople(
params: Omit<Body<"searchPeople">, "perPage"> & { perPage?: number },
options: SearchIteratorOptions
): AsyncGenerator<Data<"searchPeople">["data"][number], void, unknown>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchPeople">, "perPage"> & { perPage?: number } | At least one search filter. See People search for every filter and its nested fields. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page |
params.perPage | number | Profiles per page (1 to 100, default 25) |
options required | SearchIteratorOptions | Required maxResults, a nonnegative safe integer. Also accepts request options. |
Returns
An AsyncGenerator of individual results. The iterator requests pages as needed. A repeated cursor raises ReverseContactError.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. ReverseContactError also reports invalid perPage or maxResults values and repeated cursors.
Example
Example
for await (const result of client.search.iterPeople(
{ firstName: "Jane" },
{ maxResults: 20 }
)) {
console.log(result);
}iterPeopleByPrompt()
Use the same input as peopleByPrompt(). Set maxResults to cap the results. Prompt searches also charge per page. With maxResults: 0, the iterator sends no request.
Signature
client.search.iterPeopleByPrompt(
params: Omit<Body<"searchPeopleByPrompt">, "perPage"> & { perPage?: number },
options: SearchIteratorOptions
): AsyncGenerator<Data<"searchPeopleByPrompt">["data"][number], void, unknown>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchPeopleByPrompt">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page with the same prompt |
params.prompt required | string | Plain-language description of the people to find, in any language. At least 3 characters and at most 1000 tokens |
params.perPage | number | Profiles per page (1 to 100, default 25) |
options required | SearchIteratorOptions | Required maxResults, a nonnegative safe integer. Also accepts request options. |
Returns
An AsyncGenerator of individual results. The iterator requests pages as needed. A repeated cursor raises ReverseContactError.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. ReverseContactError also reports invalid perPage or maxResults values and repeated cursors.
Example
Example
for await (const result of client.search.iterPeopleByPrompt(
{ prompt: "Software founders in Paris" },
{ maxResults: 20 }
)) {
console.log(result);
}iterPeopleLookalike()
Use the same input as peopleLookalike(). Set maxResults to cap the results. With maxResults: 0, the iterator sends no request.
Signature
client.search.iterPeopleLookalike(
params: Omit<Body<"searchPeopleLookalike">, "perPage"> & { perPage?: number },
options: SearchIteratorOptions
): AsyncGenerator<Data<"searchPeopleLookalike">["data"][number], void, unknown>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchPeopleLookalike">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.url conditional | string | Public Social profile URL of the seed (e.g. https://social.com/in/janedoe). Required unless id is given. |
params.id conditional | string | Reverse Contact person id of the seed (e.g. prs_01jbd5vewyenebxgaz869ffe5t), as returned in the id field of any person response. Required unless url is given. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page |
params.perPage | number | Profiles per page (1 to 100, default 25) |
options required | SearchIteratorOptions | Required maxResults, a nonnegative safe integer. Also accepts request options. |
Returns
An AsyncGenerator of individual results. The iterator requests pages as needed. A repeated cursor raises ReverseContactError.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. ReverseContactError also reports invalid perPage or maxResults values and repeated cursors. A seed absent from the search index raises NotFoundError, rather than returning null.
Example
Example
for await (const result of client.search.iterPeopleLookalike(
{ url: "https://social.com/in/janedoe" },
{ maxResults: 20 }
)) {
console.log(result);
}iterOrganizations()
Use the same input as organizations(). Set maxResults to cap the results. With maxResults: 0, the iterator sends no request.
Signature
client.search.iterOrganizations(
params: Omit<Body<"searchOrganizations">, "perPage"> & { perPage?: number },
options: SearchIteratorOptions
): AsyncGenerator<Data<"searchOrganizations">["data"][number], void, unknown>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchOrganizations">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.companyDomain | string | Filter by website domain (e.g. acme.com). Disposable domains are rejected with 422 |
params.companyName | string | Filter by company name |
params.followersCount | Body<"searchOrganizations">["followersCount"] | Filter accepted by Company search. |
params.location | string | string[] | Filter accepted by Company search. |
params.maxDataAgeDate | string | ISO 8601 datetime. Only returns companies refreshed after this date. Needs at least one other filter |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page |
params.industry | string | string[] | Industry, or array of industries: a company matches if its industry is any of them. See Industry values for the full list |
params.specialities | string | string[] | Speciality, or array of specialities: a company matches if it lists any of them. See Specialities |
params.employeeCountRange | Body<"searchOrganizations">["employeeCountRange"] | Filter accepted by Company search. |
params.foundedYear | Body<"searchOrganizations">["foundedYear"] | Filter accepted by Company search. |
params.perPage | number | Companies per page (1 to 100, default 25) |
options required | SearchIteratorOptions | Required maxResults, a nonnegative safe integer. Also accepts request options. |
Returns
An AsyncGenerator of individual results. The iterator requests pages as needed. A repeated cursor raises ReverseContactError.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. ReverseContactError also reports invalid perPage or maxResults values and repeated cursors.
Example
Example
for await (const result of client.search.iterOrganizations(
{ companyName: "Acme" },
{ maxResults: 20 }
)) {
console.log(result);
}iterOrganizationsByPrompt()
Use the same input as organizationsByPrompt(). Set maxResults to cap the results. Prompt searches also charge per page. With maxResults: 0, the iterator sends no request.
Signature
client.search.iterOrganizationsByPrompt(
params: Omit<Body<"searchOrganizationsByPrompt">, "perPage"> & { perPage?: number },
options: SearchIteratorOptions
): AsyncGenerator<Data<"searchOrganizationsByPrompt">["data"][number], void, unknown>Parameters
| Name | Type | Description |
|---|---|---|
params required | Omit<Body<"searchOrganizationsByPrompt">, "perPage"> & { perPage?: number } | Request body. See the fields and their requirements below. |
params.cursor | string | Opaque cursor from metadata.nextCursor. Use it to request the next page with the same prompt |
params.prompt required | string | Plain-language description of the companies to find, in any language. At least 3 characters and at most 1000 tokens |
params.perPage | number | Companies per page (1 to 100, default 25) |
options required | SearchIteratorOptions | Required maxResults, a nonnegative safe integer. Also accepts request options. |
Returns
An AsyncGenerator of individual results. The iterator requests pages as needed. A repeated cursor raises ReverseContactError.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. ReverseContactError also reports invalid perPage or maxResults values and repeated cursors.
Example
Example
for await (const result of client.search.iterOrganizationsByPrompt(
{ prompt: "Software companies in France" },
{ maxResults: 20 }
)) {
console.log(result);
}Related guides
Search within a budget, Filter values as constants. Return to the TypeScript SDK overview.
FAQ
Which SDK search iterator limits the number of results?
Every search iterator requires maxResults. Use iterPeople, iterPeopleByPrompt, iterPeopleLookalike, iterOrganizations or iterOrganizationsByPrompt.
Can I count people or companies without spending credits?
client.search.countPeople() and client.search.countOrganizations() return free match counts in result.data.count.
What does a prompt search return besides profiles?
A prompt search returns a Page with results in data and the interpreted filters in interpretation. Each requested page adds 1 credit to the per-result cost.