ipinfo
Official Python library for IPInfo
What it is and what it does
IPinfo is the official Python client for the IPinfo.io IP address API. It lets you look up geolocation (city, region, country, coordinates), ASN details (ISP, domain, network type), company information (business name and domain), and carrier data for any IP address. The library supports multiple API tiers—Lite, Core, Plus, and Residential Proxy—each returning different levels of detail. It provides both synchronous handlers (using requests) and asynchronous handlers (using aiohttp), so you can integrate it into blocking or async codebases.
The package depends on aiohttp, cachetools, and requests. It requires Python 3.10 or later and an IPinfo API token to function. The free tier allows 50,000 requests per month and omits some premium fields like IP type and company data; paid plans unlock higher volumes and complete data. Most use cases involve a single handler instantiation per application, then calling getDetails() with an IP address or no argument to query the caller's own IP.
Use it for:
- Geolocate user traffic by IP to serve region-specific content or detect suspicious access patterns.
- Enrich logs or analytics with ASN and company data to identify traffic sources and network operators.
- Detect mobile carriers or privacy proxies using the Plus API for fraud prevention or access control.
- Build IP reputation or abuse-tracking systems by querying abuse contact and hosting provider details.
- Integrate IP geolocation into async web services without blocking the event loop.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Queries the IPinfo.io API to retrieve geolocation, ASN, company, and carrier details for IP addresses, with support for both synchronous and asynchronous requests.
Yes, if you need IP geolocation and ASN data. The library is actively maintained, has no known vulnerabilities, installs cleanly, and is the official client for a widely-used API. The main constraint is the Python 3.10+ requirement and the need for an API token (though a free tier exists). Install it if your project targets modern Python and you're comfortable with an external API dependency.
Install
ipinfo on PyPI
pip
pip install ipinfouv
uv add ipinfopoetry
poetry add ipinfoInstalling ipinfo
Before you install
Low install friction with a pure Python wheel. Actively maintained with recent commits and no known vulnerabilities. Requires Python 3.10 or later, which may constrain older projects.
License in practice
Licensed under Apache License 2.0, a permissive license allowing commercial and private use with minimal restrictions.
Quickstart
pip install ipinfo
import ipinfo
handler = ipinfo.getHandler(access_token='your_token')
details = handler.getDetails('8.8.8.8')
print(details.city, details.country)
Requires an IPinfo API access token (free account available at ipinfo.io/signup); free tier limited to 50,000 requests per month.
Verify before relying
- Whether the async implementation's stated Python 3.9 and 3.10 support conflicts with the package's requires_python >=3.10 constraint.
- Performance characteristics and rate-limiting behavior under high request volumes.
- Caching behavior and whether cachetools integration is automatic or requires explicit configuration.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — aiohttp, cachetools, requests |
| Maintenance | actively maintained — 114 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 498,514/month — #6,329 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ipinfo-5.6.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
shodanProvides Python access to Shodan's search…
permissive · top 15,000 on PyPI
geoip2fastGeoIP2Fast performs fast geolocation lookups…
permissive · top 15,000 on PyPI
geoip2Queries MaxMind's GeoIP web services and…
permissive · top 5,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
pybgpkitPython bindings for BGPKIT tools that parse BGP…
permissive · top 15,000 on PyPI
domaintools-apiProvides a Python interface to DomainTools…
permissive · top 15,000 on PyPI
ip3countryLooks up the ISO 3166-1 alpha-2 country code…
permissive · top 5,000 on PyPI
phonenumbersParse, validate, format, and analyze…
permissive · top 1,000 on PyPI
geocoderGeocoder provides a unified Python interface to…
permissive · top 5,000 on PyPI