Transportation — entry 016 of 69

GraphHopper

Verified Jul 2026

GraphHopper's Directions API bundles turn-by-turn routing (car, bike, foot, and more) with route optimization, distance matrix, map matching, isochrone, and geocoding endpoints behind a single API key. The free tier grants 500 credits/day for non-commercial use, capped at 5 locations and 1 vehicle per request; commercial plans start at Basic (€69/month, 5,000 credits/day) and scale through Standard and Premium.

routingturn-by-turn-directionsroute-optimizationmap-matching
AuthenticationAPI KeySign up with the provider to obtain credentials.
HTTPSSupportedTraffic is encrypted in transit.
CORSEnabledCallable directly from browser JavaScript.
PricingFreemiumA usable free tier exists, with paid plans for more volume.
FormatsJSON, GPXResponses can be requested as JSON or GPX.

GreatAPIs Score

Score87out of 100
Authentication15/25API key required
Pricing17/20Freemium tier available
Docs20/20Machine-readable spec file bundled
Formats15/15Supports 2 response formats
Freshness20/20Verified within 6 months

Embed this badge

Scored 87 on greatapis.com
<a href="https://greatapis.com/api/graphhopper/"><img src="https://greatapis.com/badge/graphhopper.svg" alt="Scored 87 on greatapis.com"></a>

Auth quickstart

  1. Sign up with the provider to get an API key.
  2. Send it on every request as a query param?key=<key>
Stored keyNo key stored

Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.

Endpoints

Servers
https://graphhopper.com/api/1
Auth
api_key
Route Optimization API3

## Quickstart The Route Optimization API can be used to solve [traveling salesman](https://en.wikipedia.org/wiki/Travelling_salesman_problem) or [vehicle routing problems](https://en.wikipedia.org/wiki/Vehicle_routing_problem). Solve your first problem by following these steps. If you already have a GraphHopper account, start with step 2. 1. [Sign up for GraphHopper](https://support.graphhopper.com/a/solutions/articles/44001976025) 2. [Create an API key](https://support.graphhopper.com/a/solutions/articles/44001976027) 3. Download [simple traveling salesman problem](https://gist.github.com/oblonski/fb2f2be534c3ebe7bebaa72151194182) and save it in a local folder 4. Open your command line, go to that local folder and use cURL ([What is cURL?](https://de.wikipedia.org/wiki/CURL)) as follows: ``` curl -X POST -H "Content-Type: application/json" "https://graphhopper.com/api/1/vrp?key=YOUR_CREATED_API_KEY" --data "@tsp.json" ``` Alternatively, you can use our Editor to explore that API: 1. Login to your GraphHopper account 2. Go to **Editor** 3. Click the **Optimize** button to solve your first problem 4. Analyze the solution on the **Map** or as raw **JSON Output** If you have successfully solved the first problem, we recommend this tutorial - [Getting Started with the Optimization API](https://www.graphhopper.com/blog/2019/05/17/getting-started-with-the-optimization-api-traveling-salesman-problem/). It shows and describes the essential elements to model your vehicle routing problem. To explore the full specification, we recommend that you either use our [route editor](https://www.graphhopper.com/blog/2015/07/21/graphhoppers-new-route-optimization-editor/), which you can find in our [dashboard](https://graphhopper.com/dashboard/), or use a REST client such as Insomnia or Postman, as described [here](https://docs.graphhopper.com/#section/Explore-our-APIs/Insomnia). ## Tutorials We provide [a number of tutorials](https://www.graphhopper.com/tutorial/) illustrating how to use the Route Optimization API and how to model your vehicle routing problems: - [Getting Start with the Optimization API - Traveling Salesman Problem](https://www.graphhopper.com/blog/2019/05/17/getting-started-with-the-optimization-api-traveling-salesman-problem/) - [How to solve a traveling salesman problem with a week-planning horizon?](https://www.graphhopper.com/blog/2020/07/15/how-to-solve-a-traveling-salesman-problem-with-a-week-planning-horizon-and-driver-shifts/) - [How to schedule technicians with skills and multiple dependencies between tasks?](https://www.graphhopper.com/blog/2016/06/03/how-to-route-technicians-with-skills-and-multiple-dependencies-between-tasks/) - [What is the difference between the min. of completion time and min. transport time?](https://www.graphhopper.com/blog/2016/06/20/what-is-the-difference-between-the-minimization-of-completion-time-and-minimizing-transport-time/) - [How to model multiple delivery routes with a single vehicle?](https://www.graphhopper.com/blog/2016/07/21/how-to-model-multiple-delivery-routes-with-a-single-vehicle/)

POST/vrpPOST route optimization problem
Request body

application/jsonRequest (required)

Responses
StatusDescriptionSchema
200A response containing the solutionResponse
400Error occurred when reading the request. Request is invalid.BadRequest
500Error occurred on server side.InternalErrorMessage
POST/vrp/optimizePOST route optimization problem (batch mode)
Request body

application/jsonRequest (required)

