> Reverse Contact API documentation. This is the Markdown copy of https://docs.reversecontact.com/sdk/javascript/search
> Every page is listed at https://docs.reversecontact.com/llms.txt, every endpoint with its credit cost and status at https://docs.reversecontact.com/catalog.json

# client.search

> Use client.search in the Reverse Contact TypeScript SDK for people and company searches, free counts, filter catalogs and bounded result pagination.

- Last verified: 2026-11-04

Search people and companies, count matches, and set a limit on the paid results you retrieve.

| Method | Endpoint | Cost |
| ------ | -------- | ---- |
| `client.search.people()` | [People search](https://docs.reversecontact.com/endpoints/search-people) | 1 credit per profile delivered. A page with no profile is free. |
| `client.search.peopleByPrompt()` | [Agentic Search](https://docs.reversecontact.com/endpoints/search-people-prompt) | 1 credit per page for the search, plus 1 credit per profile delivered. |
| `client.search.peopleLookalike()` | [People lookalike](https://docs.reversecontact.com/endpoints/search-people-lookalike) | 1 credit per profile delivered. A page with no profile is free. |
| `client.search.countPeople()` | [People search count](https://docs.reversecontact.com/endpoints/search-people-count) | Free. |
| `client.search.peopleAutoSuggestion()` | [People auto-suggestion](https://docs.reversecontact.com/endpoints/search-people-auto-suggestion) | Free. |
| `client.search.organizations()` | [Company search](https://docs.reversecontact.com/endpoints/search-companies) | 1 credit per company delivered. A page with no company is free. |
| `client.search.organizationsByPrompt()` | [Agentic Company Search](https://docs.reversecontact.com/endpoints/search-companies-prompt) | 1 credit per page for the search, plus 1 credit per company delivered. |
| `client.search.countOrganizations()` | [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count) | Free. |
| `client.search.peopleFields()` | [People search available fields](https://docs.reversecontact.com/endpoints/search-people-available-fields) | Free. |
| `client.search.organizationsFields()` | [Company search available fields](https://docs.reversecontact.com/endpoints/search-companies-available-fields) | Free. |
| `client.search.iterPeople()` | [People search](https://docs.reversecontact.com/endpoints/search-people) | 1 credit per profile delivered. A page with no profile is free. |
| `client.search.iterPeopleByPrompt()` | [Agentic Search](https://docs.reversecontact.com/endpoints/search-people-prompt) | 1 credit per page for the search, plus 1 credit per profile delivered. |
| `client.search.iterPeopleLookalike()` | [People lookalike](https://docs.reversecontact.com/endpoints/search-people-lookalike) | 1 credit per profile delivered. A page with no profile is free. |
| `client.search.iterOrganizations()` | [Company search](https://docs.reversecontact.com/endpoints/search-companies) | 1 credit per company delivered. A page with no company is free. |
| `client.search.iterOrganizationsByPrompt()` | [Agentic Company Search](https://docs.reversecontact.com/endpoints/search-companies-prompt) | 1 credit per page for the search, plus 1 credit per company delivered. |

Create `client` by following [Install and configure](https://docs.reversecontact.com/sdk/javascript/install). 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](https://docs.reversecontact.com/sdk/javascript/first-call) for response handling.

HTTP errors use the [APIError subclasses and retry rules](https://docs.reversecontact.com/sdk/javascript/errors-and-retries): `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](https://docs.reversecontact.com/sdk/javascript/search-budget).

## people()

Provide at least one search filter. Pagination alone is not a filter.

**Signature**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/endpoints/search-people) 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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
const page = await client.search.people({ firstName: "Jane", perPage: 10 });
for (const person of page.data) console.log(person.firstName);
```

## peopleByPrompt()

**Signature**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/endpoints/search-people-count) for every filter and its nested fields. |
| `options` | `RequestOptions` | Optional per-request `timeout`, `maxRetries`, `headers` and `signal`. See [Client options](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
const result = await client.search.countPeople({ firstName: "Jane" });
console.log("Matches:", result.data.count);
```

## peopleAutoSuggestion()

**Signature**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/endpoints/search-companies). |
| `params.location` | `string \| string[]` | Filter accepted by [Company search](https://docs.reversecontact.com/endpoints/search-companies). |
| `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](https://docs.reversecontact.com/reference/industries) for the full list |
| `params.specialities` | `string \| string[]` | Speciality, or array of specialities: a company matches if it lists any of them. See [Specialities](https://docs.reversecontact.com/endpoints/search-companies#specialities) |
| `params.employeeCountRange` | `Body<"searchOrganizations">["employeeCountRange"]` | Filter accepted by [Company search](https://docs.reversecontact.com/endpoints/search-companies). |
| `params.foundedYear` | `Body<"searchOrganizations">["foundedYear"]` | Filter accepted by [Company search](https://docs.reversecontact.com/endpoints/search-companies). |
| `params.perPage` | `number` | Companies per page (1 to 100, default `25`) |
| `options` | `RequestOptions` | Optional per-request `timeout`, `maxRetries`, `headers` and `signal`. See [Client options](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
const page = await client.search.organizations({ companyName: "Acme", perPage: 10 });
console.log(page.data);
```

## organizationsByPrompt()

**Signature**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.companyDomain` | `string` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.industry` | `string \| string[]` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.specialities` | `string \| string[]` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.employeeCountRange` | `Body<"countOrganizations">["employeeCountRange"]` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.foundedYear` | `Body<"countOrganizations">["foundedYear"]` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.followersCount` | `Body<"countOrganizations">["followersCount"]` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.location` | `string \| string[]` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `params.maxDataAgeDate` | `string` | Filter accepted by [Company search count](https://docs.reversecontact.com/endpoints/search-companies-count). |
| `options` | `RequestOptions` | Optional per-request `timeout`, `maxRetries`, `headers` and `signal`. See [Client options](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
const result = await client.search.countOrganizations({ companyName: "Acme" });
console.log("Matches:", result.data.count);
```

## peopleFields()

**Signature**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
const result = await client.search.peopleFields();
console.log(result.data);
```

## organizationsFields()

**Signature**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/sdk/javascript/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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/endpoints/search-people) 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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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](https://docs.reversecontact.com/endpoints/search-companies). |
| `params.location` | `string \| string[]` | Filter accepted by [Company search](https://docs.reversecontact.com/endpoints/search-companies). |
| `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](https://docs.reversecontact.com/reference/industries) for the full list |
| `params.specialities` | `string \| string[]` | Speciality, or array of specialities: a company matches if it lists any of them. See [Specialities](https://docs.reversecontact.com/endpoints/search-companies#specialities) |
| `params.employeeCountRange` | `Body<"searchOrganizations">["employeeCountRange"]` | Filter accepted by [Company search](https://docs.reversecontact.com/endpoints/search-companies). |
| `params.foundedYear` | `Body<"searchOrganizations">["foundedYear"]` | Filter accepted by [Company search](https://docs.reversecontact.com/endpoints/search-companies). |
| `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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
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**

```typescript [TypeScript SDK]
for await (const result of client.search.iterOrganizationsByPrompt(
  { prompt: "Software companies in France" },
  { maxResults: 20 }
)) {
  console.log(result);
}
```

## Related guides

[Search within a budget](https://docs.reversecontact.com/sdk/javascript/search-budget), [Filter values as constants](https://docs.reversecontact.com/sdk/javascript/filter-constants). Return to the [TypeScript SDK overview](https://docs.reversecontact.com/sdk/javascript).

## 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.
