{"auth":{"required":false,"when_required":"send Authorization: Bearer \u003ctoken\u003e or X-Api-Key: \u003ctoken\u003e on /lookup and /reverse. / and /health are never gated."},"description":"IP geolocation and reverse geocode. City-level only (not street). Same database for both: IP2Location LITE.","endpoints":[{"example":"/lookup/8.8.8.8","method":"GET","params":{"ip":"path, IPv4 or IPv6"},"path":"/lookup/{ip}","response":{"city":"Mountain View","country_code":"US","country_name":"United States of America","ip":"8.8.8.8","latitude":37.405992,"longitude":-122.078515,"region":"California","timezone":"-07:00","zipcode":"94043"},"use_when":"Caller has an IPv4 or IPv6 address."},{"example":"/reverse?lat=-27.4698\u0026lon=153.0251","method":"GET","notes":"Nearest city centroid in the database. zipcode is the city's representative zip, not the device's street. Response has no ip field.","params":{"lat":"query, number -90..90","lon":"query, number -180..180"},"path":"/reverse","response":{"city":"Brisbane","country_code":"AU","country_name":"Australia","latitude":-27.46754,"longitude":153.02809,"region":"Queensland","timezone":"+10:00","zipcode":"4000"},"use_when":"Caller has WGS84 latitude and longitude from a device location share."},{"example":"/health","method":"GET","path":"/health","response":{"database":"IP2LOCATION-LITE-DB11.IPV6.BIN","db_version":"2026.9.1","places":86234,"status":"ok"},"use_when":"Liveness. Never requires auth."}],"errors":{"400":"invalid ip or lat/lon","401":"auth required or token wrong","501":"IPv6 asked of an IPv4-only database","503":"database not loaded yet"},"field_notes":["Unknown or reserved ranges return '-' in text fields.","zipcode and timezone are omitted on lesser BINs (no SDK error sentences).","Returned latitude/longitude are the matched city point, not the query (on /reverse) and not a street address."],"service":"ip2loc","usage":"If you have an IP, GET /lookup/{ip}. If you have device GPS, GET /reverse?lat={lat}\u0026lon={lon}. Do not send an IP to /reverse. Do not send lat/lon to /lookup."}
