Geolocate IP Address

PythonData
POST api.upapi.io/ip-geolocation.get

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

ipgeolocationasnpython
AuthAPI key
Cost1 unit
Timeout12s
Cache3600s

Request schema

FieldTypeDescription
ip
IPv4 or IPv6 address; omit to geolocate the caller· default: null

Response schema

FieldTypeDescription
ipreq
string
asnreq
orgreq
cityreq
postalreq
regionreq
countryreq
currencyreq
latitudereq
timezonereq
fetchedAtreq
string
languagesreq
array
longitudereq
countryCodereq

Try it

Try it

IPv4 or IPv6 address; omit to geolocate the caller

Run this endpoint live

Jump in as a guest — no signup — and run ip-geolocation.get with your own inputs. Create a free account anytime to get your own API key.

Sign in

Code examples

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" }'

Developer tools

OpenAPI specImport the spec or collection into Postman, Insomnia, or any codegen tool.