Registry / crm-productivity / rocketreach

rocketreach

JSON →
library2.1.8pypypi✓ verified 84d ago

The `rocketreach` Python library provides official bindings for the RocketReach API, allowing programmatic access to its extensive database of professional contact information, including emails, phone numbers, and social links. It is actively maintained, with version 2.1.8 currently available, and facilitates tasks such as lead generation, sales prospecting, and data enrichment.

pip install rocketreach
INSTALL
IMPORT
SIG · ROCKETREACH
R
rocketreach
crm-productivitypythonv2.1.8
Install
2.1s avg
Import
613ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.657s · 21.3MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.1s · import 0.569s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Gateway
from rocketreach import Gateway
GatewayConfig
from rocketreach import GatewayConfig
GatewayEnvironment
from rocketreach import GatewayEnvironment
rocketreach
import rocketreach
from rocketreach import *
While 'from rocketreach import *' works, it's generally discouraged in production code due to potential name collisions. Prefer explicit imports or 'import rocketreach' and qualify names.

This quickstart initializes the RocketReach client using an API key from an environment variable, then demonstrates fetching account details and performing a basic person search. Be aware that person searches consume lookup credits on your RocketReach account.

import rocketreach import os # Ensure your RocketReach API key is set as an environment variable api_key = os.environ.get('ROCKETREACH_API_KEY', '') if not api_key: print("Warning: ROCKETREACH_API_KEY environment variable not set. Quickstart may fail.") print("Please set it: export ROCKETREACH_API_KEY='your_api_key'") else: try: # Initialize the RocketReach Gateway rr = rocketreach.Gateway(api_key=api_key) # Example 1: Get account details account_result = rr.account.get() if account_result.is_success: print("Account details:", account_result.account) else: print("Failed to retrieve account details:", account_result.error) # Example 2: Search for a person (Note: This operation consumes lookup credits) # Replace 'Google' and 'Software Engineer' with your target criteria print("\nAttempting a person search (consumes credits)...") person_search_query = rr.person.search().filter( current_employer='Google', current_title='Software Engineer' ) search_results = person_search_query.execute() if search_results.is_success: print(f"Found {len(search_results.people)} matching people:") for person in search_results.people: emails_display = ', '.join([e.value for e in person.emails]) if person.emails else 'No email' print(f" - Name: {person.name}, Title: {person.current_title}, Company: {person.current_employer}, Emails: {emails_display}") else: print("Failed to perform person search:", search_results.error) except Exception as e: print(f"An unexpected error occurred: {e}")
rocketreach --version
Debug
Known issues
gotchaRocketReach API lookups consume credits from your account. Be mindful of usage, especially when performing bulk operations or iterative searches, as this can lead to unexpected charges.
fix
Monitor your RocketReach account's credit usage. The library's `rr.account.get()` method can fetch remaining lookups. Understand the pricing model before running extensive queries.
affects: All versions
gotchaThe default `person.lookup()` method is blocking, meaning it will poll the API until contact information is found or the lookup times out. For asynchronous workflows, pass `block=False` and use `checkStatus()` manually.
fix
For non-blocking operations: `result = rr.person.lookup(person_id=123, block=False)`. Then, periodically call `rr.person.checkStatus(person_id=result.person.id)` until the status is complete.
affects: All versions
gotchaThe RocketReach API has a rate limit (e.g., 250 requests per minute). Exceeding this limit will result in a `429 Too Many Requests` status code.
fix
Implement a retry mechanism with exponential backoff for API calls. Check the error message for `Retry-After` headers if provided, or simply wait a few seconds before retrying.
affects: All versions
breakingThe default branch of the `rocketreach/rocketreach_python` GitHub repository switched from `master` to `main` on 2025/08/13. This affects how you clone or pull updates if you are tracking the default branch.
fix
Update your local Git configurations for any forks or clones to track the `main` branch: `git branch -m master main; git fetch origin; git branch -u origin/main main; git remote set-head origin -a`
affects: Repository usage, not library functionality
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rocketreach'
The 'rocketreach' Python package has not been installed in your current environment.
fix
Install the library using pip: `pip install rocketreach`
rocketreach.errors.RocketReachAPIError: Invalid API Key provided.
The API key configured for the `Gateway` client is incorrect, expired, or missing. This can also occur if you try to use a production key in the sandbox environment or vice-versa.
fix
Verify your `ROCKETREACH_API_KEY` environment variable or the API key passed to `rocketreach.Gateway()` is correct. Ensure it matches the environment (production or sandbox) you intend to use. You can generate/view your API key on the RocketReach website in your API settings.
NameError: name 'rocketreach' is not defined
You are trying to use objects or functions from the `rocketreach` library without importing it first.
fix
Add `import rocketreach` at the top of your Python script. If using specific classes like `Gateway`, use `from rocketreach import Gateway`.
AttributeError: 'NoneType' object has no attribute 'get' (or 'search')
This typically happens if the `rocketreach.Gateway` object itself was not correctly initialized (e.g., due to a missing API key) and thus returned `None` or an incomplete object, or if you're trying to access a non-existent method/service.
fix
Ensure the `Gateway` object is properly initialized with a valid API key. For instance, `rr = rocketreach.Gateway(api_key=os.environ.get('ROCKETREACH_API_KEY', ''))` should be correctly configured. Double-check method names like `account.get()` or `person.search()` against the documentation.
Upgrade
Version history
2.1.8latest on PyPI · released Mar 26, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
46 hits · last 30 days
node
40
OpenAI (training)
1
Resources
rocketreach — pip install rocketreach · libregistry