Skip to content

GraphHopper API

by graphhopper.com

API keyHTTPSTransportation
Open documentation ↗

Overview

A-to-B routing with turn-by-turn instructions

GraphHopper is a transportation API from graphhopper.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 16 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Base URL
https://graphhopper.com/api/1
Version
1.0.0
Endpoints
16
Spec updated
2021-07-19

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://graphhopper.com/api/1/geocode" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://graphhopper.com/api/1/geocode", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://graphhopper.com/api/1/geocode",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
POST/clusterPOST Cluster Endpoint
POST/cluster/calculateBatch Cluster Endpoint
GET/cluster/solution/{jobId}GET Batch Solution Endpoint
GET/geocodeGeocoding Endpoint
GET/isochroneIsochrone Endpoint
POST/matchMap-match a GPX file
GET/matrixGET Matrix Endpoint
POST/matrixPOST Matrix Endpoint
POST/matrix/calculateBatch Matrix Endpoint
GET/matrix/solution/{jobId}GET Batch Matrix Endpoint
GET/routeGET Route Endpoint
POST/routePOST Route Endpoint
GET/route/infoCoverage information
POST/vrpPOST route optimization problem
POST/vrp/optimizePOST route optimization problem (batch mode)
GET/vrp/solution/{jobId}GET the solution (batch mode)

Questions

Does the GraphHopper API need an API key?

Yes. The GraphHopper API uses API key authentication; the documentation explains how to get credentials.

Does the GraphHopper API support HTTPS?

Yes, the GraphHopper API is served over HTTPS.

How many endpoints does the GraphHopper API have?

Its OpenAPI description lists 16 endpoints in version 1.0.0. All of them are shown on this page.

What are alternatives to the GraphHopper API?

Other Transportation APIs include airportsapi, Transport for London, England, Uber, Transport for Spain, Amadeus for Developers.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).