Search

Documentation for the Search API is also available in Japanese.

Public beta for the Search API

The Mapbox Search API is in private beta for worldwide coverage and in public beta for Japan. Unless you are part of the private beta program, the Mapbox Search API is only available for Japanese-language queries for locations in Japan.

The Mapbox Search API can be used to provide an interactive search experience for end users, or can support stand-alone forward and reverse geocoding queries.

Search API endpoints

The Search API includes six different endpoints: /suggest, /retrieve, /forward, /permanent/forward, /reverse, and /permanent/reverse.

Suggest

The /suggest endpoint is used in combination with the /retrieve endpoint to create an interactive search experience for end users. Within your application, send user searches to the /suggest endpoint. When a user selects a result on the application UI, that gets sent to the /retrieve endpoint. For more details, see the Retrieve a suggestion section of this documentation.

Retrieve

If the user selects one of the results from the /suggest endpoint, that gets sent to the /retrieve endpoint, which provides detailed information about that feature including geographic coordinates. Once a /retrieve action is taken, the Search API returns GeoJSON with coordinate information for the selected feature or features. For more details, see the Retrieve a suggested feature section of this documentation.

Forward geocoding

The /forward endpoint allows you to look up a single location by name and returns its geographic coordinates. For more details, see the Forward geocoding section of this documentation.

Permanent forward geocoding

The /permanent/forward endpoint is used for use cases that require storing position data. Like the /forward endpoint, it allows you to look up a single location by name and returns its geographic coordinates. For more details, see the Permanent forward geocoding section of this documentation.

Reverse geocoding

The /reverse endpoint allows you to look up a single pair of coordinates and returns the geographic feature or features that exist at that location. For more details, see the Reverse geocoding section of this documentation.

Permanent reverse geocoding

The /permanent/reverse endpoint is used for use cases that require storing position data. Like the /reverse endpoint, it allows you to look up a single pair of coordinates and returns the geographic feature or features that exist at that location. For more details, see the Permanent reverse geocoding section of this documentation.

Administrative unit types

Various types of administrative units are available via the Search API. Any type might appear as a top-level response, as context in a top-level response, or as a filtering option using the optional types parameter. See the following table for available administrative unit types.

Administrative unit typeDescription
countryGenerally recognized countries or, in some cases like Hong Kong, an area of quasi-national administrative status that has been given a designated country code under ISO 3166-1.
regionTop-level sub-national administrative features, such as states in the United States or provinces in Canada or China.
postcodePostal codes used in country-specific national addressing systems.
districtFeatures that are smaller than top-level administrative features but typically larger than cities, in countries that use such an additional layer in postal addressing (for example, prefectures in China).
placeTypically these are cities, villages, municipalities, etc. They’re usually features used in postal addressing, and are suitable for display in ambient end-user applications where current-location context is needed (for example, in weather displays).
cityJapanese administrative unit analogous to place.
localityOfficial sub-city features present in countries where such an additional administrative layer is used in postal addressing, or where such features are commonly referred to in local parlance. Examples include city districts in Brazil and Chile and arrondissements in France.
neighborhoodColloquial sub-city features often referred to in local parlance. Unlike locality features, these typically lack official status and may lack universally agreed-upon boundaries. Not available for reverse geocoding requests.
streetThe street, with no house number.
addressIndividual residential or business addresses as a street with house number. In a Japanese context, this is the block number and the house number. All components smaller than chome are designated as an address.

Unit types available specifically for Japan

Administrative unit typeDescription
prefectureJapanese administrative unit analogous to region.
cityJapanese administrative unit analogous to place.
oazaJapanese administrative unit analogous to locality.
chomeJapanese administrative unit analogous to neighborhood. Not available for reverse geocoding requests.
blockThe block number.
addressIndividual residential or business addresses as a street with house number. In a Japanese context, this is the block number and the house number. All components smaller than chome are designated as an address.

Retrieve a suggestion

get
https://api.mapbox.com/search/v1/suggest/{search_text}

Retrieve a suggestion. This endpoint provides place predictions about what an end user is searching for, based on autocomplete of the user query. This endpoint, along with the retrieve endpoint, can be used to add autocomplete functionality to applications that include geographic searches.

POI search not available in public beta

Point of interest (POI) Search is only available to customers in private beta mode. This includes named buildings, local stores, and areas of interest such as public parks.

Required parametersTypeDescription
access_tokenstringA Mapbox access token with default permissions.
session_tokenstringA customer-provided session token value, which groups a series of requests together for billing purposes. UUIDv4 is recommended. For more information on how session_token is used to group Search API calls into one session, see the Session-based pricing section of this documentation.
search_textstringThe user's query string. The query string is limited to 120 characters.
languagestringThe ISO language code to be returned.
countrystringAn ISO 3166 alpha 2 country code.

You can further refine the results of a query to this endpoint with the following optional parameters:

Optional parametersTypeDescription
bboxnumberLimit results to only those contained within the supplied bounding box. Bounding boxes should be supplied as four numbers separated by commas, in minimum longitude,minimum latitude,maximum longitude,maximum latitude order. The bounding box cannot cross the 180th meridian.
limitintegerThe number of results to return, up to 10.
navigation_profilestringThe navigation routing profile to use. Available profiles are: driving, walking, and cycling. navigation_profile and origin are required for distance calculations.
originnumberThe location from which to calculate distance, provided as two comma-separated coordinates in longitude,latitude order. When both proximity and origin are provided, origin is interpreted as the target of a route, while proximity indicates the current user location. This parameter is required for distance-to-target estimates, but may incur additional latency.
proximitynumberBias the response to favor results that are closer to this location, provided as two comma-separated coordinates in longitude,latitude order. When both proximity and origin are provided, origin is interpreted as the target of a route, while proximity indicates the current user location.
eta_typestringUsed to estimate the time of arrival from the location specified in origin. The only allowed value for this parameter is navigation. This parameter, along with origin and navigation_profile, is required for ETA calculations. ETA calculations will incur additional latency.
typesstringLimit results to one or more types of features, provided as a comma-separated list. Pass one or more of the type names as a comma separated list. If no types are specified, all possible types may be returned. Available types are: country, region, prefecture, postcode, district, place, city, locality, oaza, neighborhood, chome, block, street, and address. See the Administrative unit types section for details about these types.

