Calculate batch routes
curl --request POST \
--url https://routing.solvice.io/route/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"routes": [
{
"coordinates": [
[
123
]
],
"bearings": [
[
123
]
],
"radiuses": [
123
],
"hints": [
"<string>"
],
"generate_hints": true,
"alternatives": 5,
"steps": true,
"annotations": [
"<string>"
],
"geometries": "<string>",
"overview": "<string>",
"continue_straight": true,
"approaches": [
"<string>"
],
"waypoints": [
123
],
"snapping": "<string>",
"departureTime": "2024-03-15T08:30:00.000Z",
"interpolate": true,
"exclude": [],
"slice": 123
}
]
}
'import requests
url = "https://routing.solvice.io/route/batch"
payload = { "routes": [
{
"coordinates": [[123]],
"bearings": [[123]],
"radiuses": [123],
"hints": ["<string>"],
"generate_hints": True,
"alternatives": 5,
"steps": True,
"annotations": ["<string>"],
"geometries": "<string>",
"overview": "<string>",
"continue_straight": True,
"approaches": ["<string>"],
"waypoints": [123],
"snapping": "<string>",
"departureTime": "2024-03-15T08:30:00.000Z",
"interpolate": True,
"exclude": [],
"slice": 123
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
routes: [
{
coordinates: [[123]],
bearings: [[123]],
radiuses: [123],
hints: ['<string>'],
generate_hints: true,
alternatives: 5,
steps: true,
annotations: ['<string>'],
geometries: '<string>',
overview: '<string>',
continue_straight: true,
approaches: ['<string>'],
waypoints: [123],
snapping: '<string>',
departureTime: '2024-03-15T08:30:00.000Z',
interpolate: true,
exclude: [],
slice: 123
}
]
})
};
fetch('https://routing.solvice.io/route/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://routing.solvice.io/route/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'routes' => [
[
'coordinates' => [
[
123
]
],
'bearings' => [
[
123
]
],
'radiuses' => [
123
],
'hints' => [
'<string>'
],
'generate_hints' => true,
'alternatives' => 5,
'steps' => true,
'annotations' => [
'<string>'
],
'geometries' => '<string>',
'overview' => '<string>',
'continue_straight' => true,
'approaches' => [
'<string>'
],
'waypoints' => [
123
],
'snapping' => '<string>',
'departureTime' => '2024-03-15T08:30:00.000Z',
'interpolate' => true,
'exclude' => [
],
'slice' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://routing.solvice.io/route/batch"
payload := strings.NewReader("{\n \"routes\": [\n {\n \"coordinates\": [\n [\n 123\n ]\n ],\n \"bearings\": [\n [\n 123\n ]\n ],\n \"radiuses\": [\n 123\n ],\n \"hints\": [\n \"<string>\"\n ],\n \"generate_hints\": true,\n \"alternatives\": 5,\n \"steps\": true,\n \"annotations\": [\n \"<string>\"\n ],\n \"geometries\": \"<string>\",\n \"overview\": \"<string>\",\n \"continue_straight\": true,\n \"approaches\": [\n \"<string>\"\n ],\n \"waypoints\": [\n 123\n ],\n \"snapping\": \"<string>\",\n \"departureTime\": \"2024-03-15T08:30:00.000Z\",\n \"interpolate\": true,\n \"exclude\": [],\n \"slice\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://routing.solvice.io/route/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"routes\": [\n {\n \"coordinates\": [\n [\n 123\n ]\n ],\n \"bearings\": [\n [\n 123\n ]\n ],\n \"radiuses\": [\n 123\n ],\n \"hints\": [\n \"<string>\"\n ],\n \"generate_hints\": true,\n \"alternatives\": 5,\n \"steps\": true,\n \"annotations\": [\n \"<string>\"\n ],\n \"geometries\": \"<string>\",\n \"overview\": \"<string>\",\n \"continue_straight\": true,\n \"approaches\": [\n \"<string>\"\n ],\n \"waypoints\": [\n 123\n ],\n \"snapping\": \"<string>\",\n \"departureTime\": \"2024-03-15T08:30:00.000Z\",\n \"interpolate\": true,\n \"exclude\": [],\n \"slice\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://routing.solvice.io/route/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"routes\": [\n {\n \"coordinates\": [\n [\n 123\n ]\n ],\n \"bearings\": [\n [\n 123\n ]\n ],\n \"radiuses\": [\n 123\n ],\n \"hints\": [\n \"<string>\"\n ],\n \"generate_hints\": true,\n \"alternatives\": 5,\n \"steps\": true,\n \"annotations\": [\n \"<string>\"\n ],\n \"geometries\": \"<string>\",\n \"overview\": \"<string>\",\n \"continue_straight\": true,\n \"approaches\": [\n \"<string>\"\n ],\n \"waypoints\": [\n 123\n ],\n \"snapping\": \"<string>\",\n \"departureTime\": \"2024-03-15T08:30:00.000Z\",\n \"interpolate\": true,\n \"exclude\": [],\n \"slice\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"index": 123,
"result": {
"routes": [
{
"geometry": "{wkqHi~{\\tLb\\uEvH{mA{`@{~Bnr@gSwKkQsp@iDkjBsn@uS}rAtr@ccBt}AuhBxEal@_Ow}AblCqfA~a@mn@{A_Vz~@w|@x{@{PmP{CikA}Sg|@ec@ve@y[xzEyGbLmLmJolA~yCwaB|_B",
"legs": [
{
"steps": [],
"summary": "",
"weight": 1976.1,
"duration": 1976.1,
"distance": 31561.2
}
],
"weight_name": "routability",
"weight": 1976.1,
"duration": 1976.1,
"distance": 31561.2
}
],
"waypoints": [
{
"hint": "eX5AgduYjYYsAAAAlAAAAHIAAAAAAAAAxBf6QX7HzELIz51CAAAAACwAAACUAAAAcgAAAAAAAAAVtwAAlMNKAIj__QKgxEoAwP39AgEAXwRPrDVe",
"distance": 54.20808645369059,
"name": "Avenue de la Restauration",
"location": [
4.899732,
50.200456
]
},
{
"hint": "o_v2gPMxk4KXAAAAQwAAAJsAAADWAwAA4YOXQ0HtBEOh05pDGnn1RJcAAABDAAAAmwAAANYDAAAVtwAAEyhJAG0BAQMAPkkAAAsBAwMAXxRPrDVe",
"distance": 483.4921257061384,
"name": "Route des Trois Communes",
"location": [
4.794387,
50.397549
]
}
]
},
"error": {
"message": "<string>",
"code": "<string>"
}
}
],
"successful": 123,
"failed": 123,
"total": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}Directions
/route/batch
Process multiple route requests in a single API call. Each route in the batch is calculated independently, reducing API overhead for bulk operations.
POST
/
route
/
batch
Calculate batch routes
curl --request POST \
--url https://routing.solvice.io/route/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"routes": [
{
"coordinates": [
[
123
]
],
"bearings": [
[
123
]
],
"radiuses": [
123
],
"hints": [
"<string>"
],
"generate_hints": true,
"alternatives": 5,
"steps": true,
"annotations": [
"<string>"
],
"geometries": "<string>",
"overview": "<string>",
"continue_straight": true,
"approaches": [
"<string>"
],
"waypoints": [
123
],
"snapping": "<string>",
"departureTime": "2024-03-15T08:30:00.000Z",
"interpolate": true,
"exclude": [],
"slice": 123
}
]
}
'import requests
url = "https://routing.solvice.io/route/batch"
payload = { "routes": [
{
"coordinates": [[123]],
"bearings": [[123]],
"radiuses": [123],
"hints": ["<string>"],
"generate_hints": True,
"alternatives": 5,
"steps": True,
"annotations": ["<string>"],
"geometries": "<string>",
"overview": "<string>",
"continue_straight": True,
"approaches": ["<string>"],
"waypoints": [123],
"snapping": "<string>",
"departureTime": "2024-03-15T08:30:00.000Z",
"interpolate": True,
"exclude": [],
"slice": 123
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
routes: [
{
coordinates: [[123]],
bearings: [[123]],
radiuses: [123],
hints: ['<string>'],
generate_hints: true,
alternatives: 5,
steps: true,
annotations: ['<string>'],
geometries: '<string>',
overview: '<string>',
continue_straight: true,
approaches: ['<string>'],
waypoints: [123],
snapping: '<string>',
departureTime: '2024-03-15T08:30:00.000Z',
interpolate: true,
exclude: [],
slice: 123
}
]
})
};
fetch('https://routing.solvice.io/route/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://routing.solvice.io/route/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'routes' => [
[
'coordinates' => [
[
123
]
],
'bearings' => [
[
123
]
],
'radiuses' => [
123
],
'hints' => [
'<string>'
],
'generate_hints' => true,
'alternatives' => 5,
'steps' => true,
'annotations' => [
'<string>'
],
'geometries' => '<string>',
'overview' => '<string>',
'continue_straight' => true,
'approaches' => [
'<string>'
],
'waypoints' => [
123
],
'snapping' => '<string>',
'departureTime' => '2024-03-15T08:30:00.000Z',
'interpolate' => true,
'exclude' => [
],
'slice' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://routing.solvice.io/route/batch"
payload := strings.NewReader("{\n \"routes\": [\n {\n \"coordinates\": [\n [\n 123\n ]\n ],\n \"bearings\": [\n [\n 123\n ]\n ],\n \"radiuses\": [\n 123\n ],\n \"hints\": [\n \"<string>\"\n ],\n \"generate_hints\": true,\n \"alternatives\": 5,\n \"steps\": true,\n \"annotations\": [\n \"<string>\"\n ],\n \"geometries\": \"<string>\",\n \"overview\": \"<string>\",\n \"continue_straight\": true,\n \"approaches\": [\n \"<string>\"\n ],\n \"waypoints\": [\n 123\n ],\n \"snapping\": \"<string>\",\n \"departureTime\": \"2024-03-15T08:30:00.000Z\",\n \"interpolate\": true,\n \"exclude\": [],\n \"slice\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://routing.solvice.io/route/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"routes\": [\n {\n \"coordinates\": [\n [\n 123\n ]\n ],\n \"bearings\": [\n [\n 123\n ]\n ],\n \"radiuses\": [\n 123\n ],\n \"hints\": [\n \"<string>\"\n ],\n \"generate_hints\": true,\n \"alternatives\": 5,\n \"steps\": true,\n \"annotations\": [\n \"<string>\"\n ],\n \"geometries\": \"<string>\",\n \"overview\": \"<string>\",\n \"continue_straight\": true,\n \"approaches\": [\n \"<string>\"\n ],\n \"waypoints\": [\n 123\n ],\n \"snapping\": \"<string>\",\n \"departureTime\": \"2024-03-15T08:30:00.000Z\",\n \"interpolate\": true,\n \"exclude\": [],\n \"slice\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://routing.solvice.io/route/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"routes\": [\n {\n \"coordinates\": [\n [\n 123\n ]\n ],\n \"bearings\": [\n [\n 123\n ]\n ],\n \"radiuses\": [\n 123\n ],\n \"hints\": [\n \"<string>\"\n ],\n \"generate_hints\": true,\n \"alternatives\": 5,\n \"steps\": true,\n \"annotations\": [\n \"<string>\"\n ],\n \"geometries\": \"<string>\",\n \"overview\": \"<string>\",\n \"continue_straight\": true,\n \"approaches\": [\n \"<string>\"\n ],\n \"waypoints\": [\n 123\n ],\n \"snapping\": \"<string>\",\n \"departureTime\": \"2024-03-15T08:30:00.000Z\",\n \"interpolate\": true,\n \"exclude\": [],\n \"slice\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"index": 123,
"result": {
"routes": [
{
"geometry": "{wkqHi~{\\tLb\\uEvH{mA{`@{~Bnr@gSwKkQsp@iDkjBsn@uS}rAtr@ccBt}AuhBxEal@_Ow}AblCqfA~a@mn@{A_Vz~@w|@x{@{PmP{CikA}Sg|@ec@ve@y[xzEyGbLmLmJolA~yCwaB|_B",
"legs": [
{
"steps": [],
"summary": "",
"weight": 1976.1,
"duration": 1976.1,
"distance": 31561.2
}
],
"weight_name": "routability",
"weight": 1976.1,
"duration": 1976.1,
"distance": 31561.2
}
],
"waypoints": [
{
"hint": "eX5AgduYjYYsAAAAlAAAAHIAAAAAAAAAxBf6QX7HzELIz51CAAAAACwAAACUAAAAcgAAAAAAAAAVtwAAlMNKAIj__QKgxEoAwP39AgEAXwRPrDVe",
"distance": 54.20808645369059,
"name": "Avenue de la Restauration",
"location": [
4.899732,
50.200456
]
},
{
"hint": "o_v2gPMxk4KXAAAAQwAAAJsAAADWAwAA4YOXQ0HtBEOh05pDGnn1RJcAAABDAAAAmwAAANYDAAAVtwAAEyhJAG0BAQMAPkkAAAsBAwMAXxRPrDVe",
"distance": 483.4921257061384,
"name": "Route des Trois Communes",
"location": [
4.794387,
50.397549
]
}
]
},
"error": {
"message": "<string>",
"code": "<string>"
}
}
],
"successful": 123,
"failed": 123,
"total": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}{
"code": "<string>",
"message": "<string>",
"timestamp": 123
}Authorizations
API key authentication. Include your API key in the Authorization header.
Body
application/json
Request DTO for batch route processing
Array of route requests to process in batch
Required array length:
2 - 20 elementsShow child attributes
Show child attributes
Response
Batch routes processed successfully. Batch processing is handled by the external routing service.
Response DTO for batch route processing
Array of individual route results
Show child attributes
Show child attributes
Number of routes that processed successfully
Number of routes that failed to process
Total number of routes in the batch
⌘I