Skip to main content
Use this endpoint to get a fare estimate based on distance and ride preferences before committing to a booking. No authentication required — this is a public endpoint.

Request

GET /rides/estimate
distanceKm
number
required
The trip distance in kilometers.
rideType
string
The type of ride (e.g., STANDARD, PREMIUM). Defaults to the base tier when omitted.
pickupLat
number
Latitude of the pickup location.
pickupLon
number
Longitude of the pickup location.
dropLat
number
Latitude of the drop-off location.
dropLon
number
Longitude of the drop-off location.
routePreference
string
Preferred routing strategy (e.g., FASTEST, SHORTEST). Optional.

Response

fare
number
The estimated fare in the platform’s base currency.
rideType
string
The ride type used for the estimate.
distanceKm
number
The distance in kilometers used to compute the estimate.
routePreference
string
The route preference applied, if any.

Example

curl -X GET "http://localhost:8080/rides/estimate?distanceKm=10&rideType=STANDARD"
Providing pickupLat, pickupLon, dropLat, and dropLon alongside distanceKm allows the server to apply surge pricing and route-aware adjustments to the estimate.