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.

API Key Header
graphque-api-key : gq_your_api_key

Geocoding

POSThttps://api.graphque/v1/geocode

Send 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.

Request (JSON)
{
  "address": "Banke Bihari Temple, Vrindavan, Uttar Pradesh"
}
Response (200 OK)
{
  "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

POSThttps://api.graphque/v1/route

Give 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.

ParameterTypeDescription
origin*{lat: float, lng: float }Where your journey begins.
destination*{lat: float, lng: float }Your final destination coordinates.
waypointsArray<{lat, lng}>Any stops you want to make along the way.

Sequence Optimization

POSThttps://api.graphque/v1/optimize

Have 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.

Response
{
  "status": "success",
  "data": {
    "vehicle": "car",
    "total_distance_km": 5.8,
    "optimized_order": [2, 0, 1]
  }
}

Distance Matrix

POSThttps://api.graphque/v1/matrix

Need 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.

Request (JSON)
{
  "locations": [
    {
      "lat": 27.5798063,
      "lng": 77.6904932
    },
    {
      "lat": 27.57206,
      "lng": 77.67197
    },
    {
      "lat": 27.5762,
      "lng": 77.6815
    }
  ],
  "vehicle_type": "car"
}
Response (200 OK)
{
  "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.