# Geolocate IP Address API

> Resolve an IP (IPv4 or IPv6) to city, region, country, lat/long, timezone, ASN, and currency. Omit the ip field to geolocate the caller.

Category: [Data APIs](https://upapi.io/apis/data) · Last updated 2026-06-12

## How to call it

- Endpoint: `POST https://api.upapi.io/ip-geolocation.get`, key in the `X-Api-Key` header, JSON body.
- Cost: 1 weighted unit per call.
- Timeout: 12 seconds.
- Cache: identical requests are served from cache for 3600 seconds, unbilled.
- Try it without writing code: https://app.upapi.io/try/ip-geolocation.get

```bash
curl -X POST https://api.upapi.io/ip-geolocation.get \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{ "ip": "8.8.8.8" }'
```

## Request parameters

- `ip` (string) — IPv4 or IPv6 address; omit to geolocate the caller

## Response fields

- `ip` (string, required)
- `asn` (string, required)
- `org` (string, required)
- `city` (string, required)
- `postal` (string, required)
- `region` (string, required)
- `country` (string, required)
- `currency` (string, required)
- `latitude` (number, required)
- `timezone` (string, required)
- `fetchedAt` (string, required)
- `languages` (array, required)
- `longitude` (number, required)
- `countryCode` (string, required)

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "ip": "8.8.8.8"
}
```

```json
{
  "ip": "8.8.8.8",
  "asn": "example",
  "org": "example",
  "city": "example",
  "postal": "example",
  "region": "example",
  "country": "example",
  "currency": "example",
  "latitude": 43.65,
  "timezone": "example",
  "fetchedAt": "example",
  "languages": [
    "example"
  ],
  "longitude": -79.38,
  "countryCode": "US"
}
```

## Frequently asked questions

### How much does the Geolocate IP Address API cost per call?

Each call spends 1 weighted unit of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Geolocate IP Address API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Geolocate IP Address API responses cached?

Yes — identical requests are served from cache for 3600 seconds, and a cache hit is not billed.

## More Data APIs

- [Get Current Weather](https://upapi.io/apis/data/weather-current)
- [Get Wikipedia Article Summary](https://upapi.io/apis/data/wikipedia-article)
- [Look Up Timezone](https://upapi.io/apis/data/timezone-lookup)
- [Wayback Machine Lookup](https://upapi.io/apis/data/archive-wayback)
- [Get BBC News Headlines](https://upapi.io/apis/data/bbc-news)