Example requests: Retrieve a suggestion

# Search for Empire State Building with limit=1

$ curl "https://api.mapbox.com/search/v1/suggest/Empire%20State%20Building?language=en&limit=1&session_token=[GENERATED-UUID]&proximity=-75.38661,39.82049&country=US&access_token=YOUR_MAPBOX_ACCESS_TOKEN"
# Search for 新橋一丁十番一号,東京都港区新橋1丁目10番1号 with limit=1

$ curl "https://api.mapbox.com/search/v1/suggest/新橋一丁十番一号,東京都港区新橋1丁目10番1号?language=ja&limit=1&session_token=[GENERATED-UUID]&proximity=13.38333,52.51667&country=JP&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

Response: Retrieve a suggestion

The response to a request to the /suggest endpoint is an array of JSON suggestion objects. A suggestion will include a result name, a short description, and additional metadata when available (such as distance to proximity point). It does not include geographic coordinates. To get coordinates, make a call to the /retrieve endpoint with the information provided in the /suggest result's "action" block. The "action" block is opaque and can be used without inspection in your application.

Using the limit parameter, you can increase the maximum number of results up to 10. Pagination is not available, but this feature may be added in a later release. There is not an option to customize the order of search results.

Each result object contains the following properties:

PropertyTypeDescription
attributionstringThe attribution data for results.
versionstringThe service version information. Include this information if you report an issue to Mapbox.
response_uuidstringThe service response identifier. Include this information if you report an issue to Mapbox.
suggestionsarray of objectsThe returned suggestion objects. See the table below for details on the properties contained by each suggestion object.

Each suggestion object contains the following properties:

PropertyTypeDescription
feature_namestringThe name of the feature.
matching_namestringThe feature name, as matched by the search algorithm.
descriptionstringAdditional details, such as city and state for addresses.
actionobjectThe action block indicates the next step to continue with this suggestion.
action.endpointstringThe endpoint to point the next request to. The current options are suggest and retrieve. The /suggest call is used when the API determines the next best option is another round of suggestions, and the /retrieve call is used when the API determines it understands what feature the user is looking for and that the user is ready for the geographic coordinates of the results.
action.methodstringThe type of HTTP methods that are allowed for the next request. Options are POST or, less commonly, GET.
action.bodyobjectThe body to pass to HTTP POST /retrieve when fetching GeoJSON.
action.multi_retrievablebooleanIndicates whether the feature can be fetched as part of a batch retrieve. Not applicable during the public beta phase.
result_typearrayThe type of result using the global context hierarchy (region, place, locality, neighborhood, address). See the Administrative unit types section for details about these types.
geometryobjectAn object describing the spatial geometry of the returned feature.
geometry.coordinatesarrayThe coordinates of the feature, formatted as [longitude,latitude].
geometry.typestringThis will always be "Point".
distancenumberAn approximate distance to the origin location, in meters. Only provided when origin and navigation_profile are used in the request.
etanumberThe estimated time of arrival from the feature to the origin point, in minutes. Only provided when eta_type, origin, and navigation_profile are used in the request. If an address is not on the road network, an ETA will not be provided.
makistringA string representing an associated Maki icon to use for this result.
languagestringAn IETF language tag indicating the language of the result.
internal_idstringID for internal metadata. This ID is not guaranteed to be stable or unique, and is not useful for development.
external_idsobjectIDs passed through from external data providers. These IDs are not guaranteed to be stable or unique, and are not useful for development.
contextarrayThe context of the feature.
context.localized_layerstringThe localized place_type. See the Administrative unit types section for details about these place types.
context.layerstringThe global place_type that corresponds to the localized place_type in context.localized_layer. See the Administrative unit types section for details about these place types.
context.namestringThe name of the feature.
metadataobjectAddress metadata fields.
metadata.iso_3166_1stringThe country code.
metadata.iso_3166_2stringThe country code and its country subdivision code.

Example responses: Retrieve a suggestion

{
  "suggestions": [
    {
      "feature_name": "Empire State Building",
      "matching_name": "Empire State Building",
      "highlighted_name": "Empire State Building",
      "description": "20 West 34th Street, New York City, New York 10118, United States of America",
      "result_type": [
        "poi"
      ],
      "language": "en",
      "action": {
        "endpoint": "retrieve",
        "method": "POST",
        "body": {
          "id": "abc123"
        },
        "multi_retrievable": true
      },
      "coordinates": "-73.985703,40.748402",
      "maki": "marker",
      "category": [
        "historic site",
        "tourist attraction",
        "monument",
        "viewpoint"
      ],
      "internal_id": "example internal id",
      "external_ids": {
        "mbx_poi": "0ad30d457a8755215c6de72a9f90e2320bb911283a32358b70b1b80ce51da099",
        "foursquare": "43695300f964a5208c291fe3",
        "federated": "poi.0ad30d457a8755215c6de72a9f90e2320bb911283a32358b70b1b80ce51da099",
        "tripadvisor": "104365"
      },
      "mapbox_id": "CkIKQDBhZDMwZDQ1N2E4NzU1MjE1YzZkZTcyYTlmOTBlMjMyMGJiOTExMjgzYTMyMzU4YjcwYjFiODBjZTUxZGEwOTk=",
      "context": [
        {
          "layer": "address",
          "localized_layer": "address",
          "name": "20 West 34th Street, New York City, NY 10001"
        },
        {
          "layer": "street",
          "localized_layer": "street",
          "name": "west 34th street"
        },
        {
          "layer": "postcode",
          "localized_layer": "postcode",
          "name": "10118"
        },
        {
          "layer": "neighborhood",
          "localized_layer": "neighborhood",
          "name": "Koreatown"
        },
        {
          "layer": "place",
          "localized_layer": "place",
          "name": "New York City"
        },
        {
          "layer": "region",
          "localized_layer": "region",
          "name": "New York"
        },
        {
          "layer": "country",
          "localized_layer": "country",
          "name": "United States of America"
        }
      ],
      "metadata": {
        "iso_3166_1": "US",
        "iso_3166_2": "US-NY"
      }
    }
  ],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "4:36ab3a1922e482256ec7ebc7069bb94f805bf5ca",
  "response_uuid": "958dc02c-fb82-4b6c-9732-4d307fb66521"
}
{
  "suggestions": [{
    "feature_name": "〒105-0004 東京都港区新橋1丁目10番1号",
    "matching_name": "〒105-0004 東京都港区新橋1丁目10番1号",
    "description": "",
    "result_type": [
      "address"
    ],
    "language": "ja",
    "action": {
      "endpoint": "retrieve",
      "method": "POST",
      "body": {
        "id": "abc123"
      },
      "multi_retrievable": false
    },
    "maki": "marker",
    "internal_id": "example internal id",
    "external_ids": {
      "service": "2wwRMXwBRYqRl13lTvTP"
    },
    "context": [{
        "layer": "block",
        "localized_layer": "block",
        "name": "10"
      },
      {
        "layer": "neighborhood",
        "localized_layer": "chome",
        "name": "1丁目"
      },
      {
        "layer": "locality",
        "localized_layer": "oaza",
        "name": "新橋"
      },
      {
        "layer": "place",
        "localized_layer": "city",
        "name": "港区"
      },
      {
        "layer": "region",
        "localized_layer": "prefecture",
        "name": "東京都"
      }
    ],
    "metadata": {
      "iso_3166_1": "jp",
      "iso_3166_2": "JP-13",
      "reading": {
        "ja_kana": "トウキョウトミナトクシンバシ",
        "ja_latin": "toukyouto minatoku shinbashi"
      }
    }
  }],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "11:061a06471ec519420eeca5be2b87e043f2fe4cbe",
  "response_uuid": "4b659949-c8c7-42d8-a541-6b427e5806cc"
}

