Skip to content

MaintenanceThe former company search endpoint goes into maintenance on November 9Migration guide

SDKs // TypeScript // Guides

Filter values as constants

Last verified

Use typed industry, country, seniority and other filter constants in the Reverse Contact TypeScript SDK while accepting newly published values.

Use exported constants to autocomplete search filter values in your editor.

Use filter constants

From version 0.1.6, the SDK exports constants for fixed filter lists: Industry, CountryCode, JobFunction, JobSubFunction, Seniority, ContractType, Area and EmailType. Each constant holds the filter value itself. For example, Industry.SOFTWARE_DEVELOPMENT is "Software Development".

Your editor autocompletes the values for each filter. A constant's name is its value in capitals, with _ for spaces and punctuation and AND for &. Examples include Seniority.OWNER_FOUNDER, Area.MC_DACH and ContractType.FULL_TIME.

TypeScript SDK

Filter with constants

import ReverseContact, { Area, Industry, Seniority } from "@reverse-contact/sdk";

const client = new ReverseContact({ apiKey: process.env.RC_API_KEY });

const count = await client.search.countPeople({
  currentCompanyIndustry: Industry.SOFTWARE_DEVELOPMENT,
  currentSeniority: [Seniority.CXO, Seniority.OWNER_FOUNDER],
  location: { area: Area.MC_DACH }
});
console.log("Matches:", count.data.count);

Filters also accept strings, so you can use newly added values without updating the SDK. The API returns HTTP 422 for an unknown value and charges 0 credits.

See client.search for the search and count methods, Search within a budget for pagination, and the industry reference for industry values.

Return to the TypeScript SDK overview.

FAQ

Which filter constants does the TypeScript SDK export?

The SDK exports Industry, CountryCode, JobFunction, JobSubFunction, Seniority, ContractType, Area and EmailType for fixed filter lists.

Can I use a new filter value before updating the SDK?

Filter types also accept strings, so newly published API values work without updating the SDK. The API validates those values.

What happens if a filter value is invalid?

The API returns HTTP 422 for an unknown filter value and charges 0 credits. Use a supported constant or a value from the relevant API reference.