Docs › Network and contact checks
IP address location API
IP address to country, state, city and network.
Country, region (the state, for Indian addresses), city and network operator of a public IPv4 or IPv6 address, from DB-IP's free databases, refreshed monthly. Addresses are never written to the request log.
Location of an IP address
GET/v1/ip/{address}
What you send here is never written to the log, and the answer is not cached.
| Parameter | Description |
|---|---|
addresspath, required | IPv4 or IPv6 address. |
curl
curl "https://api.dharun.dev/v1/ip/49.204.0.1"JavaScript
const response = await fetch("https://api.dharun.dev/v1/ip/49.204.0.1");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.get("https://api.dharun.dev/v1/ip/49.204.0.1", timeout=10)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])Response
{
"data": {
"ip": "49.204.0.1",
"version": 4,
"country": {
"code": "IN",
"name": "India"
},
"continent": "AS",
"region": "Telangana",
"stateCode": "TS",
"city": "Hyderabad (NBT Nagar)",
"latitude": 17.4089,
"longitude": 78.4346,
"asn": {
"number": 55577,
"organization": "Atria Convergence Technologies Pvt. Ltd."
}
},
"meta": {
"source": {
"name": "DB-IP Lite: IP to City and IP to ASN",
"url": "https://db-ip.com/db/lite.php",
"licence": "CC BY 4.0",
"version": "2026-10",
"retrieved": "2026-10-14T13:16:38Z",
"attribution": "IP Geolocation by DB-IP (https://db-ip.com), licensed under CC BY 4.0."
},
"note": "The position is that of a city or district for the address range, not of a device or a person."
}
}Location of your own address
GET/v1/ip
What you send here is never written to the log, and the answer is not cached.
curl
curl "https://api.dharun.dev/v1/ip"JavaScript
const response = await fetch("https://api.dharun.dev/v1/ip");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.get("https://api.dharun.dev/v1/ip", timeout=10)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])Data source
DB-IP Lite: IP to City and IP to ASN, 2026-10. Retrieved 2026-10-14T13:16:38Z. Licence: CC BY 4.0. IP Geolocation by DB-IP (https://db-ip.com), licensed under CC BY 4.0.
Using an AI assistant? Connect the MCP server and it can call this API by itself.