Retrieve a suggested feature

post
https://api.mapbox.com/search/v1/retrieve/

After a successful call to the /suggest endpoint, you will use the information contained in the response's action block to retrieve detailed information about the feature. Using this endpoint requires no knowledge of what the possible parameters to pass are. Instead, you must pass information in the action block returned from the call to /suggest to this endpoint.

POI search not available in public beta

Point of interest (POI) Search is only available to customers in private beta mode. This includes named buildings, local stores, and areas of interest such as public parks.

Required parametersTypeDescription
access_tokenstringA Mapbox access token with default permissions.
session_tokenstringA customer-provided session token value, which groups a series of requests together for billing purposes. UUIDv4 is recommended. For more information on how session_token is used to group Search API calls into one session, see the Session-based pricing section of this documentation.
Request body propertiesTypeDescription
idstringThe ID of the suggestion to retrieve, taken from action.body.id in the response from the /suggest endpoint.

Example request: Retrieve a suggested feature

POST /search/v1/retrieve?session_token=[GENERATED-UUID]&access_token=YOUR_MAPBOX_ACCESS_TOKEN

Example request body:

{
  "id": "12345"
}

Response: Retrieve a suggested feature

The /retrieve endpoint returns a GeoJSON FeatureCollection.

PropertyTypeDescription
typestringThis will always be "FeatureCollection".
attributionstringThe attribution data for results.
versionstringThe service version information. Include this information if you report an issue to Mapbox.
response_uuidstringThe service response identifier. Include this information if you report an issue to Mapbox.
featuresarray of objectsThe returned feature objects. See the table below for details on the properties contained by each feature object.

Each feature in the response body contains the following properties:

PropertyTypeDescription
bboxarrayA bounding box in the format minimum longitude,minimum latitude,maximum longitude,maximum latitude. Not available during the public beta phase.
geometryobjectAn object describing the spatial geometry of the returned feature.
geometry.coordinatesarrayThe coordinates of the feature, formatted as [longitude,latitude].
geometry.typestringThis will always be "Point".
typestringThis will always be "Feature".
propertiesobjectSpecific properties associated with the returned feature.
properties.makistringA string representing an associated Maki icon to use for this result.
properties.metadataobjectAddress metadata fields.
properties.metadata.iso_3166_1stringThe country code.
properties.metadata.iso_3166_2stringThe country code and its country subdivision code.
properties.addressstringFor results with an address, the locally formatted address.
properties.feature_namestringThe name of the feature.
properties.matching_namestringThe feature name, as matched by the search algorithm.
properties.internal_idstringID for internal metadata. This ID is not guaranteed to be stable or unique, and is not useful for development.
properties.external_idsobjectIDs passed through from external data providers. These IDs are not guaranteed to be stable or unique, and are not useful for development.
properties.place_typearrayThe result type. See the Administrative unit types section for details about these place types.
properties.languagestringThe IETF language tag.
properties.address_numberstringThe house number for address objects.
properties.contextarray of objectsThe context of the feature.
properties.context.localized_layerstringThe localized place_type. See the Administrative unit types section for details about these place types.
properties.context.layerstringThe global place_type that corresponds to the localized properties.place_type in context.localized_layer. See the Administrative unit types section for details about these place types.
properties.context.namestringThe name of the feature.

