HyperRoute API
HyperRoute API
Welcome to the HyperRoute API documentation. HyperRoute is an advanced routing and logistics optimization engine specifically designed for Turkey's unique transportation network. It provides precise distance calculations, optimal path finding, detailed cost analysis including fuel consumption, and supports multiple vehicle types with their specific characteristics. The engine offers both fastest and shortest route options while considering real-time traffic conditions.
🚀 Quick Start in 3 Steps
🚀 3 Adımda Hızlı Başlangıç
- Get your API key from tech@siriusaitech.com
- Make your first request to
/health - Generate your first optimized route with
/route/generate
Production:
https://api.route.siriusaitech.comTest:
https://test.api.router.siriusaitech.com
Quick Start
Hızlı Başlangıç
Get up and running with HyperRoute API in minutes.
Your First Request
İlk İsteğiniz
curl -X POST https://test.api.router.siriusaitech.com/route/generate \
-H "Authorization: Bearer YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"vehicleTypeId": 5,
"from": {
"lat": "41.0082",
"lng": "28.9784"
},
"to": {
"lat": "40.1885",
"lng": "29.0610"
},
"waypoints": [],
"avoidPoints": [],
"routeType": "fast",
"isToll": 1,
"isShip": 0,
"fuelRatio": 35
}'
const response = await fetch('https://test.api.router.siriusaitech.com/route/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
vehicleTypeId: 5,
from: { lat: "41.0082", lng: "28.9784" },
to: { lat: "40.1885", lng: "29.0610" },
waypoints: [],
avoidPoints: [],
routeType: "fast",
isToll: 1,
isShip: 0,
fuelRatio: 35
})
});
const route = await response.json();
console.log(\`Distance: \${route.data.distance} km\`);
console.log(\`Total Cost: \${route.data.totalCost} TL\`);
import requests
response = requests.post(
'https://test.api.router.siriusaitech.com/route/generate',
headers={
'Authorization': 'Bearer YOUR_ACCESS_KEY',
'Content-Type': 'application/json'
},
json={
'vehicleTypeId': 5,
'from': {'lat': '41.0082', 'lng': '28.9784'},
'to': {'lat': '40.1885', 'lng': '29.0610'},
'waypoints': [],
'avoidPoints': [],
'routeType': 'fast',
'isToll': 1,
'isShip': 0,
'fuelRatio': 35
}
)
route = response.json()
print(f"Distance: {route['data']['distance']} km")
print(f"Total Cost: {route['data']['totalCost']} TL")
Authentication
Kimlik Doğrulama
HyperRoute API uses Bearer token authentication. Include your access key in the Authorization header of every request.
Authorization: Bearer YOUR_ACCESS_KEY
Getting Access Keys
Erişim Anahtarları Edinme
To obtain access keys for development or production use:
- Contact our technical team at tech@siriusaitech.com
- Provide your company name and use case
- Specify if you need test or production access
Rate Limits
Kullanım Sınırları
To ensure fair usage and system stability, the following rate limits apply:
| Limit Type | Default | Enterprise |
|---|---|---|
| Requests per minute | 100 | Custom |
| Request timeout | 30 seconds | 60 seconds |
| Max request size | 10 MB | 10 MB |
Rate limit information is included in response headers:
X-RateLimit-Limit- Your rate limitX-RateLimit-Remaining- Remaining requestsX-RateLimit-Reset- Reset timestamp
Health Check
Sağlık Kontrolü
Check the operational status of the API and its dependencies.
No authentication required for this endpoint.
Response Example
Yanıt Örneği
{
"status": "healthy",
"timestamp": "2024-12-25T10:00:00.000Z",
"uptime": 3600,
"version": "1.0.0",
"services": {
"database": "up",
"cache": "up",
"routeEngine": "up"
}
}
Generate Route
Rota Oluştur
Generate an optimized route with cost calculations.
Request Body
istek Gövdesi
| Parameter | Type | Required | Description |
|---|---|---|---|
vehicleTypeId |
integer | Yes | Vehicle type (1-5) |
from |
object | Yes | Starting coordinates |
to |
object | Yes | Destination coordinates |
routeType |
string | Yes | "fast" or "short" |
waypoints |
array | No | Intermediate waypoints |
avoidPoints |
array | No | Points/areas to avoid |
isToll |
integer | No | Include toll costs (0/1) |
isShip |
integer | No | Include ferry routes (0/1) |
fuelRatio |
number | No | Fuel consumption (L/100km) |
Vehicle Types
Araç Tipleri
1- Automobile2- Minibus3- Bus4- Light Commercial5- Truck
Response Example
Yanıt Örneği
{
"status": true,
"data": {
"distance": 354.82,
"totalCost": 2150.65,
"totalTime": 18540,
"routeId": "route_abc123",
"segments": [
{
"start": {"lat": 41.0082, "lng": 28.9784},
"end": {"lat": 40.1885, "lng": 29.0610},
"distance": 354820,
"duration": 18540
}
],
"costs": {
"fuel": 1850.65,
"toll": 300.00,
"total": 2150.65
}
}
}
Get Route Details
Rota Detaylarını Al
Retrieve detailed information about a previously generated route.
Query Parameters
Sorgu Parametreleri
| Parameter | Type | Required | Description |
|---|---|---|---|
routeId |
string | Yes | The unique route identifier |
Response Example
Yanıt Örneği
{
"status": true,
"data": {
"location": {
"from": {
"lat": "41.0082",
"lng": "28.9784",
"name": "Istanbul"
},
"to": {
"lat": "40.1885",
"lng": "29.0610",
"name": "Bursa"
},
"waypoints": [],
"avoidPoints": []
},
"route": {
"routeId": "route_abc123",
"vehicleType": "Truck",
"routeType": "fast",
"distance": 354.82,
"duration": 18540,
"totalCost": 2150.65,
"fuelCost": 1850.65,
"tollCost": 300.00,
"segments": [
{
"points": [[41.0082, 28.9784], [40.9876, 29.0123]],
"distance": 15.5,
"duration": 900
}
],
"tollPoints": [
{
"name": "Osmangazi Bridge",
"lat": 40.7589,
"lng": 29.7311,
"cost": 300.00
}
]
}
},
"message": "işlem başarılı"
}
Vehicle Types
Araç Tipleri
Get all available vehicle types with their IDs and names.
This endpoint returns the list of vehicle types that can be used in route generation.
Response Example
Yanıt Örneği
{
"status": true,
"data": [
{
"id": 1,
"name": "Automobile"
},
{
"id": 2,
"name": "Minibus"
},
{
"id": 3,
"name": "Bus"
},
{
"id": 4,
"name": "Light Commercial"
},
{
"id": 5,
"name": "Truck"
}
]
}
/route/generate endpoint.
Route History Management
Rota Geçmişi Yönetimi
Get the active version and history of a route using its route key.
Query Parameters
Sorgu Parametreleri
| Parameter | Type | Required | Description |
|---|---|---|---|
routeKey |
string | Yes | The route key to get history for |
Response Example
Yanıt Örneği
{
"status": true,
"data": {
"routeKey": "rou_123456",
"activeRoute": {
"id": 1234,
"routeKey": "rou_123456",
"fromLat": 41.0082,
"fromLng": 28.9784,
"toLat": 39.9334,
"toLng": 32.8597,
"vehicleTypeId": 5,
"vehicleTypeName": "Tır",
"isActive": true,
"totalCost": 450.00,
"kilometer": 453.2,
"totalMinutes": 360,
"waypoints": [...],
"avoidPoints": [...],
"costSummary": {
"totalCost": 450.00,
"hgsOgs": 85.50,
"bridge": 20.00,
"fuel": 344.50
}
},
"history": [
{
"id": 1233,
"routeKey": "rou_123456",
"isActive": false,
"totalCost": 440.00,
"kilometer": 451.5,
"totalMinutes": 355
}
],
"summary": {
"totalVersions": 2,
"hasActiveRoute": true,
"historyCount": 1
}
}
}
Change the active version of a route by activating a historical version.
Request Body
İstek Gövdesi
{
"routeKey": "rou_123456",
"routeId": 1233
}
Parameters
Parametreler
| Field | Type | Required | Description |
|---|---|---|---|
routeKey |
string | Yes | The route key identifier |
routeId |
integer | Yes | ID of the route version to activate |
Response Example
Yanıt Örneği
{
"status": true,
"data": {
"message": "Aktif rota başarıyla değiştirildi",
"activeRoute": {
"id": 1233,
"routeKey": "rou_123456",
"fromLat": 41.0082,
"fromLng": 28.9784,
"toLat": 39.9334,
"toLng": 32.8597,
"vehicleTypeId": 5,
"vehicleTypeName": "Tır",
"isDelete": 0,
"totalCost": 440.00,
"kilometer": 451.5,
"totalMinutes": 355
}
}
}
Usage Statistics
Kullanım İstatistikleri
Get your own API usage statistics.
Query Parameters
Sorgu Parametreleri
| Parameter | Type | Default | Description |
|---|---|---|---|
period |
integer | 7 | Number of days (1-365) |
groupBy |
string | day | Grouping: hour, day, month |
Response Example
Yanıt Örneği
{
"status": true,
"data": {
"accessKey": "us-JNMSZ8V...L1H8",
"period": {
"days": 7,
"startDate": "2024-12-18T10:00:00.000Z",
"endDate": "2024-12-25T10:00:00.000Z"
},
"summary": {
"totalRoutes": 1500,
"totalDistance": "25000.50",
"totalCost": "15000.75",
"avgDistance": "16.67",
"avgCost": "10.00",
"uniqueRoutes": 120
},
"dailyUsage": [
{
"period": "2024-12-25",
"totalRoutes": 50,
"totalDistance": "850.25",
"totalCost": "500.50"
}
],
"vehicleTypes": [
{
"vehicleType": "Kamyon",
"count": 800,
"totalDistance": "15000.00",
"totalCost": "9000.00"
}
],
"routeTypes": [
{
"routeType": "fast",
"count": 900,
"avgDistance": "17.50",
"avgCost": "10.50"
}
]
}
}
Overall Statistics (Admin)
Genel İstatistikler (Yönetici)
Get overall system usage statistics. Requires admin privileges.
Query Parameters
Sorgu Parametreleri
| Parameter | Type | Default | Description |
|---|---|---|---|
period |
integer | 7 | Number of days (1-365) |
Response Example
{
"status": true,
"data": {
"period": {
"days": 7,
"startDate": "2024-12-18T10:00:00.000Z",
"endDate": "2024-12-25T10:00:00.000Z"
},
"keys": [
{
"keyName": "Production Key 1",
"accessKey": "us-JNMSZ8V...L1H8",
"totalRoutes": 5000,
"totalDistance": "85000.00",
"totalCost": "45000.00",
"lastUsed": "2024-12-25T09:45:00.000Z"
},
{
"keyName": "Development Key",
"accessKey": "us-A8M4P1...7WYE",
"totalRoutes": 1500,
"totalDistance": "25000.00",
"totalCost": "15000.00",
"lastUsed": "2024-12-25T08:30:00.000Z"
}
]
}
}
Additional Endpoint
Ek Uç Nokta
Get usage statistics for a specific access key. Requires admin privileges.
Parameters and response format are the same as /usage/my-stats.
Error Handling
Hata Yönetimi
All errors follow a consistent format:
{
"status": false,
"error": {
"message": "Error description",
"code": "ERROR_CODE",
"statusCode": 400
}
}
Common Error Codes
Yaygın Hata Kodları
| Status Code | Error Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing access key |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |
SDKs (Coming Soon)
SDK'lar (Yakında)
We're working on official SDKs to make integration even easier. Stay tuned for:
- JavaScript/TypeScript SDK - Full type support and promise-based API
- Python SDK - Pythonic interface with async support
- PHP SDK - PSR-compliant package via Composer
- Go SDK - Idiomatic Go client with context support
- Java SDK - Maven/Gradle compatible package
Meanwhile, you can use the REST API directly with any HTTP client library.
Best Practices
En İyi Uygulamalar
1. Implement Retry Logic
1. Yeniden Deneme Mantığı Uygulama
Use exponential backoff for transient failures:
async function retryRequest(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;
await new Promise(r => setTimeout(r, Math.pow(2, i) * 1000));
}
}
}
2. Cache Frequently Used Routes
2. Sık Kullanılan Rotaları Önbelleğe Alma
Implement client-side caching for repeated route queries to reduce API calls and improve performance.
3. Handle Rate Limits Gracefully
3. Kullanım Sınırlarını Zararlı Yönetin
Monitor rate limit headers and implement queuing when approaching limits.
4. Use Webhook Notifications
4. Webhook Bildirimlerini Kullanın
For long-running operations, consider using webhooks instead of polling.