Skip to main content

Calculate Route

Calculate the optimal route between two locations.

Request Body

object
required
Starting location
object
required
Destination location (same structure as origin)

Response

boolean
Route calculation success status
object
Calculated route information

Request Example

Response Example

Success

Calculate Distance

Calculate the distance between two points without full route details.

Request Body

object
required
Starting location with latitud and longitud
object
required
Destination location with latitud and longitud

Response

boolean
Calculation success status
number
Distance in kilometers

Request Example

cURL

Response Example

Success

Display Route on Map

Use the route points to draw a polyline on the map:

Alternative Routes

Currently, the API returns a single optimal route. Support for alternative routes may be added in future versions.

Traffic Consideration

The duration estimate considers:
  • Time of day: Rush hour vs. off-peak
  • Day of week: Weekday vs. weekend
  • Historical data: Average speeds on specific roads
  • Real-time updates: Current traffic conditions (if available)

Error Responses

Bad Request
Invalid coordinates or missing parameters
Internal Server Error
Routing service error

See Also