{"id":24211187,"url":"https://github.com/ipdata/python","last_synced_at":"2025-09-22T07:32:08.219Z","repository":{"id":45738983,"uuid":"108238848","full_name":"ipdata/python","owner":"ipdata","description":"Official Python client library for the ipdata API","archived":false,"fork":false,"pushed_at":"2023-02-14T13:03:21.000Z","size":456,"stargazers_count":19,"open_issues_count":7,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-08T02:37:09.797Z","etag":null,"topics":["geolocation","geolocation-api","ipdata","python"],"latest_commit_sha":null,"homepage":"https://ipdata.co","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/ipdata.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}},"created_at":"2017-10-25T08:02:18.000Z","updated_at":"2023-10-04T16:21:51.000Z","dependencies_parsed_at":"2023-02-08T09:16:04.049Z","dependency_job_id":null,"html_url":"https://github.com/ipdata/python","commit_stats":{"total_commits":143,"total_committers":3,"mean_commits":"47.666666666666664","dds":0.6433566433566433,"last_synced_commit":"856ce4c33bc7a983b8ca58878ff51c5fb4b5e86c"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/ipdata/python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fpython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fpython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fpython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fpython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipdata","download_url":"https://codeload.github.com/ipdata/python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipdata%2Fpython/sbom","scorecard":{"id":493621,"data":{"date":"2025-08-11","repo":{"name":"github.com/ipdata/python","commit":"856ce4c33bc7a983b8ca58878ff51c5fb4b5e86c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/ipdata/python/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/ipdata/python/python-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/ipdata/python/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:27","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2014-14 / GHSA-652x-xj99-gmcc","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2014-13 / GHSA-cfj3-7x9c-4p3h","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T19:52:30.423Z","repository_id":45738983,"created_at":"2025-08-19T19:52:30.423Z","updated_at":"2025-08-19T19:52:30.423Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276273713,"owners_count":25614235,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["geolocation","geolocation-api","ipdata","python"],"created_at":"2025-01-14T02:19:57.356Z","updated_at":"2025-09-22T07:32:07.948Z","avatar_url":"https://github.com/ipdata.png","language":"Python","readme":"[![PyPI version](https://badge.fury.io/py/ipdata.svg)](https://badge.fury.io/py/ipdata) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ipdata/python/python-publish.yml?branch=master)\n\n# Official Python client library and CLI for the ipdata API\n\nThis is a Python client and command line interface (CLI) for the [ipdata.co](https://ipdata.co) IP Geolocation API. ipdata offers a fast, highly-available API to enrich IP Addresses with Location, Company, Threat Intelligence and numerous other data attributes.\n\nNote that you need an API Key to use this package. You can get a free one with a 1,500 daily request limit by [Signing up here](https://ipdata.co/sign-up.html).\n\nVisit our [Documentation](https://docs.ipdata.co/) for more examples and tutorials.\n\n[![asciicast](https://asciinema.org/a/371292.svg)](https://asciinema.org/a/371292)\n\n## Installation\n\nInstall the latest version of the cli with `pip`.\n\n```bash\npip install ipdata\n```\n\nor `easy_install`\n\n```bash\neasy_install ipdata\n```\n\n## Library Usage\n\nYou need a valid API key from ipdata to use the library. You can get a free key by [Signing up here](https://ipdata.co/sign-up.html).\n\nReplace `test` with your API Key in the following examples.\n\n### Looking up the calling IP Address\n\nYou can look up the calling IP address, that is, the IP address of the computer you are running this on by not passing an IP address to the `lookup` method.\n\n```python\n\u003e\u003e\u003e import ipdata\n\u003e\u003e\u003e ipdata.api_key = \"\u003cYOUR API KEY\u003e\"\n\u003e\u003e\u003e ipdata.lookup()\n```\n\n### Looking up any IP Address\n\nYou can look up any valid IPv4 or IPv6 address by passing it to the `lookup` method.\n\n```python\n\u003e\u003e\u003e import ipdata\n\u003e\u003e\u003e ipdata.api_key = \"\u003cYOUR API KEY\u003e\"\n\u003e\u003e\u003e response = ipdata.lookup('69.78.70.144')\npprint(response)\n```\n\n\u003cdetails\u003e\u003csummary\u003eSample Response\u003c/summary\u003e\n\n```json\n{\n  \"ip\": \"69.78.70.144\",\n  \"is_eu\": false,\n  \"city\": null,\n  \"region\": null,\n  \"region_code\": null,\n  \"country_name\": \"United States\",\n  \"country_code\": \"US\",\n  \"continent_name\": \"North America\",\n  \"continent_code\": \"NA\",\n  \"latitude\": 37.750999450683594,\n  \"longitude\": -97.8219985961914,\n  \"postal\": null,\n  \"calling_code\": \"1\",\n  \"flag\": \"https://ipdata.co/flags/us.png\",\n  \"emoji_flag\": \"\\ud83c\\uddfa\\ud83c\\uddf8\",\n  \"emoji_unicode\": \"U+1F1FA U+1F1F8\",\n  \"asn\": {\n    \"asn\": \"AS6167\",\n    \"name\": \"Verizon Business\",\n    \"domain\": \"verizon.com\",\n    \"route\": \"69.78.0.0/17\",\n    \"type\": \"business\"\n  },\n  \"company\": {\n    \"name\": \"Verizon Business\",\n    \"domain\": \"verizon.com\",\n    \"network\": \"69.78.0.0/17\",\n    \"type\": \"business\"\n  },\n  \"carrier\": {\n    \"name\": \"Verizon\",\n    \"mcc\": \"310\",\n    \"mnc\": \"004\"\n  },\n  \"languages\": [\n    {\n      \"name\": \"English\",\n      \"native\": \"English\",\n      \"code\": \"en\"\n    }\n  ],\n  \"currency\": {\n    \"name\": \"US Dollar\",\n    \"code\": \"USD\",\n    \"symbol\": \"$\",\n    \"native\": \"$\",\n    \"plural\": \"US dollars\"\n  },\n  \"time_zone\": {\n    \"name\": null,\n    \"abbr\": null,\n    \"offset\": null,\n    \"is_dst\": null,\n    \"current_time\": null\n  },\n  \"threat\": {\n    \"is_tor\": false,\n    \"is_icloud_relay\": false,\n    \"is_proxy\": false,\n    \"is_datacenter\": false,\n    \"is_anonymous\": false,\n    \"is_known_attacker\": false,\n    \"is_known_abuser\": false,\n    \"is_threat\": false,\n    \"is_bogon\": false,\n    \"blocklists\": []\n  },\n  \"count\": \"3895\",\n  \"status\": 200\n}\n```\n\u003c/details\u003e\n\n\n### Getting only one field\n\nIf you only need a single data attribute about an IP address you can extract it by passing a `select_field` parameter to the `lookup` method.\n\n```python\n\u003e\u003e\u003e import ipdata\n\u003e\u003e\u003e ipdata.api_key = \"\u003cYOUR API KEY\u003e\"\n\u003e\u003e\u003e ipdata.lookup('8.8.8.8', select_field='asn')\n```\n\nResponse\n\n```json\n{\n  \"asn\": {\n    \"asn\": \"AS15169\",\n    \"name\": \"Google LLC\",\n    \"domain\": \"about.google\",\n    \"route\": \"8.8.8.0/24\",\n    \"type\": \"business\"\n  },\n  \"status\": 200\n}\n```\n\n### Getting a number of specific fields\n\nIf instead you need to get multiple specific fields you can pass a list of valid field names in a `fields` parameter.\n\n```python\n\u003e\u003e\u003e import ipdata\n\u003e\u003e\u003e ipdata.api_key = \"\u003cYOUR API KEY\u003e\"\n\u003e\u003e\u003e ipdata.lookup('8.8.8.8',fields=['ip','asn','country_name'])\n```\n\nResponse\n\n```json\n{\n  \"ip\": \"8.8.8.8\",\n  \"asn\": {\n    \"asn\": \"AS15169\",\n    \"name\": \"Google LLC\",\n    \"domain\": \"about.google\",\n    \"route\": \"8.8.8.0/24\",\n    \"type\": \"business\"\n  },\n  \"country_name\": \"United States\",\n  \"status\": 200\n}\n```\n\n### Bulk Lookups\n\nThe API provides a `/bulk` endpoint that allows you to look up upto 100 IP addresses at a time. This is convenient for quickly clearing your backlog.\n\nNOTE: Alternatively it is much simpler to process bulk lookups using the `ipdata` cli's `batch` command. All you need is a csv file with a list of IP addresses and you can get your results as either a JSON file or a CSV file! See the [CLI Bulk Lookup Documentation](https://docs.ipdata.co/command-line-interface/bulk-lookups-recommended) for details.\n\n```python\n\u003e\u003e\u003e import ipdata\n\u003e\u003e\u003e ipdata.api_key = \"\u003cYOUR API KEY\u003e\"\n\u003e\u003e\u003e ipdata.bulk(['8.8.8.8','1.1.1.1'])\n```\n\n\u003cdetails\u003e\u003csummary\u003eSample Response\u003c/summary\u003e\n\n```\n{\n  \"responses\": [\n    {\n      \"ip\": \"8.8.8.8\",\n      \"is_eu\": false,\n      \"city\": null,\n      \"region\": null,\n      \"region_code\": null,\n      \"country_name\": \"United States\",\n      \"country_code\": \"US\",\n      \"continent_name\": \"North America\",\n      \"continent_code\": \"NA\",\n      \"latitude\": 37.750999450683594,\n      \"longitude\": -97.8219985961914,\n      \"postal\": null,\n      \"calling_code\": \"1\",\n      \"flag\": \"https://ipdata.co/flags/us.png\",\n      \"emoji_flag\": \"\\ud83c\\uddfa\\ud83c\\uddf8\",\n      \"emoji_unicode\": \"U+1F1FA U+1F1F8\",\n      \"asn\": {\n        \"asn\": \"AS15169\",\n        \"name\": \"Google LLC\",\n        \"domain\": \"about.google\",\n        \"route\": \"8.8.8.0/24\",\n        \"type\": \"business\"\n      },\n      \"company\": {\n        \"name\": \"Google LLC\",\n        \"domain\": \"google.com\",\n        \"network\": \"8.8.8.0/24\",\n        \"type\": \"business\"\n      },\n      \"languages\": [\n        {\n          \"name\": \"English\",\n          \"native\": \"English\",\n          \"code\": \"en\"\n        }\n      ],\n      \"currency\": {\n        \"name\": \"US Dollar\",\n        \"code\": \"USD\",\n        \"symbol\": \"$\",\n        \"native\": \"$\",\n        \"plural\": \"US dollars\"\n      },\n      \"time_zone\": {\n        \"name\": null,\n        \"abbr\": null,\n        \"offset\": null,\n        \"is_dst\": null,\n        \"current_time\": null\n      },\n      \"threat\": {\n        \"is_tor\": false,\n        \"is_icloud_relay\": false,\n        \"is_proxy\": false,\n        \"is_datacenter\": false,\n        \"is_anonymous\": false,\n        \"is_known_attacker\": false,\n        \"is_known_abuser\": false,\n        \"is_threat\": false,\n        \"is_bogon\": false,\n        \"blocklists\": []\n      },\n      \"count\": \"3931\"\n    },\n    {\n      \"ip\": \"1.1.1.1\",\n      \"is_eu\": null,\n      \"city\": null,\n      \"region\": null,\n      \"region_code\": null,\n      \"country_name\": null,\n      \"country_code\": null,\n      \"continent_name\": null,\n      \"continent_code\": null,\n      \"latitude\": null,\n      \"longitude\": null,\n      \"postal\": null,\n      \"calling_code\": null,\n      \"flag\": null,\n      \"emoji_flag\": null,\n      \"emoji_unicode\": null,\n      \"asn\": {\n        \"asn\": \"AS13335\",\n        \"name\": \"Cloudflare, Inc.\",\n        \"domain\": \"cloudflare.com\",\n        \"route\": \"1.1.1.0/24\",\n        \"type\": \"business\"\n      },\n      \"company\": {\n        \"name\": \"Cloudflare, Inc.\",\n        \"domain\": \"cloudflare.com\",\n        \"network\": \"1.1.1.0/24\",\n        \"type\": \"business\"\n      },\n      \"languages\": null,\n      \"currency\": {\n        \"name\": null,\n        \"code\": null,\n        \"symbol\": null,\n        \"native\": null,\n        \"plural\": null\n      },\n      \"time_zone\": {\n        \"name\": null,\n        \"abbr\": null,\n        \"offset\": null,\n        \"is_dst\": null,\n        \"current_time\": null\n      },\n      \"threat\": {\n        \"is_tor\": false,\n        \"is_icloud_relay\": false,\n        \"is_proxy\": false,\n        \"is_datacenter\": false,\n        \"is_anonymous\": false,\n        \"is_known_attacker\": false,\n        \"is_known_abuser\": false,\n        \"is_threat\": false,\n        \"is_bogon\": false,\n        \"blocklists\": []\n      },\n      \"count\": \"3931\"\n    }\n  ],\n  \"status\": 200\n}\n```\n\u003c/details\u003e\n\n## Using the ipdata CLI\n\n\n### Windows Installation Notes\n\nIPData CLI needs [Python 3.9+](https://www.python.org/downloads/windows/). Python Windows installation program\nprovides PIP so you can install IPData CLI the same way:\n```\npip install ipdata\n```\n\n### Available commands\n\n```shell\nipdata --help\nUsage: ipdata [OPTIONS] COMMAND [ARGS]...\n\n  Welcome to the ipdata CLI\n\nOptions:\n  --api-key TEXT  Your ipdata API Key. Get one for free from\n                  https://ipdata.co/sign-up.html\n  --help          Show this message and exit.\n\nCommands:\n  lookup*   Lookup resources by using the IPData class methods.\n  batch     Batch command for doing fast bulk processing.\n  init      Initialize the CLI by setting an API key.\n  usage     Get today's usage.\n  validate  Validates a geofeed file. \n```\n\n### Initialize the cli with your API Key\n\nYou need a valid API key from ipdata to use the cli. You can get a free key by [Signing up here](https://ipdata.co/sign-up.html).\n\n```shell\nipdata init \u003cAPI Key\u003e\n _           _       _\n(_)_ __   __| | __ _| |_ __ _\n| | '_ \\ / _` |/ _` | __/ _` |\n| | |_) | (_| | (_| | || (_| |\n|_| .__/ \\__,_|\\__,_|\\__\\__,_|\n  |_|\n\n✨ Successfully initialized.     \n```\n\nYou can also pass the `--api-key \u003cAPI Key\u003e` parameter to any command to specify a different API Key.\n\n### Look up your own IP address\n\nRunning the `ipdata` command without any parameters will look up the IP address of the computer you are running the command on. Alternatively you can explicitly look up your own IP address by running `ipdata`.\n\n\n```shell\nipdata\n```\n\nTo pretty print the result pass the `-p` flag\n\n```\n╭────────────────────────────────╮ ╭────────────╮ ╭─────────────────╮ ╭──────────╮ ╭─────────────╮ ╭───────────────╮ ╭──────────────╮ ╭────────────────╮ ╭────────────────╮ ╭────────╮ ╭──────────────╮\n│ ip                             │ │ is_eu      │ │ city            │ │ region   │ │ region_code │ │ country_name  │ │ country_code │ │ continent_name │ │ continent_code │ │ postal │ │ calling_code │\n│ 24.24.24.24                    │ │ False      │ │ Syracuse        │ │ New York │ │ NY          │ │ United States │ │ US           │ │ North America  │ │ NA             │ │ 13261  │ │ 1            │\n╰────────────────────────────────╯ ╰────────────╯ ╰─────────────────╯ ╰──────────╯ ╰─────────────╯ ╰───────────────╯ ╰──────────────╯ ╰────────────────╯ ╰────────────────╯ ╰────────╯ ╰──────────────╯\n╭────────────────────────────────╮ ╭────────────╮ ╭─────────────────╮ ╭──────────╮                                                                                                                     \n│ flag                           │ │ emoji_flag │ │ emoji_unicode   │ │ count    │                                                                                                                     \n│ https://ipdata.co/flags/us.png │ │ 🇺🇸         │ │ U+1F1FA U+1F1F8 │ │ 4086     │                                                                                                                     \n╰────────────────────────────────╯ ╰────────────╯ ╰─────────────────╯ ╰──────────╯                                                                                                                     \n╭────────────────────────────────╮ ╭──────────────────╮ ╭─────────────────╮ ╭────────────────╮ ╭───────────────────────────────╮ ╭───────────────────────╮\n│ asn                            │ │ company          │ │ languages       │ │ currency       │ │ time_zone                     │ │ threat                │\n│ ├── asn                        │ │ ├── name         │ │ └──             │ │ ├── name       │ │ ├── name                      │ │ ├── is_tor            │\n│ │   AS11351                    │ │ │   Rr-Route     │ │     ├── name    │ │ │   US Dollar  │ │ │   America/New_York          │ │ │   False             │\n│ ├── name                       │ │ ├── domain       │ │     │   English │ │ ├── code       │ │ ├── abbr                      │ │ ├── is_icloud_relay   │\n│ │   Charter Communications Inc │ │ │                │ │     ├── native  │ │ │   USD        │ │ │   EDT                       │ │ │   False             │\n│ ├── domain                     │ │ ├── network      │ │     │   English │ │ ├── symbol     │ │ ├── offset                    │ │ ├── is_proxy          │\n│ │   spectrum.com               │ │ │   24.24.0.0/19 │ │     └── code    │ │ │   $          │ │ │   -0400                     │ │ │   False             │\n│ ├── route                      │ │ └── type         │ │         en      │ │ ├── native     │ │ ├── is_dst                    │ │ ├── is_datacenter     │\n│ │   24.24.0.0/18               │ │     business     │ ╰─────────────────╯ │ │   $          │ │ │   True                      │ │ │   False             │\n│ └── type                       │ ╰──────────────────╯                     │ └── plural     │ │ └── current_time              │ │ ├── is_anonymous      │\n│     business                   │                                          │     US dollars │ │     2022-07-15T16:59:44-04:00 │ │ │   False             │\n╰────────────────────────────────╯                                          ╰────────────────╯ ╰───────────────────────────────╯ │ ├── is_known_attacker │\n                                                                                                                                 │ │   False             │\n                                                                                                                                 │ ├── is_known_abuser   │\n                                                                                                                                 │ │   False             │\n                                                                                                                                 │ ├── is_threat         │\n                                                                                                                                 │ │   False             │\n                                                                                                                                 │ ├── is_bogon          │\n                                                                                                                                 │ │   False             │\n                                                                                                                                 │ └── blocklists        │\n                                                                                                                                 │     []                │\n                                                                                                                                 ╰───────────────────────╯                                                    \n```\n\n### Look up any IP address\n\nYou can pass any valid IPv4 or IPv6 address to the `ipdata` command to look it up. In case an invalid value is passed you will get the error `ERROR    'BLEH' does not appear to be an IPv4 or IPv6 address\"`.\n\n```shell\nipdata 8.8.8.8\n```\n\n### Copying results to clipboard\n\nUse `-c` to copy the results to the clipboard!\n\n```\nipdata 1.1.1.1 -f ip -f asn -c \n📋️ Copied result to clipboard!  \n```\n\n### Filtering results by a list of fields \n\nUse `--fields` to filter the responses \n\n```shell\nipdata --fields city --fields country_name'\n```\n\nor use `-f`\n\n```shell\nipdata 1.1.1.1 -f ip -f asn\n```\n\n```json\n{\n  \"ip\": \"1.1.1.1\",\n  \"asn\": {\n    \"asn\": \"AS13335\",\n    \"name\": \"Cloudflare, Inc.\",\n    \"domain\": \"cloudflare.com\",\n    \"route\": \"1.1.1.0/24\",\n    \"type\": \"business\"\n  },\n  \"status\": 200\n}\n```\n\n### Batch lookup\n\nPerhaps the most useful command provided by the CLI is the ability to process a csv file with a list of IP addresses and write the results to file as either CSV or JSONL/NDJSON! It could be a list of tens of thousands to millions of IP addresses and it will all be processed and the results filtered to your liking!\n\nWhen you use the JSON output format, the results are written to the output file you provide with one result per line. Each line being a valid and full JSON response object.\nIf you only need a few fields eg. only the country name you can specify a field argument with the names of the fields you want, if you combine this with the CSV output format you will get very clean results with only the data you need!\n\n### To get full JSON responses for further processing\n\nThis is the default output format, so you could omit the `--format JSON`\n\n```\nipdata batch my_ip_backlog.csv --output geolocation_results.json --format JSON\n```\n\n### Batch lookup with output to CSV file\n\n```\nipdata batch my_ip_backlog.csv --output results.csv --output-format CSV --fields ip --fields country_code\n```\n\nThe `--fields` option is required to use CSV output.\n\n#### Example Results\n\n```csv\n# ip,country_code\n107.175.75.83,US\n35.155.95.229,US\n13.0.0.164,US\n209.248.120.14,US\n142.0.202.238,US\n...\n```\n\n### Available Fields\n\nA list of all the fields returned by the API is maintained at [Response Fields](https://docs.ipdata.co/api-reference/response-fields)\n\n## Geofeed tools\n\nGeofeed publishers can use the `ipdata validate` command to validate their geofeeds before submission to ipdata. This will catch most but not all issues that might cause processing your geofeed to fail.\n\nThe validation closely follows https://datatracker.ietf.org/doc/html/draft-google-self-published-geofeeds-02 with one caveat, we expect the country field to be provided at the minimum.\n\nYou can provide either a url or a path to a local file.\n\n```shell\nipdata validate https://example.com/geofeed.txt\n```\n\nor \n\n```shell\nipdata validate geofeed.txt\n```\n\n## Errors\n\nA list of possible errors is available at [Status Codes](https://docs.ipdata.co/api-reference/status-codes)\n\n\n## Tests\n\nTo run all tests\n\n```shell\npytest\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipdata%2Fpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipdata%2Fpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipdata%2Fpython/lists"}