Example responses: Retrieve a suggested feature

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          5.049746,
          51.650652
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "Efteling",
        "matching_name": "Efteling",
        "highlighted_name": "Efteling",
        "description": "Europalaan 1, 5171 RP Kaatsheuvel, Netherlands",
        "place_name": "Efteling, Europalaan 1, 5171 RP Kaatsheuvel, Netherlands",
        "id": "2xAyKYEBLMhwlZV-L0T3",
        "place_type": [
          "poi"
        ],
        "context": [
          {
            "layer": "address",
            "localized_layer": "address",
            "name": "Europalaan 1, 5171 KW Kaatsheuvel The Netherlands"
          },
          {
            "layer": "street",
            "localized_layer": "street",
            "name": "europalaan"
          },
          {
            "layer": "postcode",
            "localized_layer": "postcode",
            "name": "5171 RP"
          },
          {
            "layer": "neighborhood",
            "localized_layer": "neighborhood",
            "name": "De Klinkenpolder"
          },
          {
            "layer": "place",
            "localized_layer": "place",
            "name": "Kaatsheuvel"
          },
          {
            "layer": "country",
            "localized_layer": "country",
            "name": "Netherlands"
          }
        ],
        "maki": "marker",
        "poi_category": [
          "theme park",
          "entertainment"
        ],
        "internal_id": "example internal id",
        "external_ids": {
          "tripadvisor": "262610",
          "foursquare": "4a72b543f964a52041db1fe3",
          "federated": "poi.067e4e1ea55235c67f4601f56d2889ebf6c380220de994e902f33ab59dd988e1",
          "mbx_poi": "067e4e1ea55235c67f4601f56d2889ebf6c380220de994e902f33ab59dd988e1"
        },
        "mapbox_id": "CkIKQDA2N2U0ZTFlYTU1MjM1YzY3ZjQ2MDFmNTZkMjg4OWViZjZjMzgwMjIwZGU5OTRlOTAyZjMzYWI1OWRkOTg4ZTE=",
        "metadata": {
          "review_count": 7787,
          "phone": "+31 416 537 777",
          "website": "http://www.efteling.com/",
          "average_rating": 4.5,
          "detailed_description": "Discover Holland's hidden gem. Efteling is a unique theme park with a fairytale atmosphere, natural surroundings and a wide range of thrilling and enchanting attractions, making it the ideal family short-break destination!",
          "primary_photo": [
            {
              "width": 50,
              "height": 50,
              "url": "https://media-cdn.tripadvisor.com/media/photo-t/12/5b/6f/3c/efteling-the-magic-land.jpg"
            },
            {
              "width": 150,
              "height": 150,
              "url": "https://media-cdn.tripadvisor.com/media/photo-l/12/5b/6f/3c/efteling-the-magic-land.jpg"
            },
            {
              "width": 250,
              "height": 188,
              "url": "https://media-cdn.tripadvisor.com/media/photo-f/12/5b/6f/3c/efteling-the-magic-land.jpg"
            },
            {
              "width": 550,
              "height": 413,
              "url": "https://media-cdn.tripadvisor.com/media/photo-s/12/5b/6f/3c/efteling-the-magic-land.jpg"
            },
            {
              "width": 960,
              "height": 720,
              "url": "https://media-cdn.tripadvisor.com/media/photo-o/12/5b/6f/3c/efteling-the-magic-land.jpg"
            }
          ],
          "open_hours": {
            "open_type": "Scheduled",
            "open_periods": [
              {
                "open": {
                  "day": 0,
                  "time": {
                    "hour": 11,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 0,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              },
              {
                "open": {
                  "day": 1,
                  "time": {
                    "hour": 11,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 1,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              },
              {
                "open": {
                  "day": 2,
                  "time": {
                    "hour": 11,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 2,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              },
              {
                "open": {
                  "day": 3,
                  "time": {
                    "hour": 11,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 3,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              },
              {
                "open": {
                  "day": 4,
                  "time": {
                    "hour": 11,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 4,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              },
              {
                "open": {
                  "day": 5,
                  "time": {
                    "hour": 10,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 5,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              },
              {
                "open": {
                  "day": 6,
                  "time": {
                    "hour": 10,
                    "minute": 0
                  }
                },
                "close": {
                  "day": 6,
                  "time": {
                    "hour": 18,
                    "minute": 0
                  }
                }
              }
            ]
          },
          "iso_3166_1": "NL",
          "iso_3166_2": "NL-NB"
        }
      }
    }
  ],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "4:36ab3a1922e482256ec7ebc7069bb94f805bf5ca",
  "response_uuid": "fcdd5da0-2bb2-48ac-bf73-8da68fffc5ac"
}
{
  "type": "FeatureCollection",
  "features": [{
    "type": "Feature",
    "geometry": {
      "coordinates": [
        139.7596417,
        35.6675028
      ],
      "type": "Point"
    },
    "properties": {
      "feature_name": "〒105-0004 東京都港区新橋1丁目10番1号",
      "matching_name": "〒105-0004 東京都港区新橋1丁目10番1号",
      "description": "",
      "place_name": "〒105-0004 東京都港区新橋1丁目10番1号",
      "id": "2wwRMXwBRYqRl13lTvTP",
      "place_type": [
        "address"
      ],
      "context": [{
          "layer": "block",
          "localized_layer": "block",
          "name": "10"
        },
        {
          "layer": "chome",
          "localized_layer": "chome",
          "name": "1丁目"
        },
        {
          "layer": "oaza",
          "localized_layer": "oaza",
          "name": "新橋"
        },
        {
          "layer": "city",
          "localized_layer": "city",
          "name": "港区"
        },
        {
          "layer": "prefecture",
          "localized_layer": "prefecture",
          "name": "東京都"
        }
      ],
      "language": "ja",
      "maki": "marker",
      "internal_id": "example internal id",
      "external_ids": {
        "japan_address": "2wwRMXwBRYqRl13lTvTP"
      },
      "accuracy": "rooftop",
      "address": "〒105-0004 東京都港区新橋1丁目10番1号",
      "address_number": "1",
      "metadata": {
        "iso_3166_1": "jp",
        "iso_3166_2": "JP-13",
        "reading": {
          "ja_kana": "トウキョウトミナトクシンバシ",
          "ja_latin": "toukyouto minatoku shinbashi"
        }
      }
    }
  }],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "11:061a06471ec519420eeca5be2b87e043f2fe4cbe",
  "response_uuid": "55491b50-f5df-4725-aeb1-3e8ed4a07b17"
}

Forward geocoding

get
https://api.mapbox.com/search/v1/forward/{search_text}

Retrieve detailed information about a specific feature, including geographic coordinates, in response to a user query.

POI search not available in public beta

Point of interest (POI) Search is only available to customers in private beta mode. This includes named buildings, local stores, and areas of interest such as public parks.

Required parametersTypeDescription
access_tokenstringA Mapbox access token with default permissions.
search_textstringThe user's query string. The query string is limited to 120 characters.
languagestringThe ISO language code to be returned.
countrystringAn ISO 3166 alpha 2 country code.

You can further refine the results of a query to this endpoint with the following optional parameters:

Optional parametersTypeDescription
bboxnumberLimit results to only those contained within the supplied bounding box. Bounding boxes should be supplied as four numbers separated by commas, in minimum longitude,minimum latitude,maximum longitude,maximum latitude order. The bounding box cannot cross the 180th meridian.
limitintegerThe number of results to return, up to 10.
navigation_profilestringThe navigation routing profile to use. Available profiles are: driving, walking, and cycling. navigation_profile and origin are required for distance calculations.
proximitynumberBias the response to favor results that are closer to this location, provided as two comma-separated coordinates in longitude,latitude order. When both proximity and origin are provided, origin is interpreted as the target of a route, while proximity indicates the current user location.
typesstringLimit results to one or more types of features, provided as a comma-separated list. Pass one or more of the type names as a comma separated list. If no types are specified, all possible types may be returned. Available types are: country, region, prefecture, postcode, district, place, city, locality, oaza, neighborhood, chome, block, street, and address. See the Administrative unit types section for details about these types.

Example requests: Forward geocoding


$ curl "https://api.mapbox.com/search/v1/forward/34170%20Gannon%20Terrace?language=en&limit=1&proximity=-121.90662,37.42827&country=US&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

$ curl "https://api.mapbox.com/search/v1/forward/新橋一丁十番一号,東京都港区新橋1丁目10番1号?language=ja&limit=1&proximity=13.38333,52.51667&country=JP&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

Permanent forward geocoding

get
https://api.mapbox.com/search/v1/permanent/forward/{search_text}

The Mapbox Terms of Service state that all data returned by the /suggest, /retrieve, /forward, or /reverse endpoints is only available for temporary use. If your use case requires storing position data, contact Mapbox sales. This is consistent with the Terms of Service for Mapbox Geocoding API calls made to the mapbox.places-permanent endpoint.

The /permanent/forward endpoint takes the same path and query parameters as the /forward endpoint.

Response: Forward geocoding

The response to a request to the /forward endpoint is a GeoJSON FeatureCollection.

Using the limit parameter, you can increase the maximum number of results up to 10. Pagination is not available, but this feature may be added in a later release. There is not an option to customize the order of search results.

PropertyTypeDescription
typestringThis will always be "FeatureCollection".
attributionstringThe attribution data for results.
versionstringThe service version information. Include this information if you report an issue to Mapbox.
response_uuidstringThe service response identifier. Include this information if you report an issue to Mapbox.
featuresarray of objectsThe returned feature objects. See the table below for details on the properties contained by each feature object.

Each feature in the response body contains the following properties:

PropertyTypeDescription
bboxarrayA bounding box in the format minimum longitude,minimum latitude,maximum longitude,maximum latitude. Not available during the public beta phase.
geometryobjectAn object describing the spatial geometry of the returned feature.
geometry.coordinatesarrayThe coordinates of the feature, formatted as [longitude,latitude].
geometry.typestringThis will always be "Point".
typestringThis will always be "Feature".
propertiesobjectSpecific properties associated with the returned feature.
properties.makistringA string representing an associated Maki icon to use for this result.
properties.metadataobjectAddress metadata fields.
properties.metadata.iso_3166_1stringThe country code.
properties.metadata.iso_3166_2stringThe country code and its country subdivision code.
properties.addressstringFor results with an address, the locally formatted address.
properties.address_numberstringThe house number for address objects.
properties.feature_namestringThe name of the feature.
properties.matching_namestringThe feature name, as matched by the search algorithm.
properties.place_typearrayThe result type. See the Administrative unit types section for details about these place types.
properties.languagestringThe IETF language tag.
properties.internal_idstringID for internal metadata. This ID is not guaranteed to be stable or unique, and is not useful for development.
properties.external_idsobjectIDs passed through from external data providers. These IDs are not guaranteed to be stable or unique, and are not useful for development.
properties.contextarray of objectsThe context of the feature.
properties.context.localized_layerstringThe localized place_type. See the Administrative unit types section for details about these place types.
properties.context.layerstringThe global place_type that corresponds to the localized properties.place_type in context.localized_layer. See the Administrative unit types section for details about these place types.
properties.context.namestringThe name of the feature.

Example responses: Forward geocoding

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          -122.05963,
          37.56153
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "34170 Gannon Terrace",
        "matching_name": "34170 Gannon Terrace",
        "highlighted_name": "34170 Gannon Terrace",
        "description": "Fremont, California 94555, United States",
        "place_name": "34170 Gannon Terrace, Fremont, California 94555, United States",
        "id": "address.1556645983160292",
        "place_type": [
          "address"
        ],
        "context": [
          {
            "layer": "neighborhood.7327715941516860",
            "localized_layer": "neighborhood.7327715941516860",
            "name": "Ardenwood"
          },
          {
            "layer": "postcode.11243426117484610",
            "localized_layer": "postcode.11243426117484610",
            "name": "94555"
          },
          {
            "layer": "place.11532961120628200",
            "localized_layer": "place.11532961120628200",
            "name": "Fremont"
          },
          {
            "layer": "district.11187960009291250",
            "localized_layer": "district.11187960009291250",
            "name": "Alameda County"
          },
          {
            "layer": "region.9803118085738010",
            "localized_layer": "region.9803118085738010",
            "name": "California"
          },
          {
            "layer": "country.14135384517372290",
            "localized_layer": "country.14135384517372290",
            "name": "United States"
          }
        ],
        "language": "en",
        "maki": "marker",
        "internal_id": "example internal id",
        "external_ids": {
          "federated": "carmen.address.1556645983160292",
          "carmen": "address.1556645983160292"
        },
        "accuracy": "rooftop",
        "address_number": "34170",
        "metadata": {
          "iso_3166_1": "us",
          "iso_3166_2": "US-CA"
        },
        "routable_points": [
          {
            "name": "Address",
            "coordinates": [
              -122.059679,
              37.561366
            ]
          }
        ]
      }
    }
  ],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "4:36ab3a1922e482256ec7ebc7069bb94f805bf5ca",
  "response_uuid": "b32870f4-fa52-48f5-98c4-2200bb13ce7c"
}
{
  "type": "FeatureCollection",
  "features": [{
    "type": "Feature",
    "geometry": {
      "coordinates": [
        139.7596417,
        35.6675028
      ],
      "type": "Point"
    },
    "properties": {
      "feature_name": "〒105-0004 東京都港区新橋1丁目10番1号",
      "matching_name": "〒105-0004 東京都港区新橋1丁目10番1号",
      "description": "",
      "place_name": "〒105-0004 東京都港区新橋1丁目10番1号",
      "id": "2wwRMXwBRYqRl13lTvTP",
      "place_type": [
        "address"
      ],
      "context": [{
          "layer": "block",
          "localized_layer": "block",
          "name": "10"
        },
        {
          "layer": "chome",
          "localized_layer": "chome",
          "name": "1丁目"
        },
        {
          "layer": "oaza",
          "localized_layer": "oaza",
          "name": "新橋"
        },
        {
          "layer": "city",
          "localized_layer": "city",
          "name": "港区"
        },
        {
          "layer": "prefecture",
          "localized_layer": "prefecture",
          "name": "東京都"
        }
      ],
      "language": "ja",
      "maki": "marker",
      "internal_id": "example internal id",
      "external_ids": {
        "japan_address": "2wwRMXwBRYqRl13lTvTP"
      },
      "accuracy": "rooftop",
      "address": "〒105-0004 東京都港区新橋1丁目10番1号",
      "address_number": "1",
      "metadata": {
        "iso_3166_1": "jp",
        "iso_3166_2": "JP-13",
        "reading": {
          "ja_kana": "トウキョウトミナトクシンバシ",
          "ja_latin": "toukyouto minatoku shinbashi"
        }
      }
    }
  }],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "11:061a06471ec519420eeca5be2b87e043f2fe4cbe",
  "response_uuid": "733725e4-3992-43e5-9cad-bac75698eb59"
}

Reverse geocoding

get
https://api.mapbox.com/search/v1/reverse/{search_text}

The /reverse endpoint allows you to look up a single pair of coordinates and returns the geographic feature or features that exist at that location.

Required parametersTypeDescription
access_tokenstringA Mapbox access token with default permissions.
search_textstringThe user's query string. The query string is limited to 120 characters.
languagestringThe ISO language code to be returned.

You can further refine the results of a query to this endpoint with the following optional parameters:

Optional parametersTypeDescription
limitintegerThe number of results to return, up to 10.
typesstringLimit results to one or more types of features, provided as a comma-separated list. Pass one or more of the type names as a comma separated list. If no types are specified, all possible types may be returned. Available types are: country, region, prefecture, postcode, district, place, city, locality, oaza, block, street, and address. See the Administrative unit types section for details about these types.

Example requests: Reverse geocoding

$ curl "https://api.mapbox.com/search/v1/reverse/13.329048,52.51258?language=de&access_token=YOUR_MAPBOX_ACCESS_TOKEN"
$ curl "https://api.mapbox.com/search/v1/reverse/139.58028,35.29556?language=ja&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

Permanent reverse geocoding

get
https://api.mapbox.com/search/v1/permanent/reverse/{search_text}

The Mapbox Terms of Service state that all data returned by the /suggest, /retrieve, /forward, or /reverse endpoints is only available for temporary use. If your use case requires storing position data, contact Mapbox sales. This is consistent with the Terms of Service for Mapbox Geocoding API calls made to the mapbox.places-permanent endpoint.

The /permanent/reverse endpoint takes the same path and query parameters as the /reverse endpoint.

Response: Reverse geocoding

The response to a request to the /reverse endpoint is a GeoJSON FeatureCollection.

Using the limit parameter, you can increase the maximum number of results up to 10. Pagination is not available, but this feature may be added in a later release. There is not an option to customize the order of search results.

PropertyTypeDescription
typestringThis will always be "FeatureCollection".
attributionstringThe attribution data for results.
versionstringThe service version information. Include this information if you report an issue to Mapbox.
response_uuidstringThe service response identifier. Include this information if you report an issue to Mapbox.
featuresarray of objectsThe returned feature objects. See the table below for details on the properties contained by each feature object.

Each feature in the response body contains the following properties:

PropertyTypeDescription
bboxarrayA bounding box in the format minimum longitude,minimum latitude,maximum longitude,maximum latitude. Not available during the public beta phase.
geometryobjectAn object describing the spatial geometry of the returned feature.
geometry.coordinatesarrayThe coordinates of the feature, formatted as [longitude,latitude].
geometry.typestringThis will always be "Point".
typestringThis will always be "Feature".
propertiesobjectSpecific properties associated with the returned feature.
properties.makistringA string representing an associated Maki icon to use for this result.
properties.metadataobjectAddress metadata fields.
properties.metadata.iso_3166_1stringThe country code.
properties.metadata.iso_3166_2stringThe country code and its country subdivision code.
properties.addressstringFor results with an address, the locally formatted address.
properties.feature_namestringThe name of the feature.
properties.matching_namestringThe feature name, as matched by the search algorithm.
properties.place_typearrayThe result type. See the Administrative unit types section for details about these place types.
properties.languagestringThe IETF language tag.
properties.internal_idstringID for internal metadata. This ID is not guaranteed to be stable or unique, and is not useful for development.
properties.external_idsobjectIDs passed through from external data providers. These IDs are not guaranteed to be stable or unique, and are not useful for development.
properties.address_numberstringThe house number for address objects.
properties.contextarray of objectsThe context of the feature.
properties.context.localized_layerstringThe localized place_type. See the Administrative unit types section for details about these place types.
properties.context.layerstringThe global place_type that corresponds to the localized properties.place_type in context.localized_layer. See the Administrative unit types section for details about these place types.
properties.context.namestringThe name of the feature.

Example responses: Reverse geocoding

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          13.3295589,
          52.5125463
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "Straße Des 17. Juni 115",
        "matching_name": "Straße Des 17. Juni 115",
        "highlighted_name": "Straße Des 17. Juni 115",
        "description": "10623 Berlin, Deutschland",
        "place_name": "Straße Des 17. Juni 115, 10623 Berlin, Deutschland",
        "id": "address.3419053976491624",
        "place_type": [
          "address"
        ],
        "context": [
          {
            "layer": "postcode.5398366936640250",
            "localized_layer": "postcode.5398366936640250",
            "name": "10623"
          },
          {
            "layer": "locality.12210531181979940",
            "localized_layer": "locality.12210531181979940",
            "name": "Charlottenburg"
          },
          {
            "layer": "place.14094307404564380",
            "localized_layer": "place.14094307404564380",
            "name": "Berlin"
          },
          {
            "layer": "country.10814856728480410",
            "localized_layer": "country.10814856728480410",
            "name": "Deutschland"
          }
        ],
        "language": "de",
        "maki": "marker",
        "internal_id": "example internal id",
        "external_ids": {
          "federated": "carmen.address.3419053976491624",
          "carmen": "address.3419053976491624"
        },
        "accuracy": "rooftop",
        "address_number": "115",
        "metadata": {
          "iso_3166_1": "de"
        },
        "routable_points": [
          {
            "name": "Address",
            "coordinates": [
              13.32955240836938,
              52.51264818693428
            ]
          }
        ]
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          13.329777,
          52.512344
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "Chemiegebäude C TU Berlin",
        "matching_name": "Chemiegebäude C TU Berlin",
        "highlighted_name": "Chemiegebäude C TU Berlin",
        "description": "Straße des 17. Juni 115, 10623 Berlin, Deutschland",
        "place_name": "Chemiegebäude C TU Berlin, Straße des 17. Juni 115, 10623 Berlin, Deutschland",
        "id": "ZHtfKIEBLMhwlZV-fxwF",
        "place_type": [
          "poi"
        ],
        "context": [
          {
            "layer": "address",
            "localized_layer": "address",
            "name": "Straße des 17. Juni 115"
          },
          {
            "layer": "street",
            "localized_layer": "street",
            "name": "straße des 17 juni"
          },
          {
            "layer": "postcode",
            "localized_layer": "postcode",
            "name": "10623"
          },
          {
            "layer": "neighborhood",
            "localized_layer": "neighborhood",
            "name": "Berlin-10623"
          },
          {
            "layer": "place",
            "localized_layer": "place",
            "name": "Berlin"
          },
          {
            "layer": "country",
            "localized_layer": "country",
            "name": "Deutschland"
          }
        ],
        "maki": "marker",
        "poi_category": [
          "universitätsgebäude"
        ],
        "internal_id": "example internal id",
        "external_ids": {
          "federated": "poi.cf57c7f9cb1ef13109b9110018d46716dcfc8b1dc835f541e1aece69f283a8f7",
          "foursquare": "4d3569c6329e54812c70ca1d",
          "mbx_poi": "cf57c7f9cb1ef13109b9110018d46716dcfc8b1dc835f541e1aece69f283a8f7"
        },
        "mapbox_id": "CkIKQGNmNTdjN2Y5Y2IxZWYxMzEwOWI5MTEwMDE4ZDQ2NzE2ZGNmYzhiMWRjODM1ZjU0MWUxYWVjZTY5ZjI4M2E4Zjc=",
        "metadata": {
          "primary_photo": [],
          "iso_3166_1": "DE",
          "iso_3166_2": "DE-BE"
        }
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          13.3297794,
          52.5129985
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "RWE-Effizienz",
        "matching_name": "RWE-Effizienz",
        "highlighted_name": "RWE-Effizienz",
        "description": "10623, Deutschland",
        "place_name": "RWE-Effizienz, 10623, Deutschland",
        "id": "3-aBKIEBLMhwlZV-ZzLV",
        "place_type": [
          "poi"
        ],
        "context": [
          {
            "layer": "postcode",
            "localized_layer": "postcode",
            "name": "10623"
          },
          {
            "layer": "country",
            "localized_layer": "country",
            "name": "Deutschland"
          }
        ],
        "maki": "marker",
        "poi_category": [
          "ladestation",
          "transport"
        ],
        "internal_id": "example internal id",
        "external_ids": {
          "mbx_poi": "bac9da3a9611cfaf6690c583e67b9d6f0534ff1189171ba4a57e5278284f6f86",
          "osm": "n1272542311",
          "federated": "poi.bac9da3a9611cfaf6690c583e67b9d6f0534ff1189171ba4a57e5278284f6f86"
        },
        "mapbox_id": "CkIKQGJhYzlkYTNhOTYxMWNmYWY2NjkwYzU4M2U2N2I5ZDZmMDUzNGZmMTE4OTE3MWJhNGE1N2U1Mjc4Mjg0ZjZmODY=",
        "metadata": {
          "primary_photo": [],
          "iso_3166_1": "DE",
          "iso_3166_2": "DE-BE"
        }
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          13.329943,
          52.512203
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "INI Chemie TU Berlin",
        "matching_name": "INI Chemie TU Berlin",
        "highlighted_name": "INI Chemie TU Berlin",
        "description": "Straße des 17. Juni 115, 10623 Berlin, Deutschland",
        "place_name": "INI Chemie TU Berlin, Straße des 17. Juni 115, 10623 Berlin, Deutschland",
        "id": "z_QpKYEBLMhwlZV-Lx1H",
        "place_type": [
          "poi"
        ],
        "context": [
          {
            "layer": "address",
            "localized_layer": "address",
            "name": "Straße des 17. Juni 115"
          },
          {
            "layer": "street",
            "localized_layer": "street",
            "name": "straße des 17 juni"
          },
          {
            "layer": "postcode",
            "localized_layer": "postcode",
            "name": "10623"
          },
          {
            "layer": "neighborhood",
            "localized_layer": "neighborhood",
            "name": "Berlin-10623"
          },
          {
            "layer": "place",
            "localized_layer": "place",
            "name": "Berlin"
          },
          {
            "layer": "country",
            "localized_layer": "country",
            "name": "Deutschland"
          }
        ],
        "maki": "marker",
        "poi_category": [
          "universitätsgebäude"
        ],
        "internal_id": "example internal id",
        "external_ids": {
          "foursquare": "5166e725e4b0532deebdf0b6",
          "federated": "poi.eafb7426dd4209ee679236576265a9b2a1374aa784f2fb8e690f680abbad6a70",
          "mbx_poi": "eafb7426dd4209ee679236576265a9b2a1374aa784f2fb8e690f680abbad6a70"
        },
        "mapbox_id": "CkIKQGVhZmI3NDI2ZGQ0MjA5ZWU2NzkyMzY1NzYyNjVhOWIyYTEzNzRhYTc4NGYyZmI4ZTY5MGY2ODBhYmJhZDZhNzA=",
        "metadata": {
          "primary_photo": [],
          "iso_3166_1": "DE",
          "iso_3166_2": "DE-BE"
        }
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          13.327865,
          52.512276
        ],
        "type": "Point"
      },
      "properties": {
        "feature_name": "Fachbereich Logistik",
        "matching_name": "Fachbereich Logistik",
        "highlighted_name": "Fachbereich Logistik",
        "description": "Straße des 17. Juni 135, 10623 Berlin, Deutschland",
        "place_name": "Fachbereich Logistik, Straße des 17. Juni 135, 10623 Berlin, Deutschland",
        "id": "pQnqJ4EBLMhwlZV-Ik2S",
        "place_type": [
          "poi"
        ],
        "context": [
          {
            "layer": "address",
            "localized_layer": "address",
            "name": "Straße des 17. Juni 135"
          },
          {
            "layer": "street",
            "localized_layer": "street",
            "name": "straße des 17 juni"
          },
          {
            "layer": "postcode",
            "localized_layer": "postcode",
            "name": "10623"
          },
          {
            "layer": "neighborhood",
            "localized_layer": "neighborhood",
            "name": "Berlin-10623"
          },
          {
            "layer": "place",
            "localized_layer": "place",
            "name": "Berlin"
          },
          {
            "layer": "country",
            "localized_layer": "country",
            "name": "Deutschland"
          }
        ],
        "maki": "marker",
        "poi_category": [
          "büro"
        ],
        "internal_id": "example internal id",
        "external_ids": {
          "foursquare": "5475a534498e3f576fa1b5d9",
          "federated": "poi.0918e824a5229b4682881bb3383d8f192a059709db2c2659e5b93fa89f50f455",
          "mbx_poi": "0918e824a5229b4682881bb3383d8f192a059709db2c2659e5b93fa89f50f455"
        },
        "mapbox_id": "CkIKQDA5MThlODI0YTUyMjliNDY4Mjg4MWJiMzM4M2Q4ZjE5MmEwNTk3MDlkYjJjMjY1OWU1YjkzZmE4OWY1MGY0NTU=",
        "metadata": {
          "primary_photo": [],
          "iso_3166_1": "DE",
          "iso_3166_2": "DE-BE"
        }
      }
    }
  ],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "4:36ab3a1922e482256ec7ebc7069bb94f805bf5ca",
  "response_uuid": "f728ec84-5599-4ac5-aee3-dda48d970e74"
}

