Skip to main content

Revenuebase Python SDK

Python SDK for the Revenuebase API — email verification, contact resolution, organization resolution, and batch job management.

Requirements

  • Python ≥ 3.8

Install

pip install revenuebase-sdk

Quickstart

from revenuebase_sdk import RevenuebaseClient

client = RevenuebaseClient(api_key="your-api-key")
# Or set REVENUEBASE_API_KEY in your environment and call RevenuebaseClient()

# Verify a single email
result = client.email.verify(email="user@acme.com")
print(result.status)  # "Valid", "Invalid", or "Unknown"

# With full metadata
result = client.email.verify(email="user@acme.com", metadata=True)
print(result.mx_record_present, result.email_provider)

# Check your credit balance
usage = client.account.balance()
print(usage.credits)

Authentication

Pass your API key via the api_key parameter or the REVENUEBASE_API_KEY environment variable. The key is sent as the x-key header on every request.

export REVENUEBASE_API_KEY="your-api-key"

Resources

account

Method Description
balance() Get your remaining credit balance.
rotate_api_key() Generate a new API key (invalidates the previous one immediately).

contact

Method Description
refresh_email(*, email) Resolve an email to the person's current contact records. Returns a status of current, refresh, or no_match.

email

Method Description
verify(*, email, metadata=False) Verify a single email. Returns Valid, Invalid, or Unknown. Rate limited to 5 req/s.
batch_upload(*, file, filename, metadata=False) Upload a .csv or .json file for async batch verification.

jobs

Method Description
list() List all active (queued or processing) batch jobs.
get(*, process_id) Get the status of a batch job.
cancel(*, process_id) Cancel a queued or in-progress batch job.
download(*, process_id) Download the results of a completed job as bytes.

organization

Method Description
resolve(*, company_name, result_count=3, ...) Match an organization name to verified records using semantic search.
discover(*, keyword, result_count=1000, min_similarity_score=0, ...) Discover organizations matching a keyword or description.

Both methods accept optional headquarter filters: headquarters_country, headquarters_state, headquarters_city, headquarters_street, headquarters_zip. discover also accepts min_similarity_score (0–0.95) — only results at or above this threshold are returned and charged.

Batch verification workflow

import time

# 1. Upload the file
with open("emails.csv", "rb") as f:
    job = client.email.batch_upload(file=f, filename="emails.csv")

print(f"Job {job.process_id} queued")

# 2. Poll until complete
while True:
    status = client.jobs.get(process_id=job.process_id)
    print(status.current_status)
    if status.current_status in ("COMPLETED", "ERROR", "CANCELLED"):
        break
    time.sleep(5)

# 3. Download results
if status.current_status == "COMPLETED":
    data = client.jobs.download(process_id=job.process_id)
    with open("results.csv", "wb") as f:
        f.write(data)

Organization resolution

# Match by name
result = client.organization.resolve(
    company_name="Stripe",
    result_count=3,
    headquarters_country="US",
)
for org in result.companies:
    print(org.company_name, org.similar_score, org.headquarters_city)

# Discover by keyword
result = client.organization.discover(
    keyword="enterprise cybersecurity SaaS",
    result_count=100,
    headquarters_country="US",
)

Contact resolution

Use this to detect when someone on your list has moved companies, so you can refresh stale contact data before reaching out.

result = client.contact.refresh_email(email="jane@acme.com")

if result.status == "current":
    print("Still at the same company")
elif result.status == "refresh":
    for contact in result.contacts:
        print(contact.FULL_NAME_PER, contact.EMAIL_ADDRESS_PER, contact.COMPANY_NAME_ORG)
else:  # "no_match"
    print("No matching person found")

Each item in result.contacts is a Contact — one position held by the matched person. Field names are the raw source identifiers (_PER for person fields, _ORG for organization fields, e.g. FIRST_NAME_PER, JOB_TITLE_PER, COMPANY_NAME_ORG); any field may be None if the record doesn't carry it.

Async usage

import asyncio
from revenuebase_sdk import AsyncRevenuebaseClient

async def main():
    async with AsyncRevenuebaseClient(api_key="your-api-key") as client:
        result = await client.email.verify(email="user@acme.com")
        print(result.status)

asyncio.run(main())

Error handling

from revenuebase_sdk import (
    AuthenticationError,
    BadRequestError,
    RateLimitError,
    APIConnectionError,
)

try:
    result = client.email.verify(email="user@acme.com")
except AuthenticationError:
    print("Invalid API key")
except BadRequestError as e:
    print(f"Bad request: {e.message}")
except RateLimitError:
    print("Rate limited — slow down requests")
except APIConnectionError as e:
    print(f"Network error: {e.message}")

Per-request options

# Override timeout for a single call
result = (
    client
    .with_options(timeout=5.0, max_retries=0)
    .email.verify(email="user@acme.com")
)

Migrating from v1

The v1 API was retired on July 7, 2026 and is no longer supported by this SDK. client.v1 has been removed entirely.

v1 (removed) v2 replacement
client.user_operations.get_credits() client.account.balance()
client.user_operations.rotate_api_key() client.account.rotate_api_key()
client.email_processing.validate_email(email=...) client.email.verify(email=...)
client.email_processing.batch_upload(...) client.email.batch_upload(...)
client.email_processing.get_batch_status(process_id=...) client.jobs.get(process_id=...)
client.email_processing.list_queued() client.jobs.list()
client.email_processing.cancel_batch(process_id=...) client.jobs.cancel(process_id=...)
client.email_processing.download_batch(process_id=...) client.jobs.download(process_id=...)
client.company_resolver.resolve(...) client.organization.resolve(...)
client.company_resolver.discover(...) client.organization.discover(...)

If you're upgrading from a version that still had client.v1, pin to revenuebase-sdk<0.3.0 until you've migrated.

Development

pip install -e ".[dev]"
pytest
mypy src
ruff check src

Metadata

Release files for revenuebase-sdk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for revenuebase-sdk 0.3.0
File Size Uploaded Provenance Actions
revenuebase_sdk-0.3.0.tar.gz 25.7 kB With provenance Details for revenuebase_sdk-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for revenuebase-sdk 0.3.0
File Interpreter ABI Platform Actions
revenuebase_sdk-0.3.0-py3-none-any.whl Python 3 none any Details for revenuebase_sdk-0.3.0-py3-none-any.whl

Total release size: 56.6 kB

Release files / revenuebase_sdk-0.3.0.tar.gz

Download URL revenuebase_sdk-0.3.0.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1fa9cab06d4a72c2b6380afba351bcb1e7b4e831e3f83229b9ad57b463d9af26
BLAKE2b-256 checksum
How to use checksums
86e16ff99bc68212a94f7d87da79c84e859a32eaf7a8dfa05f77546077628911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

Release files / revenuebase_sdk-0.3.0-py3-none-any.whl

Download URL revenuebase_sdk-0.3.0-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35d42f7f8d48abae4312504e060f2bc1a18f33c4498daaa4de58608adaf4d740
BLAKE2b-256 checksum
How to use checksums
6bf64ec1d250c417da235378f365c7186b20732e44c33d61cd2a10ad1bbaf63d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

Security for revenuebase-sdk 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for revenuebase_sdk-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page