IP geolocation

IP geolocation looks up the approximate country, region, and city of a public IPv4 or IPv6 address. Use it to choose a default country, currency, or shipping option, or to focus search near a visitor before they type anything.

IP geolocation uses the ip-geolocation scope and costs one request, from the shared free allowance first.

Look up an address

GET /v1/ip/{ip} takes one public IP address.

Request
curl "https://api.mapricot.com/v1/ip/8.8.8.8" \
  -H "Authorization: Bearer $MAPRICOT_KEY"
Response
{  "ip": "8.8.8.8",  "found": true,  "continentCode": "NA",  "countryCode": "US",  "countryName": "United States",  "regionName": "California",  "city": "Mountain View",  "location": {    "lat": 37.422,    "lon": -122.085  },  "source": "DB-IP City Lite",  "attributionUrl": "https://db-ip.com",  "licenseUrl": "https://creativecommons.org/licenses/by/4.0/",  "datasetRelease": "2026-10"}

Fields the data doesn't have are left out rather than guessed. When the address has no known location, the response is "found": false. That lookup still counts as a request.

Private, reserved, and malformed addresses, such as 192.168.0.1, return 400 and aren't billed.

Accuracy

The location describes the network the address belongs to, not a device, a street address, or a person. The data comes from a free database, so expect region and city to be wrong more often than country. The location coordinates are a point in that area with no accuracy radius, so don't treat them as a precise position.

Privacy

Mapricot doesn't write the IP addresses you look up to usage records or logs.

Data and attribution

Locations come from DB-IP City Lite, licensed under CC BY 4.0 and updated monthly. datasetRelease names the month in use. If your app shows these locations to people, credit DB-IP with a link to attributionUrl and the license.

See the API reference for errors and limits.