IP Geolocation API
Get accurate IP address geolocation data with country, city, timezone, currency, and ISP information. Support for both IPv4 and IPv6 addresses.
{
"data": {
"ip": "1.1.1.1",
"hostname": "one.one.one.one",
"type": "v4",
"connection": {
"asn": 13335,
"organization": "Cloudflare, Inc.",
"isp": "APNIC Research and Development"
},
"location": {
"country": { "alpha2": "US", "name": "United States" },
"region": { "alpha2": "US-CA", "name": "California" },
"city": { "name": "Los Angeles" },
"latitude": 34.0536,
"longitude": -118.2455
},
"timezone": { "id": "America/Los_Angeles", "code": "PDT" },
"security": { "is_vpn": false, "is_tor": false, "threat_score": 0 }
}
}
Use Cases
Real-world applications of IP geolocation data
Content Localization
Automatically display content in the user's language and currency based on their location. Improve user experience with localized pricing and regional content.
Fraud Prevention
Detect suspicious login attempts and transactions from unusual locations. Implement geo-blocking and access controls to protect your platform.
Analytics & Reporting
Understand your audience demographics with geographic analytics. Track visitor locations and generate detailed regional reports.
Targeted Advertising
Deliver location-specific ads and promotions. Increase conversion rates with geographically relevant marketing campaigns.
Compliance & Restrictions
Enforce geographic restrictions and comply with regional regulations like GDPR. Implement geo-fencing for content distribution.
Timezone Detection
Automatically detect user timezones for scheduling and time-based features. Display times in the user's local timezone.
API Examples
Simple integration with your favorite programming language
curl "https://api.ipbase.com/v2/info?ip=1.1.1.1" \
-H "apikey: YOUR_API_KEY"
const response = await fetch(
'https://api.ipbase.com/v2/info?ip=1.1.1.1',
{ headers: { apikey: 'YOUR_API_KEY' } }
);
const { data } = await response.json();
console.log(data.location.country.name);
import requests
response = requests.get(
'https://api.ipbase.com/v2/info',
params={'ip': '1.1.1.1'},
headers={'apikey': 'YOUR_API_KEY'}
)
data = response.json()
print(data['data']['location']['country']['name'])
$response = file_get_contents(
'https://api.ipbase.com/v2/info?apikey=YOUR_API_KEY&ip=1.1.1.1'
);
$data = json_decode($response, true);
echo $data['data']['location']['country']['name'];
Available Integrations
Use IPBase with your favorite tools and platforms
Official SDKs & Libraries
API Marketplaces
Automation & Integration Platforms
MCP server for AI agents
Ready to Get Started?
Start your free trial today. No credit card required.
