IP to location APIs

IPInfoDB IP Location API

by ipinfodb.com

IP to location APIs Added on February 7th, 2011
Visit ipinfodb.com →

What it does

The IPInfoDB IP Location API finds the location of an IP address: country, region, city, ZIP code, latitude, longitude and time zone. Use the country-only call for speed or the city call for full detail. Responses are JSON or XML. Free with a free API key.
  • API
  • HTTP-GET
  • JSON
  • REST
  • XML

At a glance

API key
Needed, free · More APIs with a free key
Pricing
Free with a free API key.
From the browser
Yes (CORS)
Formats
JSON, XML
Interface
REST, HTTP-GET
Provider
ipinfodb.com

More information: https://www.ipinfodb.com/api

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

ipinfodb.com
IPInfoDB IP Location API

Example request

curl

curl 'https://api.ipinfodb.com/v3/ip-city/?key=YOUR_API_KEY&ip=8.8.8.8&format=json'

JavaScript

const response = await fetch("https://api.ipinfodb.com/v3/ip-city/?key=YOUR_API_KEY&ip=8.8.8.8&format=json");
const data = await response.json();
console.log(data);

Python

import requests

response = requests.get(
    "https://api.ipinfodb.com/v3/ip-city/?key=YOUR_API_KEY&ip=8.8.8.8&format=json",
    timeout=30,
)
print(response.json())

Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried IPInfoDB IP Location API.