IP Geolocation API Documentation
Complete reference for the IP Geolocation API
Authentication
Pass your API key via header or query parameter:
Authorization: Bearer sk_live_your_key_here
Query: ?api_key=sk_live_your_key_here
GET POST /v1/ip/lookup
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
ip | string | yes | IPv4 or IPv6 address to look up |
Response Fields
| Field | Description |
|---|---|
ip | Queried IP address |
version | IPv4 or IPv6 |
city, region, country | Geographic location |
latitude, longitude | GPS coordinates |
timezone | IANA timezone identifier |
isp, org, as | Network / ISP information |
is_proxy, is_vpn, is_tor | Threat detection flags |
is_datacenter | Whether IP belongs to a hosting/datacenter provider |
Examples
cURL
curl "https://snapapis.com/api/v1/ip/lookup?api_key=YOUR_KEY&ip=8.8.8.8"
JavaScript
const res = await fetch( `https://snapapis.com/api/v1/ip/lookup?api_key=${KEY}&ip=${ip}` ); const { data } = await res.json(); console.log(data.city, data.country);