> ## 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.

# GraphHopper Directions API

> Routing, distance matrices, isochrones and geocoding on OpenStreetMap data.

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

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

Needs&#x20;

`GRAPHHOPPER_API_KEY`

Endpoints

5

Auth

Key in query

[Vendor docs](https://docs.graphhopper.com/)

&#x20;·&#x20;

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

## Setup

| Variable | | What it is |
| - | - | - |
| `GRAPHHOPPER_API_KEY` | required | a GraphHopper API key (graphhopper.com dashboard > API keys) |

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

## Notes

* Billed in credits against a daily limit. Each response's X-RateLimit-Credits header gives the cost of that call and X-RateLimit-Remaining the credits left before it; 429 means the daily or per-minute limit is spent.
* Points are 'latitude,longitude' in requests, and multi-value parameters repeat (point=..\&point=..); pass a list.
* The free package supports only the car, bike and foot profiles.

## Endpoints

GET

Calculate a route

Distance, time, geometry and turn-by-turn instructions between two or more points.

[Open](#graphhopper-route-get)

GET

Geocode an address or place

Places matching a text query, with coordinates, address parts and OSM ids.

[Open](#graphhopper-geocode-forward)

GET

Reverse geocode a point

Addresses and places near a coordinate.

[Open](#graphhopper-geocode-reverse)

GET

Compute a distance/time matrix

Travel times, distances or weights between every origin and destination.

[Open](#graphhopper-matrix-get)

GET

Compute an isochrone

Polygons of everywhere reachable from a point within a travel time or distance.

[Open](#graphhopper-isochrone-get)

### Calculate a route

GET

`/route`

`graphhopper.route.get`

Distance, time, geometry and turn-by-turn instructions between two or more points.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`point` required</td><td>array</td><td>query</td><td>Points as 'latitude,longitude', origin first, destination last, vias between. Sent as repeated point parameters; the maximum count depends on the plan. Example `["51.131,12.414", "48.224,3.867"]`</td></tr>
    <tr><td>`profile`</td><td>string</td><td>query</td><td>Vehicle profile; default car. Free plan: car, bike, foot only. Others include car\_avoid\_motorway, car\_avoid\_ferry, car\_avoid\_toll, small\_truck, truck, scooter, hike, mtb, racingbike, or a custom profile id (cp\_...). Example `car`</td></tr>

    <tr>
      <td>
        `locale`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Language of instructions, e.g. 'de' or 'pt\_PT'; default en.
      </td>
    </tr>

    <tr>
      <td>
        `instructions`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Return turn instructions; default true.
      </td>
    </tr>

    <tr>
      <td>
        `calc_points`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Return the route geometry; default true.
      </td>
    </tr>

    <tr>
      <td>
        `points_encoded`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Default true (polyline-encoded). false returns plain \[lon, lat] coordinates.
      </td>
    </tr>

    <tr>
      <td>
        `elevation`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Add altitude as a third coordinate; default false.
      </td>
    </tr>

    <tr>
      <td>
        `details`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Path details to return, e.g. street\_name, road\_class, surface, max\_speed, toll, time, distance.
      </td>
    </tr>

    <tr><td>`optimize`</td><td>string</td><td>query</td><td>'true' lets the service reorder via points to minimise time; costs more credits. Not with ch.disable=true. One of `true`, `false`</td></tr>

    <tr>
      <td>
        `point_hint`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        A road name per point to snap it to; none or one per point.
      </td>
    </tr>

    <tr>
      <td>
        `snap_prevention`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Road types not to snap points to: motorway, trunk, ferry, tunnel, bridge, ford.
      </td>
    </tr>

    <tr>
      <td>
        `curbside`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Per point: any, right or left; for all points or none.
      </td>
    </tr>

    <tr><td>`algorithm`</td><td>string</td><td>query</td><td>Solve a different problem: several near-optimal routes, or a round trip from the first point. One of `alternative_route`, `round_trip`</td></tr>

    <tr>
      <td>
        `round_trip_distance`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Approximate length of a round trip in metres; default 10000.
      </td>
    </tr>

    <tr>
      <td>
        `round_trip_seed`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Random seed; change it for a different round trip.
      </td>
    </tr>

    <tr>
      <td>
        `alternative_route_max_paths`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most alternatives to return; default 2.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.graphhopper.com/openapi/routing/getroute)

```python Python theme={null}
router.call_data_api("graphhopper.route.get", {'point': ['51.131,12.414', '48.224,3.867'], 'profile': 'car'})
```

```text MCP theme={null}
call_data_api(endpoint="graphhopper.route.get", params={"point": ["51.131,12.414", "48.224,3.867"], "profile": "car"})
```

> [!NOTE]
>
> * Distances are metres, times milliseconds.
> * Coordinates in the response are \[longitude, latitude] (GeoJSON order), the reverse of the point parameter.

### Geocode an address or place

GET

`/geocode`

`graphhopper.geocode.forward`

Places matching a text query, with coordinates, address parts and OSM ids.

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>The address or place to look for. Example `Berlin Alexanderplatz`</td></tr>

    <tr>
      <td>
        `locale`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Result language; the default provider supports en, fr, es, de, pt, ru, it. Default en.
      </td>
    </tr>

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

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most results; default 5.
      </td>
    </tr>

    <tr>
      <td>
        `point`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        'latitude,longitude' to bias results toward.
      </td>
    </tr>

    <tr>
      <td>
        `provider`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Geocoder to use; default 'default'. Alternatives such as nominatim are under development and may fall back to default.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.graphhopper.com/openapi/geocoding/getgeocode) · Same job: [Amap (Gaode) Web Service](https://docs.webrouter.net/data-apis/amap.md#amap-geocode), [API Ninjas](https://docs.webrouter.net/data-apis/apininjas.md#apininjas-geocode), [Geoapify](https://docs.webrouter.net/data-apis/geoapify.md#geoapify-geocode-search), [Google Maps Platform](https://docs.webrouter.net/data-apis/google-maps.md#google-maps-geocode-forward), [HERE](https://docs.webrouter.net/data-apis/here-maps.md#here-maps-geocode), [OpenCage Geocoding](https://docs.webrouter.net/data-apis/opencage.md#opencage-geocode-forward)

```python Python theme={null}
router.call_data_api("graphhopper.geocode.forward", {'q': 'Berlin Alexanderplatz'})
```

```text MCP theme={null}
call_data_api(endpoint="graphhopper.geocode.forward", params={"q": "Berlin Alexanderplatz"})
```

> [!NOTE]
>
> * The default provider does prefix matching, tuned for autocomplete.

### Reverse geocode a point

GET

`/geocode`

`graphhopper.geocode.reverse`

Addresses and places near a coordinate.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`reverse` required</td><td>boolean</td><td>query</td><td>Must be true for reverse geocoding. Example `true`</td></tr>
    <tr><td>`point` required</td><td>string</td><td>query</td><td>'latitude,longitude' to look up. Example `52.5219,13.4132`</td></tr>

    <tr>
      <td>
        `locale`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Result language; default en.
      </td>
    </tr>

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

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Most results; default 5.
      </td>
    </tr>

    <tr>
      <td>
        `provider`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Geocoder to use; default 'default'.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.graphhopper.com/openapi/geocoding/getgeocode) · Same job: [Geoapify](https://docs.webrouter.net/data-apis/geoapify.md#geoapify-geocode-reverse), [Google Maps Platform](https://docs.webrouter.net/data-apis/google-maps.md#google-maps-geocode-reverse), [HERE](https://docs.webrouter.net/data-apis/here-maps.md#here-maps-revgeocode), [OpenCage Geocoding](https://docs.webrouter.net/data-apis/opencage.md#opencage-geocode-reverse), [TomTom](https://docs.webrouter.net/data-apis/tomtom.md#tomtom-geocode-reverse)

```python Python theme={null}
router.call_data_api("graphhopper.geocode.reverse", {'reverse': True, 'point': '52.5219,13.4132'})
```

```text MCP theme={null}
call_data_api(endpoint="graphhopper.geocode.reverse", params={"reverse": true, "point": "52.5219,13.4132"})
```

> [!NOTE]
>
> * Do not send q with reverse=true.

### Compute a distance/time matrix

GET

`/matrix`

`graphhopper.matrix.get`

Travel times, distances or weights between every origin and destination.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`profile`</td><td>string</td><td>query</td><td>Vehicle profile; default car. Free plan: car, bike, foot only. Others include car\_avoid\_motorway, car\_avoid\_ferry, car\_avoid\_toll, small\_truck, truck, scooter, hike, mtb, racingbike, or a custom profile id (cp\_...). Example `car`</td></tr>

    <tr>
      <td>
        `point`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Points as 'latitude,longitude' that are both origins and destinations (N points give N x N entries). Or use from\_point and to\_point.
      </td>
    </tr>

    <tr>
      <td>
        `from_point`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Origin points, 'latitude,longitude'.
      </td>
    </tr>

    <tr>
      <td>
        `to_point`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Destination points, 'latitude,longitude'.
      </td>
    </tr>

    <tr><td>`out_array`</td><td>array</td><td>query</td><td>Which matrices to return: weights, times, distances. Example `["times", "distances"]`</td></tr>

    <tr>
      <td>
        `fail_fast`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Error as soon as a point cannot be found or connected; default true. false returns null entries instead.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.graphhopper.com/openapi/matrix/getmatrix)

```python Python theme={null}
router.call_data_api("graphhopper.matrix.get", {'profile': 'car', 'out_array': ['times', 'distances']})
```

```text MCP theme={null}
call_data_api(endpoint="graphhopper.matrix.get", params={"profile": "car", "out_array": ["times", "distances"]})
```

> [!NOTE]
>
> * Large matrices use the async POST /matrix/calculate flow instead (not in this entry).

### Compute an isochrone

GET

`/isochrone`

`graphhopper.isochrone.get`

Polygons of everywhere reachable from a point within a travel time or distance.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`point` required</td><td>string</td><td>query</td><td>Start coordinate, 'latitude,longitude'. Example `51.131,12.414`</td></tr>
    <tr><td>`profile`</td><td>string</td><td>query</td><td>Vehicle profile; default car. Free plan: car, bike, foot only. Others include car\_avoid\_motorway, car\_avoid\_ferry, car\_avoid\_toll, small\_truck, truck, scooter, hike, mtb, racingbike, or a custom profile id (cp\_...). Example `car`</td></tr>

    <tr>
      <td>
        `time_limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Travel time in seconds.
      </td>
    </tr>

    <tr>
      <td>
        `distance_limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Travel distance in metres, instead of time\_limit.
      </td>
    </tr>

    <tr>
      <td>
        `buckets`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Split the limit into this many nested polygons; default 1.
      </td>
    </tr>

    <tr>
      <td>
        `reverse_flow`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        true for the area that can reach the point, false (default) for the area reachable from it.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.graphhopper.com/openapi/isochrones/getisochrone)

```python Python theme={null}
router.call_data_api("graphhopper.isochrone.get", {'point': '51.131,12.414', 'profile': 'car'})
```

```text MCP theme={null}
call_data_api(endpoint="graphhopper.isochrone.get", params={"point": "51.131,12.414", "profile": "car"})
```


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