Skip to main content
IPinfo - Comprehensive IP address data, IP geolocation API and database

Python IP Geolocation API for Smarter Targeting

Don't wait for manual lookups or delayed processes. Instantly add crucial geolocation context, such as country, region, and network, to every request you handle.

1
2
3
4
5
6
7
8
9
10
{
ip:"1.0.0.232",
asn:"AS13335",
as_name:"Cloudflare, Inc.",
as_domain:"cloudflare.com",
country_code:"AU",
country:"Australia",
continent_code:"OC",
continent:"Oceania"
}

Reliable IP Coverage Across IPv4 and IPv6

IPinfo delivers accurate IP data across both IPv4 and 100% of allocated IPv6 space. As ad traffic scales globally, you'll capture geo and network context without gaps.

Built for Python Workflows

With a fully supported Python SDK and JSON-ready responses, IPinfo fits cleanly into your enrichment, segmentation, or fraud filtering pipelines. Access IP data via real-time API or scheduled database pulls.

Integrates Fast, Scales Seamlessly

From script to production, integration takes minutes, not days. Whether you're validating impressions or optimizing spend, IPinfo scales with your traffic and tooling.

How Marketers Can Leverage Python GeoIP Data for Better Ad Targeting

Start with IPinfo Lite to enrich ad requests with country-level and ASN data. ideal for identifying mismatched geographies or unexpected traffic sources. With a single API call in Python, you can improve campaign targeting, reduce irrelevant impressions, and build geo-aware workflows that don't rely on cookies.

Sample Response

$ curl https://ipinfo.io/23.64.48.164?token=$TOKEN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
ip:"23.64.48.164",
hostname:"a23-64-48-164.deploy.static.akamaitechnologies.com",
city:"Ashburn",
region:"Virginia",
country:"US",
loc:"39.0437,-77.4875",
org:"AS20940 Akamai International B.V.",
postal:"20147",
timezone:"America/New_York",
asn:{
asn:"AS20940",
name:"Akamai International B.V.",
domain:"akamai.com",
route:"23.64.48.0/20",
type:"hosting"
},
company:{
name:"Akamai Technologies, Inc.",
domain:"akamai.com",
type:"hosting"
},
privacy:{
vpn:false,
proxy:false,
tor:false,
relay:false,
hosting:true,
service:""
},
abuse:{
address:"US, MA, Cambridge, 145 Broadway",
country:"US",
email:"abuse@akamai.com",
name:"Akamai Technologies",
network:"23.64.0.0/14",
phone:"+1-617-444-3000"
}
}

Dev Notes

Going to be developing with our data? Here's the main things you may want to know:

  • One-line setup via curl, fetch, or SDK
  • Multi-language SDKs (Node.js, Python, Go, PHP, Java...)
  • Real-time JSON, ~100ms average latency
  • Optional integrations (API, DBs, Snowflake, GCP, Splunk)
  • Trusted by Microsoft, WordPress, and 1000s of dev team
  • Fresh, reliable data with 99.99% uptime, updated daily
See our full documentation

Why Use IPinfo Lite for Python Geolocation

IPinfo Lite gives Python developers fast, free access to accurate IP geolocation and ASN data. With just a few lines of code, you can enrich ad logs, route traffic more intelligently, and segment users by country or network type, all without hitting usage limits.

It's the perfect starting point for adtech teams looking to build location-aware workflows or test geo-based targeting logic. And when you're ready for deeper insights, like city-level data, privacy detection, or mobile carrier flags, it's easy to upgrade to IPinfo Core or IPinfo Plus.

Developer-friendly REST API with Python examples and libraries

Always free, with unlimited commercial use and no throttling

Clear upgrade path for teams needing more precision and risk signals

IpInfo Lite

Want to try out our data for free? Start with IPinfo Lite

No monthly fees, no credit card required, and unlimited API requests.

Trusted by AdTech Teams Who Build at Scale

Lemonade Fashion

We use IPinfo to enrich our data with geolocation information, which helps us provide a better user experience. We also use it to detect and block fraudulent activities.

Mohamad Ali Baydoun
Mohamad Ali BaydounChief Technology Officer at Lemonade Fashion
H10 Hotels

The implementation is very easy and straightforward. The API is very concrete - features are highlighted and that’s it, nothing too fancy. I remember checking out some other services but none of them were easy to use or attractive from the economical point of view.

Lluís Garceso Espigares
Greynoise

IPinfo is absolutely essential to our business. The data is rock solid, the API is dead simple, and the price is unbeatable. I constantly recommend it to all of my friends in the industry.

Andrew Morris
Andrew MorrisFounder & Chief Architect at Greynoise
Lemonade Fashion

We use IPinfo to enrich our data with geolocation information, which helps us provide a better user experience. We also use it to detect and block fraudulent activities.

Mohamad Ali Baydoun
Mohamad Ali BaydounChief Technology Officer at Lemonade Fashion
H10 Hotels

The implementation is very easy and straightforward. The API is very concrete - features are highlighted and that’s it, nothing too fancy. I remember checking out some other services but none of them were easy to use or attractive from the economical point of view.

Lluís Garceso Espigares
CiscoMicrosoftCloudflareDockerGoogleDataDogSnowflakeOpenAIAnthropic