Skip to content

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

SDKs // Python // Resources

client.enrich

Last verified

Look up people and companies with client.enrich in the Python SDK, including every method, input, typed return value, error and credit cost.

Find a person from identifying details or a company from its domain.

MethodEndpointCost
person()POST /v2/enrich/persons2 credits when a person is found, full profile included. A 404 is free.
company()POST /v2/enrich/companies2 credits when a company is found, full profile included. A 404 is free.

Calling conventions

Examples assume RC_API_KEY is set. Replace example ids with ids returned by your own requests. Signatures show the published 0.3.0 synchronous methods. Use the same arguments with the Python async client.

models refers to reversecontact.types. NOT_GIVEN and NotGiven are the SDK's internal markers for omitted arguments. Leave these arguments out of your calls. For API body parameters, passing None sends an explicit null. Transport options use None to inherit their defaults. Timeout means a number of seconds or httpx.Timeout. Supply parameters marked Required to Python or to the API, even when the generated signature permits omission.

JSON response objects expose data, quotas, metadata and http_response. Check optional fields for None. See First call for the response envelope. CSV methods return text and iterators yield items.

HTTP failures raise an APIError subclass based on the response: BadRequestError, AuthenticationError, InsufficientCreditsError, PermissionDeniedError, NotFoundError, ConflictError, GoneError, UnprocessableEntityError, RateLimitError, DailyLimitError, KeyCreditLimitError, UnavailableForLegalReasonsError or InternalServerError. See the error mapping and retry rules.

person

Provide at least one of email, first_name, last_name, company_domain or company_name. Inputs are independent. full_profile remains accepted but is deprecated and ignored by the API.

Python SDK

Python SDK

def person(
    *,
    email: str | NotGiven | None = NOT_GIVEN,
    first_name: str | NotGiven | None = NOT_GIVEN,
    last_name: str | NotGiven | None = NOT_GIVEN,
    company_domain: str | NotGiven | None = NOT_GIVEN,
    company_name: str | NotGiven | None = NOT_GIVEN,
    full_profile: bool | NotGiven | None = NOT_GIVEN,
    timeout: Timeout | None = None,
    max_retries: int | None = None,
    headers: Mapping[str, str] | None = None,
    **extra: object,
) -> Result[models.EnrichPersonData] | None: ...

Parameters

NameTypeDescription
emailstr | NotGiven | NoneOptional. Professional email address to look up (e.g. jane.doe@acme.com).
first_namestr | NotGiven | NoneOptional. First name of the person to look up.
last_namestr | NotGiven | NoneOptional. Last name of the person to look up.
company_domainstr | NotGiven | NoneOptional. Company domain to help disambiguate (e.g. acme.com or https://acme.com).
company_namestr | NotGiven | NoneOptional. Company name to help disambiguate (e.g. Acme Corp).
full_profilebool | NotGiven | NoneOptional. Deprecated and ignored. Enrich always returns the full profile at the same cost. You can remove this field, though the API still accepts it so existing requests keep working.
timeoutTimeout | NoneOptional. Seconds per HTTP attempt, or httpx.Timeout. Uses the client setting when None.
max_retriesint | NoneOptional. Retries after the first HTTP attempt. Uses the client setting when None.
headersMapping[str, str] | NoneOptional. Additional HTTP headers for this call.
**extraobjectOptional. Additional API keyword arguments, including camelCase aliases, passed through to the API.

Returns

Result[models.EnrichPersonData] | None. data.person is the matched person. data.alternative_persons contains other candidates, and data.is_full_profile identifies the profile shape. A no-match lookup returns None at no credit cost.

Errors

APIError subclasses follow the HTTP mapping above. APIConnectionError reports transport failures. APITimeoutError reports timed-out attempts. ReverseContactError covers invalid SDK options. No-match 404 responses return None. Other 404 responses raise NotFoundError. Malformed typed response data can raise Pydantic ValidationError.

Example

Python SDK

Python SDK

from reversecontact import ReverseContact

with ReverseContact() as client:
    result = client.enrich.person(email="jane.doe@acme.com")
    print(result.data if result is not None else None)

company

Provide domain. The API requires this field even though the generated Python signature permits omission. full_profile is deprecated and ignored.

Python SDK

Python SDK

def company(
    *,
    domain: str | NotGiven | None = NOT_GIVEN,
    full_profile: bool | NotGiven | None = NOT_GIVEN,
    timeout: Timeout | None = None,
    max_retries: int | None = None,
    headers: Mapping[str, str] | None = None,
    **extra: object,
) -> Result[models.EnrichCompanyData] | None: ...

Parameters

NameTypeDescription
domainstr | NotGiven | NoneRequired. Company domain to look up. A bare domain or a full URL works (e.g. acme.com or https://acme.com).
full_profilebool | NotGiven | NoneOptional. Deprecated and ignored. Enrich always returns the full profile at the same cost. You can remove this field, though the API still accepts it so existing requests keep working.
timeoutTimeout | NoneOptional. Seconds per HTTP attempt, or httpx.Timeout. Uses the client setting when None.
max_retriesint | NoneOptional. Retries after the first HTTP attempt. Uses the client setting when None.
headersMapping[str, str] | NoneOptional. Additional HTTP headers for this call.
**extraobjectOptional. Additional API keyword arguments, including camelCase aliases, passed through to the API.

Returns

Result[models.EnrichCompanyData] | None. data.company is the matched company and data.is_full_profile identifies the profile shape. A no-match lookup returns None at no credit cost.

Errors

APIError subclasses follow the HTTP mapping above. APIConnectionError reports transport failures. APITimeoutError reports timed-out attempts. ReverseContactError covers invalid SDK options. No-match 404 responses return None. Other 404 responses raise NotFoundError. Malformed typed response data can raise Pydantic ValidationError.

Example

Python SDK

Python SDK

from reversecontact import ReverseContact

with ReverseContact() as client:
    result = client.enrich.company(domain="acme.com")
    print(result.data if result is not None else None)

See the Python SDK overview for setup and First call for an example. Use Fetch when you already have a profile URL or id.

FAQ

What does client.enrich return when nothing matches?

client.enrich.person() and client.enrich.company() return None for a no-match lookup. A no-match lookup costs no credits.

Is full_profile required for Python enrichment?

full_profile is accepted by the Python SDK but deprecated and ignored by the API. Enrichment includes the full profile at the same 2-credit match price.

Where is the enriched person in the Python response?

The enriched person is in result.data.person. The enriched company is in result.data.company. Check the response and nested fields for None before reading them.