GraphHopper Directions API
graphhopper · Location
With the [GraphHopper Directions API](https://www.graphhopper.com/products/) you can integrate A-to-B route planning, turn-by-turn navigation, route optimization, isochrone calculations and other tools in your application. The GraphHopper Directions API consists of the following RESTful web services: * [Routing API](#tag/Routing-API), * [Route Optimization API](#tag/Route-Optimization-API), * [Isochrone API](#tag/Isochrone-API), * [Map Matching API](#tag/Map-Matching-API), * [Matrix API]
Authentication
Sample Requests
### Introduction  _Geocoding_ describes the process of transforming an textual address representation to a coordinate (`latitude,longitude`). For example the conversion from `Berlin` to `52.5170365,13.3888599`. _Reverse geocoding_ converts a coord
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/geocode?q=test&debug=false&limit=10&point=example&locale=en&reverse=false&provider=default"
import requests
params = {
"q": "test",
"debug": "false",
"limit": "10",
"point": "example",
"locale": "en",
"reverse": "false",
"provider": "default"
}
response = requests.get(
"https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/geocode",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/geocode');
url.searchParams.set('q', 'test');
url.searchParams.set('debug', 'false');
url.searchParams.set('limit', '10');
url.searchParams.set('point', 'example');
url.searchParams.set('locale', 'en');
url.searchParams.set('reverse', 'false');
url.searchParams.set('provider', 'default');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/geocode")
q := baseURL.Query()
q.Set("q", "test")
q.Set("debug", "false")
q.Set("limit", "10")
q.Set("point", "example")
q.Set("locale", "en")
q.Set("reverse", "false")
q.Set("provider", "default")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/geocode")
uri.query = URI.encode_www_form({
"q" => "test",
"debug" => "false",
"limit" => "10",
"point" => "example",
"locale" => "en",
"reverse" => "false",
"provider" => "default"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/geocode?" . http_build_query([
"q" => "test",
"debug" => "false",
"limit" => "10",
"point" => "example",
"locale" => "en",
"reverse" => "false",
"provider" => "default"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));### Example You can get an example response via: ``` curl "https://graphhopper.com/api/1/isochrone?point=51.131108,12.414551&key=[YOUR_KEY]" ``` Don't forget to replace the placeholder with your own key. ### Introduction  An isochrone of a loca
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/isochrone?point=example&buckets=1&vehicle=example&weighting=fastest&time_limit=600&reverse_flow=false&distance_limit=1"
import requests
params = {
"point": "example",
"buckets": "1",
"vehicle": "example",
"weighting": "fastest",
"time_limit": "600",
"reverse_flow": "false",
"distance_limit": "1"
}
response = requests.get(
"https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/isochrone",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/isochrone');
url.searchParams.set('point', 'example');
url.searchParams.set('buckets', '1');
url.searchParams.set('vehicle', 'example');
url.searchParams.set('weighting', 'fastest');
url.searchParams.set('time_limit', '600');
url.searchParams.set('reverse_flow', 'false');
url.searchParams.set('distance_limit', '1');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/isochrone")
q := baseURL.Query()
q.Set("point", "example")
q.Set("buckets", "1")
q.Set("vehicle", "example")
q.Set("weighting", "fastest")
q.Set("time_limit", "600")
q.Set("reverse_flow", "false")
q.Set("distance_limit", "1")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/isochrone")
uri.query = URI.encode_www_form({
"point" => "example",
"buckets" => "1",
"vehicle" => "example",
"weighting" => "fastest",
"time_limit" => "600",
"reverse_flow" => "false",
"distance_limit" => "1"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/isochrone?" . http_build_query([
"point" => "example",
"buckets" => "1",
"vehicle" => "example",
"weighting" => "fastest",
"time_limit" => "600",
"reverse_flow" => "false",
"distance_limit" => "1"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));With this Matrix Endpoint you submit the points and parameters via URL parameters and is the most convenient as it works out-of-the-box in the browser. If possible you should prefer using the [POST Matrix Endpoint](#operation/postMatrix) that avoids problems with many locations and can also gzip the
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/matrix?point=example&vehicle=example&curbside=example&to_point=example&fail_fast=true&out_array=example&from_point=example&point_hint=example&turn_costs=false&to_curbside=example&from_curbside=example&to_point_hint=example&from_point_hint=example&snap_prevention=example"
import requests
params = {
"point": "example",
"vehicle": "example",
"curbside": "example",
"to_point": "example",
"fail_fast": "true",
"out_array": "example",
"from_point": "example",
"point_hint": "example",
"turn_costs": "false",
"to_curbside": "example",
"from_curbside": "example",
"to_point_hint": "example",
"from_point_hint": "example",
"snap_prevention": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/matrix",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/matrix');
url.searchParams.set('point', 'example');
url.searchParams.set('vehicle', 'example');
url.searchParams.set('curbside', 'example');
url.searchParams.set('to_point', 'example');
url.searchParams.set('fail_fast', 'true');
url.searchParams.set('out_array', 'example');
url.searchParams.set('from_point', 'example');
url.searchParams.set('point_hint', 'example');
url.searchParams.set('turn_costs', 'false');
url.searchParams.set('to_curbside', 'example');
url.searchParams.set('from_curbside', 'example');
url.searchParams.set('to_point_hint', 'example');
url.searchParams.set('from_point_hint', 'example');
url.searchParams.set('snap_prevention', 'example');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/matrix")
q := baseURL.Query()
q.Set("point", "example")
q.Set("vehicle", "example")
q.Set("curbside", "example")
q.Set("to_point", "example")
q.Set("fail_fast", "true")
q.Set("out_array", "example")
q.Set("from_point", "example")
q.Set("point_hint", "example")
q.Set("turn_costs", "false")
q.Set("to_curbside", "example")
q.Set("from_curbside", "example")
q.Set("to_point_hint", "example")
q.Set("from_point_hint", "example")
q.Set("snap_prevention", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/matrix")
uri.query = URI.encode_www_form({
"point" => "example",
"vehicle" => "example",
"curbside" => "example",
"to_point" => "example",
"fail_fast" => "true",
"out_array" => "example",
"from_point" => "example",
"point_hint" => "example",
"turn_costs" => "false",
"to_curbside" => "example",
"from_curbside" => "example",
"to_point_hint" => "example",
"from_point_hint" => "example",
"snap_prevention" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/graphhopper.com/1.0.0/matrix?" . http_build_query([
"point" => "example",
"vehicle" => "example",
"curbside" => "example",
"to_point" => "example",
"fail_fast" => "true",
"out_array" => "example",
"from_point" => "example",
"point_hint" => "example",
"turn_costs" => "false",
"to_curbside" => "example",
"from_curbside" => "example",
"to_point_hint" => "example",
"from_point_hint" => "example",
"snap_prevention" => "example"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with GraphHopper Directions API?
GraphHopper Directions API is a Location API. Developers commonly use location APIs for:
- tracking assets and vehicles in real time
- building delivery and logistics apps
- finding nearby businesses or services
- geo-fencing and location-based notifications
- address validation and autocomplete
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. GraphHopper Directions API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?