# 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.

Base URL `https://api.dharun.dev`. No API key. Answers are JSON, `{ "data": ..., "meta": { ... } }`, and errors are `{ "error": { "code", "message" } }` with a matching HTTP status. Rate limit: 600 requests a minute per client.

## Location of an IP address

`GET /v1/ip/{address}`

What you send is never written to the log, and the answer is not cached.

Parameters:

- `address` (path, required): IPv4 or IPv6 address.

Example: https://api.dharun.dev/v1/ip/49.204.0.1

Response:

```json
{
  "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 is never written to the log, and the answer is not cached.

Example: https://api.dharun.dev/v1/ip

## Data source

- [DB-IP Lite: IP to City and IP to ASN](https://db-ip.com/db/lite.php), 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.
