SDKs // Python // Get started
Python SDK
Last verified
Use the official Reverse Contact Python SDK to enrich profiles, search within a budget, manage Lists and Bulk jobs, and wait for async results.
Introduction
reversecontact is the official Python client for the Reverse Contact API. You can call every API endpoint with typed models. The SDK handles safe retries, waits for asynchronous jobs, and pages through search results within a budget you set. Choose the synchronous client, ReverseContact, or the asynchronous client, AsyncReverseContact. Both have the same methods.
- Package: reversecontact on PyPI
- Source code and issues: github.com/visum-run/reversecontact-python
- License: Apache-2.0
The SDK needs Python 3.11 or later. These pages document reversecontact 0.3.0.
Install
Install
pip install reversecontactAPI key
Set RC_API_KEY or pass api_key to the client. Keep the key server-side. Follow Install and configure to set up your client.
First call
This lookup costs 2 credits when a person is found and nothing when no profile matches. With RC_API_KEY set:
Python SDK
from reversecontact import ReverseContact
with ReverseContact() as client:
result = client.enrich.person(email="jane.doe@acme.com")
if result is None:
print("No confident match: nothing was charged")
elif result.data and result.data.person:
print(result.data.person.first_name, result.data.person.last_name)First call explains the response fields, credit usage and request ids.
Endpoints and methods
| Endpoint | Method |
|---|---|
| Enrich profile | client.enrich.person() |
| Enrich company | client.enrich.company() |
| Person profile | client.fetch.person() |
| Person profile live | client.fetch.person_live() |
| Person profile status | client.fetch.check_person() |
| Company profile | client.fetch.company() |
| Company profile live | client.fetch.company_live() |
| Company profile status | client.fetch.check_company() |
| People search | client.search.people(), client.search.iter_people() |
| Agentic Search | client.search.people_by_prompt(), client.search.iter_people_by_prompt() |
| People lookalike | client.search.people_lookalike(), client.search.iter_people_lookalike() |
| People search count | client.search.count_people() |
| People auto-suggestion | client.search.people_auto_suggestion() |
| People search available fields | client.search.people_fields() |
| Company search | client.search.organizations(), client.search.iter_organizations() |
| Agentic Company Search | client.search.organizations_by_prompt(), client.search.iter_organizations_by_prompt() |
| Company search count | client.search.count_organizations() |
| Company search available fields | client.search.organizations_fields() |
| Find Email | client.contact.find_email() |
| Verify Email | client.contact.verify_email() |
| Find Phone | client.contact.find_phone() |
| All Lists | client.lists.list(), client.lists.list_all() |
| Create a List | client.lists.create() |
| Get a List | client.lists.retrieve() |
| Delete a List | client.lists.delete() |
| List members | client.lists.members.list(), client.lists.members.list_all() |
| Add members | client.lists.members.add() |
| Remove members | client.lists.members.remove() |
| Import members and data | client.lists.import_signals() |
| Read a List operation | client.lists.operations.retrieve(), client.lists.operations.wait() |
| Cancel a List operation | client.lists.operations.cancel() |
| Export a List | client.lists.export() |
| Bulk enrichment | client.bulk.enrich_persons() |
| Job history | client.bulk.list(), client.bulk.list_all() |
| Get a job | client.bulk.retrieve(), client.bulk.wait() |
| Download job results | client.bulk.results() |
| Read job results by page | client.bulk.rows(), client.bulk.iter_rows() |
| Cancel a job | client.bulk.cancel() |
| Polling a job | client.jobs.retrieve(), client.jobs.wait() |
| Usage | client.usage.retrieve() |
Each endpoint page shows its call in the Python SDK tab of its code examples. For now, the List and Bulk enrichment examples are in Lists and Bulk enrichment instead.
Where to go next
- Install and configure
- First call
- client.enrich
- client.fetch
- client.search
- client.contact
- client.lists
- client.bulk
- client.jobs
- client.usage
- Async client
- Async jobs
- Lists and Bulk enrichment
- Search within a budget
- Filter values as constants
- Errors and retries
- Timeouts and cancellation
- Client options
- Without the SDK
Async client
Use AsyncReverseContact with await and async for, as shown in Async client.
Lookups that find nothing
Enrich and cached Fetch return None when no profile matches, at no credit cost. See how to handle lookups that find nothing.
Async jobs: live fetch, Find Email and Find Phone
Save job.id, then call job.wait() to poll for free. The default deadline is 30 minutes. Failed jobs raise JobFailedError. See the examples in Async jobs: live fetch, Find Email and Find Phone.
Webhook delivery instead of polling
Pass webhook_url and parse callbacks with parse_webhook_delivery, as shown in Webhook delivery.
Lists and Bulk enrichment
Lists and Bulk enrichment shows how to manage persistent Lists, run Bulk jobs, and read their results as they come or export them.
Search within a budget
Count for free, then cap paid results with the search iterator's required max_results argument. Follow the example in Search within a budget.
Filter values as constants
Use string enums for fixed search values or pass plain strings.
Errors and retries
The SDK retries per-minute rate limits and HTTP 500, 502, 503 and 504 up to four times. Daily limits, key credit limits, insufficient credits and other 4xx responses are not retried, except contact 409 IDEMPOTENCY_KEY_IN_USE. Read Errors and retries.
Safe retries on Find Email and Find Phone
Contact methods generate idempotency keys and reuse them on retries. See how this makes retries safe on Find Email and Find Phone.
Timeouts and cancellation
Timeouts and cancellation covers per-request timeouts, overall polling deadlines and cancelling local asyncio waits.
Client options
Configure connection pools, defaults and logging with Client options.
Without the SDK
To use an HTTPS client and the published OpenAPI specification, see Without the SDK.
FAQ
Is there an official Reverse Contact SDK?
Yes. The official Python SDK is reversecontact on PyPI and requires Python 3.11 or later. Install the package with pip install reversecontact. Choose the synchronous client, ReverseContact, or the asynchronous client, AsyncReverseContact. For TypeScript and JavaScript, the official SDK is @reverse-contact/sdk on npm.
Does the reversecontact Python SDK retry failed requests?
Yes. The reversecontact SDK retries per-minute rate limits and 500, 502, 503 and 504 errors up to 4 times, after the delay the API asks for or with exponential backoff. It never retries daily limits, API key credit limits, missing credits or any other 4xx error except 409 IDEMPOTENCY_KEY_IN_USE.
How do I cap the credits a Reverse Contact search spends in Python?
Call a free count method first, such as client.search.count_people(). Then read results with a search iterator such as client.search.iter_people(). The required max_results argument caps the number of profiles requested and billed.
How do I wait for a live fetch or Find Email result in Python?
Call job.wait() on the job that client.fetch.person_live() or client.contact.find_email() returns. The method polls for free until the job ends, up to 30 minutes by default. A failed job raises JobFailedError. Save job.id first so you can resume with client.jobs.wait() after a restart.
What does the reversecontact SDK return when a lookup finds nothing?
client.enrich.person(), client.enrich.company(), client.fetch.person() and client.fetch.company() return None when nothing matches. That answer costs no credits, so there is nothing to retry.