{
  "type": "FeatureCollection",
  "features": [{
    "type": "Feature",
    "geometry": {
      "coordinates": [
        139.58041388935513,
        35.29559166696336
      ],
      "type": "Point"
    },
    "properties": {
      "feature_name": "逗子5丁目2番",
      "matching_name": "逗子5丁目2番",
      "description": "日本, 神奈川県逗子市逗子5丁目2番16",
      "place_name": "日本, 神奈川県逗子市逗子5丁目2番16",
      "id": "address.141324126",
      "place_type": [
        "address"
      ],
      "context": [{
          "layer": "postcode.15947689941269040",
          "localized_layer": "postcode.15947689941269040",
          "name": "249-0006"
        },
        {
          "layer": "place.9212495244633840",
          "localized_layer": "place.9212495244633840",
          "name": "逗子市"
        },
        {
          "layer": "region.3991212366959510",
          "localized_layer": "region.3991212366959510",
          "name": "神奈川県"
        },
        {
          "layer": "country.9827633378530190",
          "localized_layer": "country.9827633378530190",
          "name": "日本"
        }
      ],
      "language": "ja",
      "maki": "marker",
      "internal_id": "example internal id",
      "external_ids": {
        "carmen": "address.141324126",
        "federated": "carmen.address.141324126"
      },
      "accuracy": "point",
      "address_number": "16",
      "metadata": {
        "iso_3166_1": "jp",
        "iso_3166_2": "JP-14"
      },
      "routable_points": []
    }
  }],
  "attribution": "© 2022 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)",
  "version": "11:061a06471ec519420eeca5be2b87e043f2fe4cbe",
  "response_uuid": "29135029-2b4d-477e-bc30-67303b12ddad"
}

