Skip to content

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

SDKs // Python // Guides

Async client

Last verified

Use the Reverse Contact async Python client with asyncio, await API responses and job results, and read search or List iterators with async for.

AsyncReverseContact has the same resources, methods and arguments as the synchronous client. Await each call, and read search iterators with async for.

Python SDK

Async client

import asyncio
import os

from reversecontact import AsyncReverseContact


async def main() -> None:
    async with AsyncReverseContact(api_key=os.environ["RC_API_KEY"]) as client:
        result = await client.enrich.company(domain="acme.com")
        if result is not None and result.data is not None and result.data.company is not None:
            print(result.data.company.name, result.data.company.industry)

        async for person in client.search.iter_people(current_function="Marketing", max_results=10):
            if person is not None:
                print(person.first_name, person.last_name)


asyncio.run(main())

Await pages and jobs

Search page methods return an AsyncPage. Call has_next_page() synchronously and await get_next_page().

Live fetch and contact methods return an AsyncJob. Await both job.retrieve() and job.wait().

Python SDK

Python SDK

import asyncio

from reversecontact import AsyncReverseContact


async def main() -> None:
    async with AsyncReverseContact() as client:
        job = await client.contact.verify_email(email="jane@acme.com")
        print("Job id:", job.id)
        done = await job.wait()
        print(done.data.result if done.data else None)


asyncio.run(main())

Close and cancel

Use async with to close the SDK-owned connection pool, or call await client.close(). If you supply your own HTTP client, pass an httpx.AsyncClient and close that client yourself.

Use asyncio.timeout() or cancel an asyncio task to stop waiting locally. See Timeouts and cancellation for deadline behavior and Async jobs for handling job failures.

Read search iterators and the free list_all() iterators with async for directly, without awaiting the iterator itself.

Return to the Python SDK overview.

FAQ

How do I call Reverse Contact from asyncio?

Create AsyncReverseContact inside async with and await API calls. The async client exposes the same resources and arguments as ReverseContact.

Should I await a Python SDK search iterator?

Read an AsyncReverseContact search iterator with async for. Do not await the iterator itself. Await page methods and get_next_page() instead.

How do I wait for an async Python job?

Await the method that creates an AsyncJob, then await job.wait(). Save job.id so client.jobs.wait(job_id) can resume polling later.