VisitorGeo API

One authenticated GET returns the caller’s approximate location and network. Everything is an IP-based estimate.

Endpoint

GET https://api.visitorgeo.com/v1/YOUR_KEY

The key is the 16-character key issued at signup. The response describes the caller of the request — i.e. the browser or server that made the GET. Call it from your visitor’s browser to geolocate that visitor.

Response fields

All fields are optional: any value Cloudflare cannot resolve for a given IP is omitted from the JSON rather than returned empty. estimated is always present and always true.

FieldTypeNotes
estimatedbooleanAlways true. All data is an IP-derived estimate.
ipstringThe caller’s IP address.
countrystringISO 3166-1 alpha-2 country code, e.g. US.
citystringBest-guess city name.
regionstringFirst-level subdivision (state/province) name.
region_codestringSubdivision code, e.g. CA.
postal_codestringPostal/ZIP code for the IP’s area.
metro_codestringDMA/metro code (US only, when available).
latitudenumberArea centroid latitude. Not a GPS fix — accuracy is city/region level.
longitudenumberArea centroid longitude. Same caveat as latitude.
timezonestringIANA timezone, e.g. America/Los_Angeles.
continentstringTwo-letter continent code.
asnnumberAutonomous System Number of the IP’s network.
as_organizationstringName of the network operator.
colostringCloudflare data center (IATA code) that served the request.

CORS

Every response sends Access-Control-Allow-Origin: *, so you can call the API directly from browser JavaScript on any origin. Preflight OPTIONS requests are answered with 204. All responses send Cache-Control: no-store.

Error codes

StatusBodyMeaning
403{"error":"unknown or disabled account key"}The key is not recognized or has been disabled.
404{"error":"not found"}Bad path, or a malformed key (must be 12–24 lowercase alphanumeric characters).

Fair use

Keys are metered per lookup. Please don’t share a key across unrelated properties or attempt to defeat metering — usage that looks abusive may have its key disabled. Billing is $1 per million lookups with the first 100,000 lookups each month free; see pricing.

Get a key