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
ipstringyesIPv4 or IPv6 address to look up

Response Fields

Field Description
ipQueried IP address
versionIPv4 or IPv6
city, region, countryGeographic location
latitude, longitudeGPS coordinates
timezoneIANA timezone identifier
isp, org, asNetwork / ISP information
is_proxy, is_vpn, is_torThreat detection flags
is_datacenterWhether 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);