Responses
StatusDescriptionSchema
200A jobId you can use to retrieve your solution from the server - see solution endpoint.JobId
400Error occurred when reading client request. Request is invalid.BadRequest
500Error occurred on server side.InternalErrorMessage
GET/vrp/solution/{jobId}GET the solution (batch mode)
Parameters
NameInRequiredType
jobIdpathyesstring
Responses
StatusDescriptionSchema
200A response containing the solutionResponse
400Error occurred on client side such as invalid input.BadRequest
404Requested solution could not be found.
500Error occurred on server side.
Routing API3

### Introduction ![Routing screenshot](./img/routing-example.png) The Routing API is part of the GraphHopper Directions API. Routing is the process of finding the best path connecting two or more points, where the meaning of ''best'' depends on the vehicle and use case. ### Navigation If you plan to use the Routing API for navigation, have a look at our [open source demo navigation application](https://github.com/graphhopper/graphhopper-navigation-example) and adapt it to your needs. ### Fast To get started using this API, just provide two or more points and retrieve the fastest route through the road network that connects them. This type of request is heavily optimized for query performance, so it does not allow for some advanced features. ### Flexible Unlock further flexible features via `ch.disable=true`.

GET/routeGET Route Endpoint
Parameters
NameInRequiredType
pointqueryyesarray
point_hintquerynoarray
snap_preventionquerynoarray
vehiclequeryno
curbsidequerynoarray
turn_costsquerynoboolean
localequerynostring
elevationquerynoboolean
detailsquerynoarray
optimizequerynostring
instructionsquerynoboolean
calc_pointsquerynoboolean
debugquerynoboolean
points_encodedquerynoboolean
ch.disablequerynoboolean
weightingquerynostring
headingquerynoarray
heading_penaltyquerynointeger
pass_throughquerynoboolean
block_areaquerynostring
avoidquerynostring
algorithmquerynostring
round_trip.distancequerynointeger
round_trip.seedquerynointeger
alternative_route.max_pathsquerynointeger
alternative_route.max_weight_factorquerynonumber
alternative_route.max_share_factorquerynonumber
Responses
StatusDescriptionSchema
200Routing ResultRouteResponse
400Your request is not valid. For example, you specified too few or too many points.GHError
401Authentication necessaryGHError
429API limit reached.GHError
500Internal server error. We get notified automatically and fix this asap.GHError
501Only a special list of vehicles is supported.GHError
POST/routePOST Route Endpoint
Request body

application/jsonRouteRequest

Responses
StatusDescriptionSchema
200Routing ResultRouteResponse
400Your request is not valid. For example, you specified too few or too many points.GHError
401Authentication necessaryGHError
429API limit reached.GHError
500Internal server error. We get notified automatically and fix this asap.GHError
501Only a special list of vehicles is supported.GHError
GET/route/infoCoverage information
Responses
StatusDescriptionSchema
200Coverage InformationInfoResponse
Matrix API4

### Introduction ![Matrix Example](./img/matrix-example.png) The Matrix API is part of the [GraphHopper Directions API](https://graphhopper.com/#directions-api) and with it you can calculate many-to-many distances and times a lot more efficient than calling the Routing API multiple times. In the [Routing API](#tag/Routing-API) we support multiple points, so called 'via points', which results in one route being calculated. The Matrix API results in NxM routes, or more precise NxM distances or times being calculated but [is a lot faster](https://www.graphhopper.com/blog/2019/06/04/incredibly-fast-distance-matrix-calculations-with-graphhopper/) compared to NxM single requests. The most simple example is a tourist trying to decide which pizza is close to her instead of using beeline distance she can calculate a 1x4 matrix. Or a delivery service often in the need of big NxN matrices to solve vehicle routing problems. For example the [GraphHopper Route Optimization API](#tag/Route-Optimization-API) uses the Matrix API under the hood to achieve this. Some other use cases for the Matrix API: * Logistic problems often pick up many items from and deliver them to many locations. * Calculating detours with many possible points in-between and selecting the best e.g. interesting for ridesharing or taxi applications. For this 1-to-many requests are necessary. * Finding the best tour for a tourist in the need to visit as many points of interests as possible. * ... ### API Clients and Examples See the [clients](#section/API-Clients) section in the main document and [live examples](https://graphhopper.com/api/1/examples/#matrix). ### Description The Matrix API calculates the well known distance-matrix for a set of points, i.e. it calculates all the distances between every point combination. But we do not stop there, we also offer a time-, weight- and route-matrix. The weight-matrix can be used as raw input for e.g. a vehicle routing problem ([VRP](http://en.wikipedia.org/wiki/Vehicle_routing_problem)) and is more precise than a time- or distance-matrix. E.g. for bike routes the actual weight of a route (e.g. the "beauty") is what you want to decide if a route is 'better' and not always the taken time or distance. A simple illustration for a 3x3 matrix with identical from and to points: - |to_point1|to_point2|to_point3 :-----------|:--------|:--------|:-------- from_point1 |0 |1->2 | 1->3 from_point2 |2->1 |0 | 2->3 from_point3 |3->1 |3->2 | 0 A simple illustration for a 1x3 matrix with different start- and end-points: - | to_point1 | to_point2 | t_point3 :-----------|:-----------|:----------|:-------- from_pointA |A->1 |A->2 |A->3 For every route 1->2, 1-3, ... or A->1,A->2,A->3 you can return only the weight, the time and the distance. To calculate full routes you can use the [Routing API](#tag/Routing-API). ### Limits and Counts The cost for one request depends on the number of locations and is documented [here](https://support.graphhopper.com/support/solutions/44000303787#what-is-one-credit). One request should not exceed the Matrix API location limit, which depends on the subscription, see the pricing tab in our dashboard.

