Documentation
Everything you need to start building with GraphQue. GraphQue gives you simple APIs for routing, geocoding, distances, and route optimization. The APIs use predictable JSON responses and straightforward parameters, so you can get up and running quickly.
Authentication
All GraphQue API requests require an API key. Add your API key to the request header. You can create a development key from your dashboard whenever you're ready.
Keep your API key private and avoid exposing it in client-side code.
graphque-api-key : gq_your_api_keyGeocoding
https://api.graphque/v1/geocodeSend us an address and we'll return the latitude and longitude your application can use. This is often the first step when you need to turn a real-world location into data for routing or mapping.
{
"address": "Banke Bihari Temple, Vrindavan, Uttar Pradesh"
}{
"status": "success",
"data": {
"address": "Banke Bihari Temple, Vrindavan, Uttar Pradesh",
"found": true,
"location": {
"lat": 27.5798063,
"lng": 77.6904932
},
"formatted_address": "Banke Bihari Temple, Vrindavan, Uttar Pradesh"
}
}Routing
https://api.graphque/v1/routeGive GraphQue an origin, destination, and optional waypoints. We'll calculate the route in the order you provide and return GeoJSON ready to use on your map.
| Parameter | Type | Description |
|---|---|---|
| origin* | {lat: float, lng: float } | Where your journey begins. |
| destination* | {lat: float, lng: float } | Your final destination coordinates. |
| waypoints | Array<{lat, lng}> | Any stops you want to make along the way. |
Sequence Optimization
https://api.graphque/v1/optimizeHave multiple stops to visit? GraphQue can reorder your waypoints to find a more efficient sequence from your starting point to your destination. The request format is the same as /v1/route.optimized_order contains the waypoint indexes in the order GraphQue recommends.
{
"status": "success",
"data": {
"vehicle": "car",
"total_distance_km": 5.8,
"optimized_order": [2, 0, 1]
}
}Distance Matrix
https://api.graphque/v1/matrixNeed to compare several locations at once? The distance matrix endpoint calculates travel times between every combination of coordinates and returns the results as a matrix.
It's useful for applications such as ride sharing, delivery planning, logistics, and travel.
{
"locations": [
{
"lat": 27.5798063,
"lng": 77.6904932
},
{
"lat": 27.57206,
"lng": 77.67197
},
{
"lat": 27.5762,
"lng": 77.6815
}
],
"vehicle_type": "car"
}{
"status": "success",
"data": {
"locations_processed": 3,
"durations_seconds": [
[0, 420.5, 215.3],
[398.2, 0, 180.6],
[205.7, 172.4, 0]
]
}
}Ready to Build?
Get your API key or try an endpoint in the playground to see how they work.