Waypoints¶
Waypoints allow you to add intermediate stops to a route. Used for delivery routes, tour planning, and multi-point trips.
What are Waypoints?¶
Waypoints are intermediate points that must be visited between the origin and destination. A stop duration can be specified for each waypoint.
Basic Usage¶
Waypoints in the Request Body¶
{
"origin": {
"latitude": 41.0082,
"longitude": 28.9784,
"city": "İstanbul"
},
"destination": {
"latitude": 41.0200,
"longitude": 28.9900,
"city": "İstanbul"
},
"waypoints": [
{
"latitude": 41.0100,
"longitude": 28.9800,
"stopDuration": 300
},
{
"latitude": 41.0150,
"longitude": 28.9850,
"stopDuration": 600
}
]
}
Waypoint Parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
| latitude | Number | Optional | Latitude |
| longitude | Number | Optional | Longitude |
| address | String | Optional | Street address |
| city | String | Optional | City name |
| district | String | Optional | District name |
| stopDuration | Integer | Optional | Stop duration (seconds, 0–50000) |
| pass_through | Boolean | Optional | If true, passes through without stopping |
Use Cases¶
1. Delivery Route¶
Use waypoints for multiple delivery points.
2. Fuel Stop¶
Add a fuel station stop on long journeys.
3. Tour Planning¶
Add points of interest as waypoints.
Configuration¶
Stop Duration¶
Specify stopDuration for each waypoint to define how long the vehicle will stay at that point:
Pass-Through¶
If you do not want to stop at a point, use pass_through: true:
Python Example¶
import requests
API_BASE_URL = "https://api.flio.ai"
API_KEY = "YOUR-API-KEY"
payload = {
"origin": {"latitude": 41.0082, "longitude": 28.9784},
"destination": {"latitude": 41.0200, "longitude": 28.9900},
"waypoints": [
{"latitude": 41.0100, "longitude": 28.9800, "stopDuration": 300},
{"latitude": 41.0150, "longitude": 28.9850, "stopDuration": 600}
]
}
url = f"{API_BASE_URL}/solver/route?apiKey={API_KEY}"
response = requests.post(url, json=payload)
result = response.json()
Multi-stop routes with Waypoints — Flio.ai