---
title: "IP Geolocation"
method: GET
path: "/geolocation/ip.json"
tags: ["Geolocation"]
---

# IP Geolocation

`GET /geolocation/ip.json`

## Request

- Base URL: `https://api.maptiler.com`
- URL: `https://api.maptiler.com/geolocation/ip.json`
- Auth: API key in query parameter `key`
- TypeScript: <https://skmtc.dev/maptiler/apis/maptiler-api-reference/docs/geolocation/ip.json/get.ts> (a function with typed inputs; its response is checked against the schema)

Obtain information about visitor's location based on IP address of the incoming request.

## Query parameters

- `elevation` boolean

## Response `200`

Location of the client based on the IP address of the request.

- GeolocationResult
  - `country` string: Name of the country
  - `country_code` string: Two-letter code of the country
  - `country_bounds` number[]: Bounds of the country in WGS84 degrees `[west, south, east, north]`.
  - `country_languages` string[]: Official country languages in ISO 639-1 format.
  - `continent` string: Name of the continent
  - `continent_code` string: Two-letter code of the continent
  - `eu` boolean: Indicated whether the country is part of the European Union.
  - `city` string: Name of the city
  - `latitude` number: Latitude of the location
  - `longitude` number: Longitude of the location
  - `postal` string: Postal code
  - `region` string: If known, the ISO 3166-2 name for the first level region.
  - `region_code` string: If known, the ISO 3166-2 code for the first level region.
  - `timezone` string: Name of the timezone
  - `elevation` number: Elevation of the location in meters

## Other responses

- `403`: Key is missing, invalid or restricted

---

[API](https://skmtc.dev/maptiler/apis/maptiler-api-reference.md) - [All operations](https://skmtc.dev/maptiler/apis/maptiler-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/maptiler/apis/maptiler-api-reference/revisions/68ce3046fc1a?raw)