GET/matrixGET Matrix Endpoint
Parameters
NameInRequiredType
pointquerynoarray
from_pointquerynoarray
to_pointquerynoarray
point_hintquerynoarray
from_point_hintquerynoarray
to_point_hintquerynoarray
snap_preventionquerynoarray
curbsidequerynoarray
from_curbsidequerynoarray
to_curbsidequerynoarray
out_arrayquerynoarray
vehiclequeryno
fail_fastquerynoboolean
turn_costsquerynoboolean
Responses
StatusDescriptionSchema
200Matrix API responseMatrixResponse
defaultUnexpected ErrorGHError
POST/matrixPOST Matrix Endpoint
Request body

application/json

Responses
StatusDescriptionSchema
200Matrix API responseMatrixResponse
defaultUnexpected ErrorGHError
POST/matrix/calculateBatch Matrix Endpoint
Request body

application/json

Responses
StatusDescriptionSchema
200A jobId you can use to retrieve your solution from the server.JobId
defaultUnexpected ErrorGHError
GET/matrix/solution/{jobId}GET Batch Matrix Endpoint
Parameters
NameInRequiredType
jobIdpathyesstring
Responses
StatusDescriptionSchema
200A response containing the matrixMatrixResponse
defaultUnexpected ErrorGHError
Geocoding API1

Everything about geocoding

GET/geocodeGeocoding Endpoint
Parameters
NameInRequiredType
qquerynostring
localequerynostring
limitquerynointeger
reversequerynoboolean
debugquerynoboolean
pointquerynostring
providerquerynostring
Responses
StatusDescriptionSchema
200An array found locationsGeocodingResponse
defaultUnexpected errorGHError
Isochrone API1

Everything about isochrones

GET/isochroneIsochrone Endpoint
Parameters
NameInRequiredType
pointqueryyesstring
time_limitquerynointeger
distance_limitquerynointeger
vehiclequeryno
bucketsquerynointeger
reverse_flowquerynoboolean
weightingquerynostring
Responses
StatusDescriptionSchema
200Isochrone ResultIsochroneResponse
defaultUnexpected ErrorGHError
Map Matching API1

Everything about map matching aka "snap to road"

POST/matchMap-match a GPX file
Parameters
NameInRequiredType
gps_accuracyquerynointeger
vehiclequerynostring
Responses
StatusDescriptionSchema
200Routing ResultRouteResponse
defaultUnexpected ErrorGHError
Cluster API3

### Introduction ![Cluster Example](./img/cluster-solution.jpg) It solves the “capacity clustering problem” by assigning a set of customers to a given number of distinct groups (called clusters). The API “clusters” by minimizing the total distance from each individual customer to its designated group median. It can also consider minimum and maximum capacity restrictions for each group. Clustering can be used in many practical applications. For example, it can help to plan territories, i.e. territory optimization for field teams with large territories for field workers, or to solve large vehicle routing problems (VRP).

POST/clusterPOST Cluster Endpoint
Request body

application/jsonClusterRequest (required)

Responses
StatusDescriptionSchema
200A response containing the solutionClusterResponse
400Error occurred when reading the request. Request is invalid.BadRequest
500Error occurred on server side.InternalErrorMessage
POST/cluster/calculateBatch Cluster Endpoint
Request body

application/jsonClusterRequest (required)

Responses
StatusDescriptionSchema
200A jobId you can use to retrieve your solution from the server - see solution endpoint.JobId
400Error occurred when reading client request. Request is invalid.BadRequest
500Error occurred on server side.InternalErrorMessage
GET/cluster/solution/{jobId}GET Batch Solution Endpoint
Parameters
NameInRequiredType
jobIdpathyesstring
Responses
StatusDescriptionSchema
200A response containing the solutionClusterResponse
400Error occurred on client side such as invalid input.BadRequest
404Requested solution could not be found.
500Error occurred on server side.

Try it

Developer reference

Base URLhttps://graphhopper.com/api/1
Rate limit

Free tier: 500 credits/day, capped at 5 locations & 1 vehicle per request, non-commercial use only; paid tiers add per-second caps (Basic 1 req/s, Standard 2 req/s, Premium 10 req/s) alongside higher credits/minute quotas

Key endpoints
  • GET/route
  • GET/geocode
  • GET/matrix
  • GET/isochrone
  • POST/match