> ## Documentation Index
> Fetch the complete documentation index at: https://rideshare.docs.sumit-dhondikar.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate Fare

> Calculate a fare estimate before booking a ride.

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`**

<ParamField query="distanceKm" type="number" required>
  The trip distance in kilometers.
</ParamField>

<ParamField query="rideType" type="string">
  The type of ride (e.g., `STANDARD`, `PREMIUM`). Defaults to the base tier when omitted.
</ParamField>

<ParamField query="pickupLat" type="number">
  Latitude of the pickup location.
</ParamField>

<ParamField query="pickupLon" type="number">
  Longitude of the pickup location.
</ParamField>

<ParamField query="dropLat" type="number">
  Latitude of the drop-off location.
</ParamField>

<ParamField query="dropLon" type="number">
  Longitude of the drop-off location.
</ParamField>

<ParamField query="routePreference" type="string">
  Preferred routing strategy (e.g., `FASTEST`, `SHORTEST`). Optional.
</ParamField>

## Response

<ResponseField name="fare" type="number">
  The estimated fare in the platform's base currency.
</ResponseField>

<ResponseField name="rideType" type="string">
  The ride type used for the estimate.
</ResponseField>

<ResponseField name="distanceKm" type="number">
  The distance in kilometers used to compute the estimate.
</ResponseField>

<ResponseField name="routePreference" type="string">
  The route preference applied, if any.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "http://localhost:8080/rides/estimate?distanceKm=10&rideType=STANDARD"
  ```

  ```json Response theme={null}
  {
    "fare": 145.00,
    "rideType": "STANDARD",
    "distanceKm": 10.0,
    "routePreference": null
  }
  ```
</CodeGroup>

<Note>
  Providing `pickupLat`, `pickupLon`, `dropLat`, and `dropLon` alongside `distanceKm` allows the server to apply surge pricing and route-aware adjustments to the estimate.
</Note>
