People Data Labs Python Client
raw JSON → 6.4.13 verified Fri May 01 auth: no python
Official Python client for the People Data Labs API. Provides access to person, company, job, school, and other enrichment datasets. As of version 6.4.13, the library supports Python 3.8+ and is actively maintained with frequent dependency updates.
pip install peopledatalabs Common errors
error peopledatalabs.exceptions.PdlException: API key is required ↓
cause No API key was provided to PDLClient.
fix
Set the PDL_API_KEY environment variable or pass api_key to PDLClient.
error ImportError: cannot import name 'PDLClient' from 'peopledatalabs.client' ↓
cause User tried to import from a submodule instead of the top-level package.
fix
Use 'from peopledatalabs import PDLClient'.
error TypeError: __init__() got an unexpected keyword argument 'api_secret' ↓
cause In v6, the API secret is no longer supported; only API key is used.
fix
Remove api_secret parameter; use api_key instead.
Warnings
gotcha API key is required and must be passed as a string. If omitted or None, the client will raise a PdlException with message 'API key is required'. ↓
fix Set the PDL_API_KEY environment variable or pass api_key='your_key' to the constructor.
deprecated The method 'person.retrieve' (used in older versions) is deprecated; use 'person.enrichment' instead. ↓
fix Replace client.person.retrieve(...) with client.person.enrichment(...).
breaking Python 3.7 support dropped in v6.0. The library now requires Python >=3.8. ↓
fix Upgrade Python to 3.8 or later.
Imports
- PDLClient wrong
from peopledatalabs.client import PDLClientcorrectfrom peopledatalabs import PDLClient
Quickstart
from peopledatalabs import PDLClient
client = PDLClient(api_key=os.environ.get('PDL_API_KEY', ''))
response = client.person.enrichment(
email='test@example.com',
pretty=True
)
print(response)