Search API errors

Public beta for the Search API

If your account is not enabled for the global private beta and you are making requests outside Japan you will receive a 401 response with the error, that the feature is not enabled.

Response body messageHTTP error codeDescription
Not authorized401Check the access token used in the query.
Bad request400Check the the request for syntax errors in the endpoint, path parameters, and query parameters.
Forbidden403There may be an issue with your account. Check your Account page for more details.

In some cases, using an access tokens with URL restrictions can also result in a 403 error. For more information, see our Token management guide.
Not found404No search_text was provided in the query.

Search API restrictions and limits

  • The default rate limit for the Mapbox Search API is 600 requests per minute. If you require a higher rate limit, contact Mapbox Sales.
  • Calls to the Search API's /suggest and /retrieve endpoints must include a session_token parameter. Each API call in a search session counts individually against the rate limit. For example, 10 sequential calls to /suggest with the same session_token and one call to /retrieve are 11 requests per the rate limit, but are billed as belonging to a single session. See more about how the Search API is billed in the Session-based pricing section of this documentation.

Search API pricing

Usage of the Search API is billed either by search session or by API call, depending on the Search API endpoints that you use. During the beta phase's limited release in Japan, details about the number of requests included in the free tier and the cost per request beyond what is included in the free tier are available on the Japanese-language pricing page.

Session-based pricing

The Search API's /suggest and /retrieve endpoints must include a session_token parameter. The session_token parameter is used to group a series of requests together into one session for billing purposes.

A session ends after the following actions:

  • A call is made to /suggest followed by a call to /retrieve with a common session_token.
  • 50 successive calls are made to /suggest with a common session_token but are not followed by a call to /retrieve.
  • A call is made to /suggest and 60 minutes pass without being followed by a call to /retrieve.

For more specific details on session pricing, contact Mapbox sales.

Per-call pricing

Calls to the Search API's /forward, /permanent/forward, /reverse, and /permanent/reverse endpoints are billed by API calls. For more details on how calls to these endpoints are billed, see the Japanese-language pricing page.