---
title: "Search and geocoding API"
description: "Forward and reverse geocoding API for global location search."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Search and geocoding API

The MapTiler **Search and geocoding API** makes it possible to search for any place on Earth and get accurate location data in return. See the [intro to place search](https://docs.maptiler.com/guides/developer/location-services/geocoding-search/) to learn how it works and what you can use it for.

## How to use the API

-   Directly from your web or backend applications.
-   Via the [Geocoding API client](https://docs.maptiler.com/client-js/api/variables/services_geocoding.geocoding/) library, which wraps the API calls in ready-made functions for easier use in JavaScript. The client library is a good choice for JavaScript if you only need to use geocoding but not a map.
-   With our complete **MapTiler SDK JS** which provides a [geocoding control module](https://docs.maptiler.com/sdk-js/modules/geocoding/) to quickly integrate place search into your application. The SDK is best if you need the geocoding functionality plus a complete map dev kit, or if you want more favorable usage tracking [via **sessions** rather than API requests](https://docs.maptiler.com/guides/account/sessions-vs-requests/).
-   With other JavaScript libraries: [MapLibre GL JS](https://docs.maptiler.com/maplibre/examples/geocoding-control/) • [Leaflet](https://docs.maptiler.com/leaflet/examples/geocoding-control/) • [OpenLayers](https://docs.maptiler.com/openlayers/examples/geocoding-control/)
-   Without a map: [Vanilla JS](https://docs.maptiler.com/sdk-js/examples/geocoding-vanilla-js/)

Key

You need a **MapTiler API key** to use this service. [Get it here](https://cloud.maptiler.com/account/keys/) and [learn how to secure it](https://docs.maptiler.com/guides/developer/credentials/api-key/#secure-key).

## Getting started

For practical guidance on how to use this API, check out:

-   Check the [geocoding playground](https://www.maptiler.com/showcase/geocoding/) to see how to construct the API calls
-   Explanation and usage tips for the most used [search parameters](https://docs.maptiler.com/guides/developer/location-services/geocoding-search/parameters)

### Basic example

```js
import { geocoding } from "@maptiler/client";

// in an async function, or as a 'thenable':
const result = await geocoding.forward("paris");
```

## Geocoding API reference

  Scalar API Reference

-   [
    
    Introduction
    
    ](#description/introduction)
-   [
    
    Geocoding
    
    ](#tag/geocoding)
    
    Close Group - Geocoding
    
    -   [
        
        Search by name (forward)
        
        HTTP Method:  GET](#tag/geocoding/GET/geocoding/{query}.json)
    -   [
        
        Search by coordinates (reverse)
        
        HTTP Method:  GET](#tag/geocoding/GET/geocoding/{longitude},{latitude}.json)
    -   [
        
        Search by feature ID
        
        HTTP Method:  GET](#tag/geocoding/GET/geocoding/{id}.json)
    -   [
        
        Batch geocoding API
        
        HTTP Method:  GET](#tag/geocoding/GET/geocoding/{queries}.json)

[Powered by Scalar](https://www.scalar.com)

v1.0

OpenAPI 3.1.0

# MapTiler API

[Support](mailto:support@maptiler.com)

[](https://docs.maptiler.com/support/requests/)

[Terms of Service](https://www.maptiler.com/terms/)

Server

Server:https://api.maptiler.com

MapTiler API

## 

AuthenticationRequired

Selected Auth Type: key

<table class="mb-0 grid min-h-8 auto-rows-auto" role="presentation" style="grid-template-columns:1fr;"><tbody><tr class="group contents"><td class="box-content min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r flex text-base/5 last:border-r-0 group-last:border-b-transparent p-0 m-0 relative max-h-[auto] group-[.alert]:bg-b-alert group-[.error]:bg-b-danger" style="" aria-label="Your own API key from https://cloud.maptiler.com/"><div class="group/summary flex gap-0.5 flex-row items-baseline auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25" style=""><div class="markdown line-clamp-(--markdown-clamp) markdown-summary truncate" style="--markdown-clamp:1;" controlled="false" modelvalue="false" truncated="false" id="scalar-refs-0-9"><p>Your own API key from <a href="https://cloud.maptiler.com/" rel="nofollow" target="_blank">https://cloud.maptiler.com/</a></p></div></div></td></tr><tr class="group contents"><td class="box-content max-h-8 min-h-8 min-w-8 border-l-0 border-b-0 border-r text-base/5 last:border-r-0 group-last:border-b-transparent p-0 m-0 relative flex border-t group-[.alert]:bg-b-alert group-[.error]:bg-b-danger" style="" data-v-a6f4752a=""><div class="text-c-1 flex items-center pr-0 pl-3" for="scalar-refs-0-10" data-v-a6f4752a=""><label for="scalar-refs-0-10">Name </label>:</div><div class="relative flex min-w-0 flex-1" data-v-a6f4752a=""><div id="scalar-refs-0-10" class="text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1 code-input-lite group/code-input-lite peer relative w-full leading-[1.44] -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline code-input-lite--empty" data-v-4dfd05a3=""><div aria-autocomplete="list" class="code-input-lite__editor" contenteditable="true" data-placeholder="api-key" role="combobox" spellcheck="false" data-v-4dfd05a3=""></div></div></div><button aria-disabled="false" type="button" class="scalar-icon-button grid aspect-square cursor-pointer scalar-button-ghost bg-transparent text-c-2 active:text-c-1 hover:text-c-1 size-8 m-1 -outline-offset-2 rounded-lg -ml-.25 h-6 w-6 self-center p-1.25" style="" data-v-a6f4752a=""><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" width="1em" height="1em" aria-hidden="true" role="presentation" class="size-full" style=""><g><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path></g></svg><span class="sr-only">Clear Value</span></button></td></tr><tr class="group contents"><td class="box-content max-h-8 min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r text-base/5 last:border-r-0 group-last:border-b-transparent p-0 m-0 relative flex group-[.alert]:bg-b-alert group-[.error]:bg-b-danger" style="" data-v-a6f4752a=""><div class="text-c-1 flex items-center pr-0 pl-3" for="scalar-refs-0-11" data-v-a6f4752a=""><label for="scalar-refs-0-11">Value </label>:</div><div class="relative flex min-w-0 flex-1" data-v-a6f4752a=""><input placeholder="QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT" id="scalar-refs-0-11" autocomplete="off" class="text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1 scalar-password-input" data-1p-ignore="" spellcheck="false" type="text" value="YOUR_MAPTILER_API_KEY" data-v-a6f4752a=""></div><button aria-disabled="false" type="button" class="scalar-icon-button grid aspect-square cursor-pointer scalar-button-ghost bg-transparent text-c-2 active:text-c-1 hover:text-c-1 size-8 m-1 -outline-offset-2 rounded-lg -ml-.25 h-6 w-6 self-center p-1.25" style="" data-v-a6f4752a=""><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" width="1em" height="1em" aria-hidden="true" role="presentation" class="size-full" style=""><g><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path></g></svg><span class="sr-only">Clear Value</span></button><button aria-disabled="false" type="button" class="scalar-icon-button grid aspect-square cursor-pointer scalar-button-ghost bg-transparent text-c-2 active:text-c-1 hover:text-c-1 size-8 m-1 -outline-offset-2 rounded-lg -ml-.5 mr-1.25 h-6 w-6 self-center p-1.25" style="" data-testid="data-table-password-toggle" data-v-a6f4752a=""><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" width="1em" height="1em" aria-hidden="true" role="presentation" class="size-full" style=""><g><path d="M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"></path></g></svg><span class="sr-only">Show Password</span></button></td></tr></tbody></table>

Client Libraries

Shell

Ruby

Node.js

PHP

Python

MoreSelect from all clients

Shell Curl

## Geocoding

​Copy link

Geocoding Operations

-   get/geocoding/{query}.json
-   get/geocoding/{longitude},{latitude}.json
-   get/geocoding/{id}.json
-   get/geocoding/{queries}.json

### Search by name (forward)

​Copy link

Auth Required

Forward [geocoding (search by place name)](https://www.maptiler.com/cloud/geocoding/).

Path Parameters

-   queryCopy link to query
    
    Type: string
    
    required
    
    Examples
    
    Zurichrestaurant mediterranean
    
    Place name to search. You can also use bare [POI category](https://docs.maptiler.com/guides/location-services/geocoding-search/poi-category/) or mix it with a name to search for POIs of desired category, unless `poi` index is excluded.
    

Query Parameters

-   bboxCopy link to bbox
    
    Type: array · bbox
    
    Example
    
    \[5.9559, 45.818, 10.4921, 47.8084\]
    
    Example
    
    5.9559,45.818,10.4921,47.8084
    
    A `[w, s, e, n]` bounding box array to use for limiting search results. Only features inside the provided bounding box will be included.
    
-   proximityCopy link to proximity
    
    A `[lon, lat]` array to use for biasing search results or the string `ip` to do server-side IP based geolocation. Specify to prefer results close to a specific location - features closer to the proximity value will be given priority over those further from the proximity value.
    
    Any ofCoordinates
    
    -   Type: array · Coordinates
        
        Example
        
        \[8.528509, 47.3774434\]
        
        Example
        
        8.528509,47.3774434
        
    
-   languageCopy link to language
    
    Type: array string\[\] …20 unique!enum
    
    Example
    
    de,en
    
    Example
    
    de,en
    
    Prefer results in specific language specified as ISO 639-1 code. Only the first language code is used when prioritizing forward geocode results to be matched. If this query parameter is omited then Accept-Language HTTP header will be analyzed. If the parameter is provided but is empty then no language preference is made.
    
    values
    
    -   aa
        
    -   ab
        
    -   ae
        
    -   af
        
    -   ak
        
    -   Show all values
    
-   countryCopy link to country
    
    Type: array string\[\] unique!
    
    Example
    
    sk,cz
    
    Example
    
    sk,cz
    
    Limit search to specific country/countries.
    
-   limitCopy link to limit
    
    Type: integer
    
    min:  
    
    1
    
    max:  
    
    10
    
    Maximum number of results. Default: 5 for forward geocoding, 1 for reverse geocoding. For reverse geocoding, limit > 1 requires exactly one `types` value and switches to a nearest-neighbour search (N closest features of that type within 1 km). Without limit, reverse geocoding returns a single best match per layer at the queried point
    
-   typesCopy link to types
    
    Type: array string\[\] · PlaceType\[\] unique!enum
    
    Filter types of which features to return. If not specified, default configuration of API is used (see [PlaceTypeValues](https://docs.maptiler.com/cloud/api/geocoding/#PlaceTypeValues) for the list). In case of reverse geocoding if just a single type is specified, then multiple nearby features of the single `type` can be returned, otherwise single feature for every specified type (or default types) can be returned - see also the [limit](#limit) parameter.
    
    -   Type: string · PlaceTypeenum
        
        Check out the [descriptions and default values](https://docs.maptiler.com/guides/location-services/geocoding-search/place-types-values/) of each of the PlaceType values
        
        values
        
        -   continental\_marine
            
        -   country
            
        -   major\_landform
            
        -   region
            
        -   subregion
            
        -   Show all values
        
    
-   excludeTypesCopy link to excludeTypes
    
    Type: boolean
    
    Default
    
    false
    
    Set to `true` to use all available feature types except those specified in `types`.
    
-   fuzzyMatchCopy link to fuzzyMatch
    
    Type: boolean
    
    Default
    
    true
    
    Set to `false` to disable fuzzy search.
    
-   autocompleteCopy link to autocomplete
    
    Type: boolean
    
    Set to `true` to use autocomplete, `false` to disable autocomplete.
    
-   worldviewCopy link to worldview
    
    Type: string enum
    
    Example
    
    ch
    
    Example
    
    ch
    
    Some of the geographical boundaries and names are disputed. When `worldview` option is selected, the Geocoding API responses will be aligned with the borders and names recognized by the selected country (e.g., US or Switzerland). This affects filtering by country, the context returned with the given feature and also some of the labels (e.g., Gulf of Mexico vs. Gulf of America). Special values include: `auto` - the worldview is determined by the location of the client, `default` - disputed areas are returned without country information, countries with disputed borders are returned without full geometry.
    
    values
    
    -   default
        
    -   auto
        
    -   ae
        
    -   ch
        
    -   jp
        
    -   kr
        
    -   us
        
    

Responses

-   200
    
    Search result represented as FeatureCollection where every item is represented as a GeoJSON Feature
    
    application/json
    
-   400
    
    Query too long / Invalid parameters
    
-   403
    
    Key is missing, invalid or restricted
    

Request Example for get/geocoding/_{query}_.json

Shell Curl

```curl
curl 'https://api.maptiler.com/geocoding/Zurich.json?key=YOUR_MAPTILER_API_KEY'
```

Copy

Copy

Test Request(get /geocoding/{query}.json)

Status: 200Status: 400Status: 403

Show Schema 

```json
{
  "type": "FeatureCollection",
  "features": [
    {
      "id": "municipality.46425",
      "text": "Paris",
      "language": "en",
      "^text_(\\w\\w)": "string",
      "^language_(\\w\\w)": "string",
      "additionalProperty": "anything",
      "type": "Feature",
      "properties": {
        "ref": "osm:r71525",
        "country_code": "fr",
        "kind": "road",
        "categories": [
          "restaurant"
        ],
        "feature_tags": {
          "additionalProperty": "string"
        },
        "place_designation": "city",
        "additionalProperty": "anything"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          8.528509,
          47.3774434
        ]
      },
      "bbox": [
        5.9559,
        45.818,
        10.4921,
        47.8084
      ],
      "center": [
        8.528509,
        47.3774434
      ],
      "place_name": "string",
      "matching_place_name": "string",
      "matching_text": "string",
      "place_type": [
        "continental_marine"
      ],
      "place_type_name": [
        "string"
      ],
      "relevance": 1,
      "context": [
        {
          "ref": "osm:r71525",
          "country_code": "fr",
          "kind": "road",
          "categories": [
            "restaurant"
          ],
          "feature_tags": {
            "additionalProperty": "string"
          },
          "place_designation": "city",
          "additionalProperty": "anything",
          "id": "municipality.46425",
          "text": "Paris",
          "language": "en",
          "^text_(\\w\\w)": "string",
          "^language_(\\w\\w)": "string"
        }
      ],
      "address": "string",
      "^place_name_(\\w\\w)": "string"
    }
  ],
  "query": [
    "string"
  ],
  "attribution": "<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>"
}
```

JSONCopy

JSONCopy

Search result represented as FeatureCollection where every item is represented as a GeoJSON Feature

### Search by coordinates (reverse)

​Copy link

Auth Required

Reverse geocoding (search by coordinates).

Path Parameters

-   longitudeCopy link to longitude
    
    Type: number
    
    min:  
    
    \-180
    
    max:  
    
    180
    
    required
    
    Example
    
    8.528509
    
-   latitudeCopy link to latitude
    
    Type: number
    
    min:  
    
    \-90
    
    max:  
    
    90
    
    required
    
    Example
    
    47.3774434
    

Query Parameters

-   languageCopy link to language
    
    Type: array string\[\] …20 unique!enum
    
    Example
    
    de,en
    
    Example
    
    de,en
    
    Prefer results in specific language specified as ISO 639-1 code. Only the first language code is used when prioritizing forward geocode results to be matched. If this query parameter is omited then Accept-Language HTTP header will be analyzed. If the parameter is provided but is empty then no language preference is made.
    
    values
    
    -   aa
        
    -   ab
        
    -   ae
        
    -   af
        
    -   ak
        
    -   Show all values
    
-   limitCopy link to limit
    
    Type: integer
    
    min:  
    
    1
    
    max:  
    
    10
    
    Maximum number of results. Default: 5 for forward geocoding, 1 for reverse geocoding. For reverse geocoding, limit > 1 requires exactly one `types` value and switches to a nearest-neighbour search (N closest features of that type within 1 km). Without limit, reverse geocoding returns a single best match per layer at the queried point
    
-   typesCopy link to types
    
    Type: array string\[\] · PlaceType\[\] unique!enum
    
    Filter types of which features to return. If not specified, default configuration of API is used (see [PlaceTypeValues](https://docs.maptiler.com/cloud/api/geocoding/#PlaceTypeValues) for the list). In case of reverse geocoding if just a single type is specified, then multiple nearby features of the single `type` can be returned, otherwise single feature for every specified type (or default types) can be returned - see also the [limit](#limit) parameter.
    
    -   Type: string · PlaceTypeenum
        
        Check out the [descriptions and default values](https://docs.maptiler.com/guides/location-services/geocoding-search/place-types-values/) of each of the PlaceType values
        
        values
        
        -   continental\_marine
            
        -   country
            
        -   major\_landform
            
        -   region
            
        -   subregion
            
        -   Show all values
        
    
-   excludeTypesCopy link to excludeTypes
    
    Type: boolean
    
    Default
    
    false
    
    Set to `true` to use all available feature types except those specified in `types`.
    
-   worldviewCopy link to worldview
    
    Type: string enum
    
    Example
    
    ch
    
    Example
    
    ch
    
    Some of the geographical boundaries and names are disputed. When `worldview` option is selected, the Geocoding API responses will be aligned with the borders and names recognized by the selected country (e.g., US or Switzerland). This affects filtering by country, the context returned with the given feature and also some of the labels (e.g., Gulf of Mexico vs. Gulf of America). Special values include: `auto` - the worldview is determined by the location of the client, `default` - disputed areas are returned without country information, countries with disputed borders are returned without full geometry.
    
    values
    
    -   default
        
    -   auto
        
    -   ae
        
    -   ch
        
    -   jp
        
    -   kr
        
    -   us
        
    

Responses

-   200
    
    Search result represented as FeatureCollection where every item is represented as a GeoJSON Feature
    
    application/json
    
-   400
    
    Query too long / Invalid parameters
    
-   403
    
    Key is missing, invalid or restricted
    

Request Example for get/geocoding/_{longitude}_,_{latitude}_.json

Shell Curl

```curl
curl 'https://api.maptiler.com/geocoding/8.528509,47.3774434.json?key=YOUR_MAPTILER_API_KEY'
```

Copy

Copy

Test Request(get /geocoding/{longitude},{latitude}.json)

Status: 200Status: 400Status: 403

Show Schema 

```json
{
  "type": "FeatureCollection",
  "features": [
    {
      "id": "municipality.46425",
      "text": "Paris",
      "language": "en",
      "^text_(\\w\\w)": "string",
      "^language_(\\w\\w)": "string",
      "additionalProperty": "anything",
      "type": "Feature",
      "properties": {
        "ref": "osm:r71525",
        "country_code": "fr",
        "kind": "road",
        "categories": [
          "restaurant"
        ],
        "feature_tags": {
          "additionalProperty": "string"
        },
        "place_designation": "city",
        "additionalProperty": "anything"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          8.528509,
          47.3774434
        ]
      },
      "bbox": [
        5.9559,
        45.818,
        10.4921,
        47.8084
      ],
      "center": [
        8.528509,
        47.3774434
      ],
      "place_name": "string",
      "matching_place_name": "string",
      "matching_text": "string",
      "place_type": [
        "continental_marine"
      ],
      "place_type_name": [
        "string"
      ],
      "relevance": 1,
      "context": [
        {
          "ref": "osm:r71525",
          "country_code": "fr",
          "kind": "road",
          "categories": [
            "restaurant"
          ],
          "feature_tags": {
            "additionalProperty": "string"
          },
          "place_designation": "city",
          "additionalProperty": "anything",
          "id": "municipality.46425",
          "text": "Paris",
          "language": "en",
          "^text_(\\w\\w)": "string",
          "^language_(\\w\\w)": "string"
        }
      ],
      "address": "string",
      "^place_name_(\\w\\w)": "string"
    }
  ],
  "query": [
    "string"
  ],
  "attribution": "<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>"
}
```

JSONCopy

JSONCopy

Search result represented as FeatureCollection where every item is represented as a GeoJSON Feature

### Search by feature ID

​Copy link

Auth Required

Search feature by its ID (`id`) as returned in forward or reverse geocoding response and return its full geometry. Note that the feature ID is not stable and it changes when the database is re-indexed.

Path Parameters

-   idCopy link to id
    
    Type: string
    
    required
    
    Pattern
    
    `^(\S+)\.([0-9]+)$`
    
    Example
    
    country.26561650
    
    Feature ID (found in response of forward or reverse geocoding)
    

Query Parameters

-   languageCopy link to language
    
    Type: array string\[\] …20 unique!enum
    
    Example
    
    de,en
    
    Example
    
    de,en
    
    Prefer results in specific language specified as ISO 639-1 code. Only the first language code is used when prioritizing forward geocode results to be matched. If this query parameter is omited then Accept-Language HTTP header will be analyzed. If the parameter is provided but is empty then no language preference is made.
    
    values
    
    -   aa
        
    -   ab
        
    -   ae
        
    -   af
        
    -   ak
        
    -   Show all values
    
-   worldviewCopy link to worldview
    
    Type: string enum
    
    Example
    
    ch
    
    Example
    
    ch
    
    Some of the geographical boundaries and names are disputed. When `worldview` option is selected, the Geocoding API responses will be aligned with the borders and names recognized by the selected country (e.g., US or Switzerland). This affects filtering by country, the context returned with the given feature and also some of the labels (e.g., Gulf of Mexico vs. Gulf of America). Special values include: `auto` - the worldview is determined by the location of the client, `default` - disputed areas are returned without country information, countries with disputed borders are returned without full geometry.
    
    values
    
    -   default
        
    -   auto
        
    -   ae
        
    -   ch
        
    -   jp
        
    -   kr
        
    -   us
        
    

Responses

-   200
    
    Search result represented as FeatureCollection where every item is represented as a GeoJSON Feature
    
    application/json
    
-   400
    
    Query too long / Invalid parameters
    
-   403
    
    Key is missing, invalid or restricted
    

Request Example for get/geocoding/_{id}_.json

Shell Curl

```curl
curl 'https://api.maptiler.com/geocoding/country.26561650.json?key=YOUR_MAPTILER_API_KEY'
```

Copy

Copy

Test Request(get /geocoding/{id}.json)

Status: 200Status: 400Status: 403

Show Schema 

```json
{
  "type": "FeatureCollection",
  "features": [
    {
      "id": "municipality.46425",
      "text": "Paris",
      "language": "en",
      "^text_(\\w\\w)": "string",
      "^language_(\\w\\w)": "string",
      "additionalProperty": "anything",
      "type": "Feature",
      "properties": {
        "ref": "osm:r71525",
        "country_code": "fr",
        "kind": "road",
        "categories": [
          "restaurant"
        ],
        "feature_tags": {
          "additionalProperty": "string"
        },
        "place_designation": "city",
        "additionalProperty": "anything"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          8.528509,
          47.3774434
        ]
      },
      "bbox": [
        5.9559,
        45.818,
        10.4921,
        47.8084
      ],
      "center": [
        8.528509,
        47.3774434
      ],
      "place_name": "string",
      "matching_place_name": "string",
      "matching_text": "string",
      "place_type": [
        "continental_marine"
      ],
      "place_type_name": [
        "string"
      ],
      "relevance": 1,
      "context": [
        {
          "ref": "osm:r71525",
          "country_code": "fr",
          "kind": "road",
          "categories": [
            "restaurant"
          ],
          "feature_tags": {
            "additionalProperty": "string"
          },
          "place_designation": "city",
          "additionalProperty": "anything",
          "id": "municipality.46425",
          "text": "Paris",
          "language": "en",
          "^text_(\\w\\w)": "string",
          "^language_(\\w\\w)": "string"
        }
      ],
      "address": "string",
      "^place_name_(\\w\\w)": "string"
    }
  ],
  "query": [
    "string"
  ],
  "attribution": "<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>"
}
```

JSONCopy

JSONCopy

Search result represented as FeatureCollection where every item is represented as a GeoJSON Feature

### Batch geocoding API

​Copy link

Auth Required

Perform geocoding of more than one request in a single API call. Check out the [Batch Geocoding guide](https://docs.maptiler.com/guides/geocoding/batch-geocoding-api/) for an example.

Path Parameters

-   queriesCopy link to queries
    
    Type: string
    
    required
    
    Example
    
    Paris;Berlin
    
    Semicolon-separated list of queries. Semicolon `;` must be provided verbatim and not be URL-encoded. Each query may be forward, reverse or by feature ID. Maximum of 50 queries are supported.
    

Query Parameters

-   bboxCopy link to bbox
    
    Type: array · bbox
    
    Example
    
    \[5.9559, 45.818, 10.4921, 47.8084\]
    
    Example
    
    5.9559,45.818,10.4921,47.8084
    
    A `[w, s, e, n]` bounding box array to use for limiting search results. Only features inside the provided bounding box will be included.
    
-   proximityCopy link to proximity
    
    A `[lon, lat]` array to use for biasing search results or the string `ip` to do server-side IP based geolocation. Specify to prefer results close to a specific location - features closer to the proximity value will be given priority over those further from the proximity value.
    
    Any ofCoordinates
    
    -   Type: array · Coordinates
        
        Example
        
        \[8.528509, 47.3774434\]
        
        Example
        
        8.528509,47.3774434
        
    
-   languageCopy link to language
    
    Type: array string\[\] …20 unique!enum
    
    Example
    
    de,en
    
    Example
    
    de,en
    
    Prefer results in specific language specified as ISO 639-1 code. Only the first language code is used when prioritizing forward geocode results to be matched. If this query parameter is omited then Accept-Language HTTP header will be analyzed. If the parameter is provided but is empty then no language preference is made.
    
    values
    
    -   aa
        
    -   ab
        
    -   ae
        
    -   af
        
    -   ak
        
    -   Show all values
    
-   countryCopy link to country
    
    Type: array string\[\] unique!
    
    Example
    
    sk,cz
    
    Example
    
    sk,cz
    
    Limit search to specific country/countries.
    
-   limitCopy link to limit
    
    Type: integer
    
    min:  
    
    1
    
    max:  
    
    10
    
    Maximum number of results. Default: 5 for forward geocoding, 1 for reverse geocoding. For reverse geocoding, limit > 1 requires exactly one `types` value and switches to a nearest-neighbour search (N closest features of that type within 1 km). Without limit, reverse geocoding returns a single best match per layer at the queried point
    
-   typesCopy link to types
    
    Type: array string\[\] · PlaceType\[\] unique!enum
    
    Filter types of which features to return. If not specified, default configuration of API is used (see [PlaceTypeValues](https://docs.maptiler.com/cloud/api/geocoding/#PlaceTypeValues) for the list). In case of reverse geocoding if just a single type is specified, then multiple nearby features of the single `type` can be returned, otherwise single feature for every specified type (or default types) can be returned - see also the [limit](#limit) parameter.
    
    -   Type: string · PlaceTypeenum
        
        Check out the [descriptions and default values](https://docs.maptiler.com/guides/location-services/geocoding-search/place-types-values/) of each of the PlaceType values
        
        values
        
        -   continental\_marine
            
        -   country
            
        -   major\_landform
            
        -   region
            
        -   subregion
            
        -   Show all values
        
    
-   excludeTypesCopy link to excludeTypes
    
    Type: boolean
    
    Default
    
    false
    
    Set to `true` to use all available feature types except those specified in `types`.
    
-   fuzzyMatchCopy link to fuzzyMatch
    
    Type: boolean
    
    Default
    
    true
    
    Set to `false` to disable fuzzy search.
    
-   autocompleteCopy link to autocomplete
    
    Type: boolean
    
    Set to `true` to use autocomplete, `false` to disable autocomplete.
    
-   worldviewCopy link to worldview
    
    Type: string enum
    
    Example
    
    ch
    
    Example
    
    ch
    
    Some of the geographical boundaries and names are disputed. When `worldview` option is selected, the Geocoding API responses will be aligned with the borders and names recognized by the selected country (e.g., US or Switzerland). This affects filtering by country, the context returned with the given feature and also some of the labels (e.g., Gulf of Mexico vs. Gulf of America). Special values include: `auto` - the worldview is determined by the location of the client, `default` - disputed areas are returned without country information, countries with disputed borders are returned without full geometry.
    
    values
    
    -   default
        
    -   auto
        
    -   ae
        
    -   ch
        
    -   jp
        
    -   kr
        
    -   us
        
    

Responses

-   200
    
    Array of geocoding results where items are matching order of queries in the request. Every result is represented as FeatureCollection where every item is represented as a GeoJSON Feature
    
    application/json
    
-   400
    
    Query too long / Invalid parameters
    
-   403
    
    Key is missing, invalid or restricted
    

Request Example for get/geocoding/_{queries}_.json

Shell Curl

```curl
curl 'https://api.maptiler.com/geocoding/Paris;Berlin.json?key=YOUR_MAPTILER_API_KEY'
```

Copy

Copy

Test Request(get /geocoding/{queries}.json)

Status: 200Status: 400Status: 403

Show Schema 

```json
[
  {
    "type": "FeatureCollection",
    "features": [
      {
        "id": "municipality.46425",
        "text": "Paris",
        "language": "en",
        "^text_(\\w\\w)": "string",
        "^language_(\\w\\w)": "string",
        "additionalProperty": "anything",
        "type": "Feature",
        "properties": {
          "ref": "osm:r71525",
          "country_code": "fr",
          "kind": "road",
          "categories": [
            "restaurant"
          ],
          "feature_tags": {
            "additionalProperty": "string"
          },
          "place_designation": "city",
          "additionalProperty": "anything"
        },
        "geometry": {
          "type": "Point",
          "coordinates": [
            8.528509,
            47.3774434
          ]
        },
        "bbox": [
          5.9559,
          45.818,
          10.4921,
          47.8084
        ],
        "center": [
          8.528509,
          47.3774434
        ],
        "place_name": "string",
        "matching_place_name": "string",
        "matching_text": "string",
        "place_type": [
          "continental_marine"
        ],
        "place_type_name": [
          "string"
        ],
        "relevance": 1,
        "context": [
          {
            "ref": "osm:r71525",
            "country_code": "fr",
            "kind": "road",
            "categories": [
              "restaurant"
            ],
            "feature_tags": {
              "additionalProperty": "string"
            },
            "place_designation": "city",
            "additionalProperty": "anything",
            "id": "municipality.46425",
            "text": "Paris",
            "language": "en",
            "^text_(\\w\\w)": "string",
            "^language_(\\w\\w)": "string"
          }
        ],
        "address": "string",
        "^place_name_(\\w\\w)": "string"
      }
    ],
    "query": [
      "string"
    ],
    "attribution": "<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>"
  }
]
```

JSONCopy

JSONCopy

Array of geocoding results where items are matching order of queries in the request. Every result is represented as FeatureCollection where every item is represented as a GeoJSON Feature

![](https://docs.maptiler.com/assets/img/open-api.png)

Using the OpenAPI Specification?

Get the [openapi.yaml](https://docs.maptiler.com/_data/cloud/api/openapi.yml)
