> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Mapbox

> Geocoding, place and POI search, driving/walking/cycling directions, travel-time matrices and isochrones.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/mapbox.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=bed5cb1cd7bd5924276ab8ef8b1e0015)

[Web Catalog · Maps](https://docs.webrouter.net/data-apis.md?category=maps)

Needs&#x20;

`MAPBOX_ACCESS_TOKEN`

Endpoints

8

Auth

Key in query

[Vendor docs](https://docs.mapbox.com/api/overview/)

&#x20;·&#x20;

[Pricing](https://www.mapbox.com/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `MAPBOX_ACCESS_TOKEN` | required | A Mapbox access token (account.mapbox.com > Tokens; a default public pk. token works for these APIs), sent as the access\_token query parameter. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Coordinates are longitude,latitude (in that order), and several points are joined with semicolons.
* Geocoding results are temporary by default and may not be cached or stored; storing them needs permanent=true, billed separately and requiring a card or enterprise contract.
* Rate limits per minute: geocoding 1000, isochrone 300, matrix 60 (30 with driving-traffic); 429 when exceeded.
* Mapbox terms require route, isochrone and some search results to be shown on a Mapbox map when displayed.

## Endpoints

GET

Geocode an address or place

Coordinates and structured address for free text (addresses, places, postcodes).

[Open](#mapbox-geocode-forward)

GET

Reverse geocode coordinates

Address and place names at a longitude/latitude.

[Open](#mapbox-geocode-reverse)

GET

Search places and POIs

Businesses, POIs, addresses and places matching text, with coordinates.

[Open](#mapbox-search-forward)

GET

Find POIs in a category

Points of interest of one category near a point or in a box.

[Open](#mapbox-search-category)

GET

List POI categories

Canonical category ids and names usable with category search.

[Open](#mapbox-search-categories)

GET

Get directions

Routes between 2 to 25 points with distance (m), duration (s), geometry and optional turn-by-turn steps.

[Open](#mapbox-directions-get)

GET

Get a travel-time matrix

Durations (s) and/or distances (m) between every source and destination.

[Open](#mapbox-matrix-get)

GET

Get reachable areas (isochrones)

Areas reachable from a point within given minutes or meters, as GeoJSON.

[Open](#mapbox-isochrone-get)

### Geocode an address or place

GET

`/search/geocode/v6/forward`

`mapbox.geocode.forward`

Coordinates and structured address for free text (addresses, places, postcodes).

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`q` required</td><td>string</td><td>query</td><td>Search text. Example `1600 Pennsylvania Ave NW, Washington DC`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results, default 5, max 10.
      </td>
    </tr>

    <tr>
      <td>
        `types`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated feature types, e.g. address,place,postcode,region,country.
      </td>
    </tr>

    <tr>
      <td>
        `autocomplete`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Default true; false for exact matches only.
      </td>
    </tr>

    <tr>
      <td>
        `permanent`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Default false. true allows storing results and is billed as permanent geocoding.
      </td>
    </tr>

    <tr>
      <td>
        `bbox`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        minLon,minLat,maxLon,maxLat; cannot cross the 180th meridian.
      </td>
    </tr>

    <tr>
      <td>
        `country`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated ISO 3166 alpha-2 codes.
      </td>
    </tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        IETF language tags, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `proximity`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        longitude,latitude or ip, to bias results toward a place.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/search/geocoding/) · Same job: [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-geocoder-search), [CNPJá](https://docs.webrouter.net/data-apis/cnpja.md#cnpja-zip-get), [CompanyEnrich](https://docs.webrouter.net/data-apis/companyenrich.md#companyenrich-geo-regions), [Duffel](https://docs.webrouter.net/data-apis/duffel.md#duffel-places-suggestions), [Forager](https://docs.webrouter.net/data-apis/forager.md#forager-reference-locations), [IBGE](https://docs.webrouter.net/data-apis/ibge.md#ibge-aggregates-places)

```python Python theme={null}
router.call_data_api("mapbox.geocode.forward", {'q': '1600 Pennsylvania Ave NW, Washington DC'})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.geocode.forward", params={"q": "1600 Pennsylvania Ave NW, Washington DC"})
```

### Reverse geocode coordinates

GET

`/search/geocode/v6/reverse`

`mapbox.geocode.reverse`

Address and place names at a longitude/latitude.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`longitude` required</td><td>number</td><td>query</td><td>Longitude. Example `-73.989`</td></tr>
    <tr><td>`latitude` required</td><td>number</td><td>query</td><td>Latitude. Example `40.733`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Default 1, max 5; above 1 needs exactly one types value.
      </td>
    </tr>

    <tr>
      <td>
        `types`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated feature types.
      </td>
    </tr>

    <tr>
      <td>
        `country`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated ISO 3166 alpha-2 codes.
      </td>
    </tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        IETF language tags, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `permanent`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Default false.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/search/geocoding/) · Same job: [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-geocoder-search), [CNPJá](https://docs.webrouter.net/data-apis/cnpja.md#cnpja-zip-get), [CompanyEnrich](https://docs.webrouter.net/data-apis/companyenrich.md#companyenrich-geo-regions), [Duffel](https://docs.webrouter.net/data-apis/duffel.md#duffel-places-suggestions), [Forager](https://docs.webrouter.net/data-apis/forager.md#forager-reference-locations), [IBGE](https://docs.webrouter.net/data-apis/ibge.md#ibge-aggregates-places)

```python Python theme={null}
router.call_data_api("mapbox.geocode.reverse", {'longitude': -73.989, 'latitude': 40.733})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.geocode.reverse", params={"longitude": -73.989, "latitude": 40.733})
```

### Search places and POIs

GET

`/search/searchbox/v1/forward`

`mapbox.search.forward`

Businesses, POIs, addresses and places matching text, with coordinates.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`q` required</td><td>string</td><td>query</td><td>Search text, up to 256 characters. Example `coffee near Union Square`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results, up to 10.
      </td>
    </tr>

    <tr>
      <td>
        `types`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated result types, e.g. poi,address,place.
      </td>
    </tr>

    <tr>
      <td>
        `poi_category`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated canonical category ids to restrict POIs.
      </td>
    </tr>

    <tr>
      <td>
        `bbox`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        minLon,minLat,maxLon,maxLat; cannot cross the 180th meridian.
      </td>
    </tr>

    <tr>
      <td>
        `country`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated ISO 3166 alpha-2 codes.
      </td>
    </tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        IETF language tags, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `proximity`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        longitude,latitude or ip, to bias results toward a place.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/search/search-box/) · Same job: [Amap (Gaode) Web Service](https://docs.webrouter.net/data-apis/amap.md#amap-places-search), [Atly](https://docs.webrouter.net/data-apis/atly.md#atly-places-search), [Best Buy](https://docs.webrouter.net/data-apis/bestbuy.md#bestbuy-stores-search), [FDIC BankFind Suite](https://docs.webrouter.net/data-apis/fdic.md#fdic-locations-search), [Foursquare Places API](https://docs.webrouter.net/data-apis/foursquare.md#foursquare-places-search), [Geoapify](https://docs.webrouter.net/data-apis/geoapify.md#geoapify-places-search)

```python Python theme={null}
router.call_data_api("mapbox.search.forward", {'q': 'coffee near Union Square'})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.search.forward", params={"q": "coffee near Union Square"})
```

### Find POIs in a category

GET

`/search/searchbox/v1/category/{canonical_category_id}`

`mapbox.search.category`

Points of interest of one category near a point or in a box.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`canonical_category_id` required</td><td>string</td><td>path</td><td>A canonical category id from mapbox.search.categories. Example `restaurant`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results, up to 25.
      </td>
    </tr>

    <tr>
      <td>
        `bbox`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        minLon,minLat,maxLon,maxLat; cannot cross the 180th meridian.
      </td>
    </tr>

    <tr>
      <td>
        `country`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated ISO 3166 alpha-2 codes.
      </td>
    </tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        IETF language tags, comma-separated.
      </td>
    </tr>

    <tr>
      <td>
        `proximity`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        longitude,latitude or ip, to bias results toward a place.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/search/search-box/) · Same job: [Amap (Gaode) Web Service](https://docs.webrouter.net/data-apis/amap.md#amap-places-search), [Atly](https://docs.webrouter.net/data-apis/atly.md#atly-places-search), [Best Buy](https://docs.webrouter.net/data-apis/bestbuy.md#bestbuy-stores-search), [FDIC BankFind Suite](https://docs.webrouter.net/data-apis/fdic.md#fdic-locations-search), [Foursquare Places API](https://docs.webrouter.net/data-apis/foursquare.md#foursquare-places-search), [Geoapify](https://docs.webrouter.net/data-apis/geoapify.md#geoapify-places-search)

```python Python theme={null}
router.call_data_api("mapbox.search.category", {'canonical_category_id': 'restaurant'})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.search.category", params={"canonical_category_id": "restaurant"})
```

### List POI categories

GET

`/search/searchbox/v1/list/category`

`mapbox.search.categories`

Canonical category ids and names usable with category search.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Default English.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/search/search-box/) · Same job: [Atly](https://docs.webrouter.net/data-apis/atly.md#atly-places-list-categories), [Recreation.gov RIDB](https://docs.webrouter.net/data-apis/ridb.md#ridb-activities-list), [Yelp Fusion](https://docs.webrouter.net/data-apis/yelp.md#yelp-categories)

```python Python theme={null}
router.call_data_api("mapbox.search.categories")
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.search.categories")
```

### Get directions

GET

`/directions/v5/mapbox/{profile}/{coordinates}`

`mapbox.directions.get`

Routes between 2 to 25 points with distance (m), duration (s), geometry and optional turn-by-turn steps.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`profile` required</td><td>string</td><td>path</td><td>Routing profile (the part after mapbox/). One of `driving-traffic`, `driving`, `walking`, `cycling` Example `driving`</td></tr>
    <tr><td>`coordinates` required</td><td>string</td><td>path</td><td>2 to 25 longitude,latitude pairs joined by semicolons, visited in order. Example `-122.42,37.78;-122.45,37.91`</td></tr>

    <tr>
      <td>
        `alternatives`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Up to two alternative routes; default false.
      </td>
    </tr>

    <tr><td>`geometries`</td><td>string</td><td>query</td><td>Default polyline. One of `geojson`, `polyline`, `polyline6`</td></tr>
    <tr><td>`overview`</td><td>string</td><td>query</td><td>Route geometry detail; default simplified. One of `full`, `simplified`, `false`</td></tr>

    <tr>
      <td>
        `steps`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Turn-by-turn steps; default false.
      </td>
    </tr>

    <tr>
      <td>
        `annotations`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated: distance, duration, speed, congestion, maxspeed, ...; needs overview=full.
      </td>
    </tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Instruction language, default en; needs steps=true.
      </td>
    </tr>

    <tr>
      <td>
        `exclude`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated road types to avoid: motorway, toll, ferry, unpaved, tunnel, country\_border, state\_border.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/navigation/directions/) · Same job: [Amap (Gaode) Web Service](https://docs.webrouter.net/data-apis/amap.md#amap-directions-driving), [Geoapify](https://docs.webrouter.net/data-apis/geoapify.md#geoapify-routing), [HERE](https://docs.webrouter.net/data-apis/here-maps.md#here-maps-routes), [TomTom](https://docs.webrouter.net/data-apis/tomtom.md#tomtom-routing-calculate)

```python Python theme={null}
router.call_data_api("mapbox.directions.get", {'profile': 'driving', 'coordinates': '-122.42,37.78;-122.45,37.91'})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.directions.get", params={"profile": "driving", "coordinates": "-122.42,37.78;-122.45,37.91"})
```

### Get a travel-time matrix

GET

`/directions-matrix/v1/mapbox/{profile}/{coordinates}`

`mapbox.matrix.get`

Durations (s) and/or distances (m) between every source and destination.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`profile` required</td><td>string</td><td>path</td><td>Routing profile (the part after mapbox/). One of `driving-traffic`, `driving`, `walking`, `cycling` Example `driving`</td></tr>
    <tr><td>`coordinates` required</td><td>string</td><td>path</td><td>2 to 25 longitude,latitude pairs joined by semicolons (10 for driving-traffic). Example `-122.42,37.78;-122.45,37.91`</td></tr>

    <tr>
      <td>
        `annotations`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        duration (default), distance, or duration,distance.
      </td>
    </tr>

    <tr>
      <td>
        `sources`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        0-based coordinate indices joined by semicolons, or all (default).
      </td>
    </tr>

    <tr>
      <td>
        `destinations`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        0-based coordinate indices joined by semicolons, or all (default).
      </td>
    </tr>

    <tr>
      <td>
        `approaches`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        unrestricted or curb per coordinate, semicolon-separated.
      </td>
    </tr>

    <tr>
      <td>
        `fallback_speed`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        km/h; fills unroutable pairs with a straight-line estimate.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/navigation/matrix/)

```python Python theme={null}
router.call_data_api("mapbox.matrix.get", {'profile': 'driving', 'coordinates': '-122.42,37.78;-122.45,37.91'})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.matrix.get", params={"profile": "driving", "coordinates": "-122.42,37.78;-122.45,37.91"})
```

### Get reachable areas (isochrones)

GET

`/isochrone/v1/mapbox/{profile}/{coordinates}`

`mapbox.isochrone.get`

Areas reachable from a point within given minutes or meters, as GeoJSON.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`profile` required</td><td>string</td><td>path</td><td>Routing profile (the part after mapbox/). One of `driving-traffic`, `driving`, `walking`, `cycling` Example `driving`</td></tr>
    <tr><td>`coordinates` required</td><td>string</td><td>path</td><td>One longitude,latitude pair. Example `-118.22258,33.99038`</td></tr>
    <tr><td>`contours_minutes`</td><td>string</td><td>query</td><td>Up to 4 increasing integers, max 60. Use this or contours\_meters. Example `5,10,15`</td></tr>

    <tr>
      <td>
        `contours_meters`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Up to 4 increasing integers, max 100000.
      </td>
    </tr>

    <tr>
      <td>
        `polygons`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        true for polygons, default false (lines).
      </td>
    </tr>

    <tr>
      <td>
        `denoise`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        0.0 to 1.0, default 1.0.
      </td>
    </tr>

    <tr>
      <td>
        `generalize`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        Simplification tolerance in meters.
      </td>
    </tr>

    <tr>
      <td>
        `exclude`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Driving only: motorway, toll, ferry, unpaved, cash\_only\_tolls.
      </td>
    </tr>

    <tr>
      <td>
        `depart_at`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ISO 8601 departure time, for traffic.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.mapbox.com/api/navigation/isochrone/)

```python Python theme={null}
router.call_data_api("mapbox.isochrone.get", {'profile': 'driving', 'coordinates': '-118.22258,33.99038', 'contours_minutes': '5,10,15'})
```

```text MCP theme={null}
call_data_api(endpoint="mapbox.isochrone.get", params={"profile": "driving", "coordinates": "-118.22258,33.99038", "contours_minutes": "5,10,15"})
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.