{"id":26188180,"url":"https://github.com/peopledatalabs/peopledatalabs-python","last_synced_at":"2026-01-05T13:13:59.548Z","repository":{"id":40250823,"uuid":"479507322","full_name":"peopledatalabs/peopledatalabs-python","owner":"peopledatalabs","description":"A Python client for the People Data Labs API","archived":false,"fork":false,"pushed_at":"2025-03-25T17:32:05.000Z","size":543,"stargazers_count":31,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T05:06:53.016Z","etag":null,"topics":["api","companies","company-data","company-enrichment","company-search","contact-data","data-enrichment","enrichment","people","peopledatalabs","person-data","person-enrichment","person-search","python","python-sdk","search"],"latest_commit_sha":null,"homepage":"https://docs.peopledatalabs.com/docs/python-sdk","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peopledatalabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-08T19:01:27.000Z","updated_at":"2025-03-25T17:32:07.000Z","dependencies_parsed_at":"2024-03-04T17:35:03.168Z","dependency_job_id":"c467075b-10a2-41f9-ae4b-01d0a72a3b1b","html_url":"https://github.com/peopledatalabs/peopledatalabs-python","commit_stats":{"total_commits":31,"total_committers":5,"mean_commits":6.2,"dds":0.4193548387096774,"last_synced_commit":"c5a8eaa9334ac8651cb3aaa7a0377db952ffdeb1"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peopledatalabs%2Fpeopledatalabs-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peopledatalabs%2Fpeopledatalabs-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peopledatalabs%2Fpeopledatalabs-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peopledatalabs%2Fpeopledatalabs-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peopledatalabs","download_url":"https://codeload.github.com/peopledatalabs/peopledatalabs-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441042,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","companies","company-data","company-enrichment","company-search","contact-data","data-enrichment","enrichment","people","peopledatalabs","person-data","person-enrichment","person-search","python","python-sdk","search"],"created_at":"2025-03-11T23:57:14.745Z","updated_at":"2026-01-05T13:13:59.542Z","avatar_url":"https://github.com/peopledatalabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://www.peopledatalabs.com/images/logos/company-logo.png\" style=\"background-color: white; padding: 5px 10px;\" width=\"250\" alt=\"People Data Labs Logo\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003ePeople Data Labs Python Client\u003c/h1\u003e\n\u003cp align=\"center\"\u003eOfficial Python client for the People Data Labs API.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/peopledatalabs/peopledatalabs-python\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/repo%20status-Active-limegreen\" alt=\"Repo Status\"\u003e\n  \u003c/a\u003e\u0026nbsp;\n  \u003ca href=\"https://pypi.org/project/peopledatalabs/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/peopledatalabs.svg?logo=pypi\u0026logoColor=fff\u0026label=PyPI+package\u0026color=limegreen\" alt=\"People Data Labs on PyPI\" /\u003e\n  \u003c/a\u003e\u0026nbsp;\n  \u003ca href=\"https://pypi.org/project/peopledatalabs/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/peopledatalabs.svg\" alt=\"People Data Labs on PyPI\" /\u003e\n  \u003c/a\u003e\u0026nbsp;\n  \u003ca href=\"https://github.com/peopledatalabs/peopledatalabs-python/actions/workflows/python-poetry.yml\"\u003e\n    \u003cimg src=\"https://github.com/peopledatalabs/peopledatalabs-python/actions/workflows/python-poetry.yml/badge.svg\" alt=\"Tests Status\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [🔧 Installation](#installation)\n- [🚀 Usage](#usage)\n- [🏝 Sandbox Usage](#sandbox)\n- [🌐 Endpoints](#endpoints)\n- [📘 Documentation](#documentation)\n  - [Upgrading to v2.X.X](#upgrading-to-v2)\n  - [Upgrading to v3.X.X](#upgrading-to-v3)\n  - [Upgrading to v4.X.X](#upgrading-to-v4)\n\n\n## 🔧 Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\n\n1. Install from PyPi using [pip](https://pip.pypa.io/en/latest/), a package manager for Python.\n\n    ```bash\n    pip install peopledatalabs\n    ```\n\n2. Sign up for a [free PDL API key](https://www.peopledatalabs.com/signup).\n\n## 🚀 Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\nFirst, create the PDLPY client:\n\n```python\nfrom peopledatalabs import PDLPY\n\n\n# specify your API key\nclient = PDLPY(\n    api_key=\"YOUR API KEY\",\n)\n\n```\n\nThen, send requests to any PDL API Endpoint.\n\n### Getting Person Data\n\n#### By Enrichment\n\n```python\nresult = client.person.enrichment(\n    phone=\"4155688415\",\n    pretty=True,\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code};\"\n        f\"\\nReason: {result.reason};\"\n        f\"\\nMessage: {result.json()['error']['message']};\"\n    )\n```\n\n#### By Bulk Enrichment\n\n```python\nresult = client.person.bulk(\n    required=\"emails AND profiles\",\n    requests=[\n        {\n            \"metadata\": {\n                \"user_id\": \"123\"\n            },\n            \"params\": {\n                \"profile\": [\"linkedin.com/in/seanthorne\"],\n                \"location\": [\"SF Bay Area\"],\n                \"name\": [\"Sean F. Thorne\"],\n            }\n        },\n        {\n            \"metadata\": {\n                \"user_id\": \"345\"\n            },\n            \"params\": {\n                \"profile\": [\"https://www.linkedin.com/in/haydenconrad/\"],\n                \"first_name\": \"Hayden\",\n                \"last_name\": \"Conrad\",\n            }\n        }\n    ]\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Search (Elasticsearch)\n\n```python\nes_query = {\n    \"query\": {\n        \"bool\": {\n            \"must\": [\n                {\"term\": {\"location_country\": \"mexico\"}},\n                {\"term\": {\"job_title_role\": \"health\"}},\n            ]\n        }\n    }\n}\ndata = {\n    \"query\": es_query,\n    \"size\": 10,\n    \"pretty\": True,\n    \"dataset\": \"phone, mobile_phone\",\n}\nresult = client.person.search(**data)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Search (SQL)\n\n```python\nsql_query = (\n    \"SELECT * FROM person\"\n    \" WHERE location_country='mexico'\"\n    \" AND job_title_role='health'\"\n    \" AND phone_numbers IS NOT NULL;\"\n)\ndata = {\n    \"sql\": sql_query,\n    \"size\": 10,\n    \"pretty\": True,\n    \"dataset\": \"phone, mobile_phone\",\n}\nresult = client.person.search(**data)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By `PDL_ID` (Retrieve API)\n\n```python\nresult = client.person.retrieve(\n    person_id=\"qEnOZ5Oh0poWnQ1luFBfVw_0000\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Fuzzy Enrichment (Identify API)\n\n```python\nresult = client.person.enrichment(\n    name=\"varun villait\",\n    pretty=True,\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Changelog\n\n```python\nresult = client.person.changelog(\n    origin_version=\"30.2\",\n    target_version=\"31.0\",\n    type=\"updated\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n### Getting Company Data\n\n#### By Enrichment\n\n```python\nresult = client.company.enrichment(\n    website=\"peopledatalabs.com\",\n    pretty=True,\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Bulk Enrichment\n\n```python\nresult = client.company.bulk(\n    requests=[\n        {\n            \"metadata\": {\n                \"company_id\": \"123\"\n            },\n            \"params\": {\n                \"profile\": \"linkedin.com/company/peopledatalabs\",\n            }\n        },\n        {\n            \"metadata\": {\n                \"company_id\": \"345\"\n            },\n            \"params\": {\n                \"profile\": \"https://www.linkedin.com/company/apple/\",\n            }\n        }\n    ]\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Search (Elasticsearch)\n\n```python\nes_query = {\n    \"query\": {\n        \"bool\": {\n            \"must\": [\n                {\"term\": {\"tags\": \"big data\"}},\n                {\"term\": {\"industry\": \"financial services\"}},\n                {\"term\": {\"location.country\": \"united states\"}},\n            ]\n        }\n    }\n}\ndata = {\n    \"query\": es_query,\n    \"size\": 10,\n    \"pretty\": True,\n}\nresult = client.company.search(**data)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### By Search (SQL)\n\n```python\nsql_query = (\n    \"SELECT * FROM company\"\n    \" WHERE tags='big data'\"\n    \" AND industry='financial services'\"\n    \" AND location.country='united states';\"\n)\ndata = {\n    \"sql\": sql_query,\n    \"size\": 10,\n    \"pretty\": True,\n}\nresult = client.company.search(**data)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n### Using supporting APIs\n\n#### Get Autocomplete Suggestions\n\n```python\nresult = client.autocomplete(\n    field=\"title\",\n    text=\"full\",\n    size=10,\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### Clean Raw Company Strings\n\n```python\nresult = client.company.cleaner(\n    name=\"peOple DaTa LabS\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### Clean Raw Location Strings\n\n```python\nresult = client.location.cleaner(\n    location=\"455 Market Street, San Francisco, California 94105, US\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### Clean Raw School Strings\n\n```python\nresult = client.school.cleaner(\n    name=\"university of oregon\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### Get Job Title Enrichment\n\n```python\nresult = client.job_title(\n    job_title=\"data scientist\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code}\"\n        f\"\\nReason: {result.reason}\"\n        f\"\\nMessage: {result.json()['error']['message']}\"\n    )\n```\n\n#### Get IP Enrichment\n\n```python\nresult = client.ip(\n    ip=\"72.212.42.228\",\n)\nif result.ok:\n    print(result.text)\nelse:\n    print(\n        f\"Status: {result.status_code};\"\n        f\"\\nReason: {result.reason};\"\n        f\"\\nMessage: {result.json()['error']['message']};\"\n    )\n```\n\n## 🏝 Sandbox Usage \u003ca name=\"sandbox\"\u003e\u003c/a\u003e\n#### To enable sandbox usage, use the sandbox flag on PDLPY\n\n```python\nPDLPY(sandbox=True)\n```\n\n## 🌐 Endpoints \u003ca name=\"endpoints\"\u003e\u003c/a\u003e\n\n**Person Endpoints**\n\n| API Endpoint                                                                                    | PDLPY Function                      |\n| ----------------------------------------------------------------------------------------------- | ----------------------------------- |\n| [Person Enrichment API](https://docs.peopledatalabs.com/docs/enrichment-api)                    | `PDLPY.person.enrichment(**params)` |\n| [Person Bulk Enrichment API](https://docs.peopledatalabs.com/docs/bulk-enrichment-api)          | `PDLPY.person.bulk(**params)`       |\n| [Person Search API](https://docs.peopledatalabs.com/docs/search-api)                            | `PDLPY.person.search(**params)`     |\n| [Person Retrieve API](https://docs.peopledatalabs.com/docs/person-retrieve-api)                 | `PDLPY.person.retrieve(**params)`   |\n| [Person Identify API](https://docs.peopledatalabs.com/docs/identify-api)                        | `PDLPY.person.identify(**params)`   |\n| [Person Changelog API](https://docs.peopledatalabs.com/docs/person-changelog-api)               | `PDLPY.person.changelog(**params)`  |\n\n**Company Endpoints**\n\n| API Endpoint                                                                                    | PDLPY Function                       |\n| ----------------------------------------------------------------------------------------------- | ------------------------------------ |\n| [Company Enrichment API](https://docs.peopledatalabs.com/docs/company-enrichment-api)           | `PDLPY.company.enrichment(**params)` |\n| [Company Bulk Enrichment API](https://docs.peopledatalabs.com/docs/bulk-company-enrichment-api) | `PDLPY.company.bulk(**params)`       |\n| [Company Search API](https://docs.peopledatalabs.com/docs/company-search-api)                   | `PDLPY.company.search(**params)`     |\n\n**Supporting Endpoints**\n\n| API Endpoint                                                                              | PDLJS Function                     |\n| ----------------------------------------------------------------------------------------- | ---------------------------------- |\n| [Autocomplete API](https://docs.peopledatalabs.com/docs/autocomplete-api)                 | `PDLPY.autocomplete(**params)`     |\n| [Company Cleaner API](https://docs.peopledatalabs.com/docs/cleaner-apis#companyclean)     | `PDLPY.company.cleaner(**params)`  |\n| [Location Cleaner API](https://docs.peopledatalabs.com/docs/cleaner-apis#locationclean)   | `PDLPY.location.cleaner(**params)` |\n| [School Cleaner API](https://docs.peopledatalabs.com/docs/cleaner-apis#schoolclean)       | `PDLPY.school.cleaner(**params)`   |\n| [Job Title Enrichment API](https://docs.peopledatalabs.com/docs/job-title-enrichment-api) | `PDLPY.job_title(**params)`        |\n| [IP Enrichment API](https://docs.peopledatalabs.com/docs/ip-enrichment-api)               | `PDLPY.ip(**params)`               |\n\n## 📘 Documentation \u003ca name=\"documentation\"\u003e\u003c/a\u003e\n\nAll of our API endpoints are documented at: https://docs.peopledatalabs.com/\n\nThese docs describe the supported input parameters, output responses and also provide additional technical context.\n\nAs illustrated in the [Endpoints](#endpoints) section above, each of our API endpoints is mapped to a specific method in the PDLPY class.  For each of these class methods, **all function inputs are mapped as input parameters to the respective API endpoint**, meaning that you can use the API documentation linked above to determine the input parameters for each endpoint.\n\nAs an example:\n\nThe following is **valid** because `name` is a [supported input parameter to the Person Identify API](https://docs.peopledatalabs.com/docs/identify-api-reference#input-parameters):\n\n```python\nPDLPY().person.identify({\"name\": \"varun villait\"})\n```\n\nConversely, this would be **invalid** because `fake_parameter` is not an input parameter to the Person Identify API:\n\n```python\nPDLPY().person.identify({\"fake_parameter\": \"anything\"})\n```\n\n### Upgrading to v2.X.X \u003ca name=\"upgrading-to-v2\"\u003e\u003c/a\u003e\n\nNOTE: When upgrading to v2.X.X from vX.X.X and below, the minimum required python version is now 3.8.\n\n### Upgrading to v3.X.X \u003ca name=\"upgrading-to-v3\"\u003e\u003c/a\u003e\n\nNOTE: When upgrading to v3.X.X from vX.X.X and below, the minimum required pydantic version is now 2.\n\n### Upgrading to v4.X.X \u003ca name=\"upgrading-to-v4\"\u003e\u003c/a\u003e\n\nNOTE: When upgrading to v4.X.X from vX.X.X and below, we no longer auto load the API key from the environment variable `PDL_API_KEY`. You must now pass the API key as a parameter to the `PDLPY` class.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeopledatalabs%2Fpeopledatalabs-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeopledatalabs%2Fpeopledatalabs-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeopledatalabs%2Fpeopledatalabs-python/lists"}