Overview
These tools provide the foundational building blocks for location-aware applications. Beyond rendering fast vector tiles and converting addresses into precise coordinates, the platform equips you with advanced logistics capabilities, including multi-vehicle routing, sequence optimization, and distance matrices, all while allowing you to monitor your workspace quotas in real time.
Authentication
Authenticate API requests by including your workspace key in the graphque-api-key HTTP header. To avoid unauthorized requests, you can easily lock down your API keys using specific IP address and domain origin restrictions.
graphque-api-key : gq_your_api_key
Domain & IP Whitelisting :
If your key has allowedDomains configured, requests must include a matching Origin or Referer header.Usage & Quotas
/v1/usageRetrieve your current monthly workspace API usage, specific key usage, and vector map-tile counters. All usage quotas reset automatically at the start of each calendar month.
const res = await fetch("https://api.graphque.com/v1/usage", {
headers: { "graphque-api-key": "gq_api_key_here" }
});
const data = await res.json();{
"usage": 24,
"keyUsage": 12,
"limit": 1000,
"tileUsage": 180,
"tileLimit": 10000,
"tier": "FREE"
}Errors & Status Codes
GraphQue uses standard HTTP status codes to indicate the success or failure of your API requests.
| Code | Meaning | Common Cause |
| 400 | Bad Request | Waypoint limit exceeded, empty waypoints provided for optimization, or invalid matrix size. |
| 401 | Unauthorized | Missing or invalid graphque-api-key header. |
| 403 | Forbidden | API key is paused or deleted, request originated from an unauthorized IP/domain, or your active subscription expired. |
| 429 | Too Many Requests | Monthly workspace API or tile quota reached, or the 5-call Playground limit has been exhausted. |
Vector Tiles
/v1/tiles/{z}/{x}/{y}.mvtStream vector tiles for slippy map rendering. This endpoint accepts zoom levels from 0 ≤ z ≤ 22 alongside valid grid coordinates. Each request deducts directly from your workspace's tileUsageCount.
const res = await fetch("https://api.graphque.com/v1/tiles/12/2925/1718.mvt", {
headers: { "graphque-api-key": "gq_api_key_here" }
});
const blob = await res.blob();Content-Type: application/vnd.mvt Cache-Control: private, no-store <Binary Tile Stream>
Forward Geocoding
/v1/geocodeTransform street addresses or city names into precise geographic coordinates.
const res = await fetch("https://api.graphque.com/v1/geocode", {
method: "POST",
headers: {
"Content-Type": "application/json",
"graphque-api-key": "gq_api_key_here"
},
body: JSON.stringify({ address: "Bengaluru, India" })
});{
"status": "success",
"data": {
"city": "Bengaluru",
"country": "IN",
"lat": 12.9716,
"lng": 77.5946,
"formatted": "Bengaluru, India",
"source": "graphque_memory"
}
}Reverse Geocoding
/v1/reverse?lat=x&lng=yPlease Note :
x and y are the actual lat and lng values passed along with the request.Provide lat and lng query parameters to resolve exact physical street addresses and location components from geographic coordinates.
const res = await fetch("https://api.graphque.com/v1/reverse?lat=28.6139&lng=77.2090", {
headers: { "graphque-api-key": "gq_api_key_here" }
});{
"status": "success",
"data": {
"address": "Connaught Place, New Delhi, Delhi 110001, India",
"components": {
"city": "New Delhi",
"state": "Delhi",
"postcode": "110001",
"country": "India"
}
}
}