> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.feryrides.co.in/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.feryrides.co.in/_mcp/server.

# Get fare estimate

POST https://uat.feryrides.co.in/dmrc/ride/fare-estimate
Content-Type: application/json

Returns fare quotes and ETA for a pickup/drop pair.

- Omit `serviceType` to receive **both** `scooty` and `cab` quotes.
- Pass `serviceType: "scooty"` or `"cab"` to filter.
- Distance and duration are calculated server-side.


Reference: https://docs.feryrides.co.in/api-reference/fare/estimate

## Authentication

- `x-api-key` header (required) — API key provided by Fery for DMRC integration.

## Request

### Body (application/json)

This endpoint expects a FareEstimateRequest.

- `pickupLocation` (Location, required)
- `dropLocation` (Location, required)
- `serviceType` (FareEstimateRequestServiceType, optional) — Omit to receive both scooty and cab quotes.

## Response

### 200

Fare calculated successfully

- `statusCode` (integer, optional)
- `success` (boolean, optional)
- `message` (string, optional)
- `data` (FareEstimateResponseData, optional)

## Errors

### 400 Bad Request Error

Validation or business rule error

- `statusCode` (integer, optional)
- `success` (boolean, optional)
- `message` (string, optional)
- `errors` (map from string to any, optional)

### 401 Unauthorized Error

Missing or invalid API key

- `statusCode` (integer, optional)
- `success` (boolean, optional)
- `message` (string, optional)
- `errors` (map from string to any, optional)

### 500 Internal Server Error

Unexpected server error

- `statusCode` (integer, optional)
- `success` (boolean, optional)
- `message` (string, optional)
- `errors` (map from string to any, optional)

## Types

### Location

- `lat` (double, required)
- `lng` (double, required)
- `address` (string, optional, nullable)

### FareEstimateRequestServiceType

Omit to receive both scooty and cab quotes.

- enum
  - Allowed values: `scooty`, `cab`
- list of enum
  - Allowed values: `scooty`, `cab`

### FareEstimateResponseData

- `code` (string, optional)
- `requestId` (string, optional)
- `rideTime` (double, optional)
- `timeUnit` (string, optional)
- `rideDistance` (double, optional)
- `distanceUnit` (string, optional)
- `quotes` (list of FareQuote, optional)

### FareQuote

- `totalAmount` (double, optional) — Payable amount for this service type
- `dynamicSurge` (double, optional)
- `perKM` (double, optional)
- `perMin` (double, optional)
- `serviceType` (enum, optional)
  - Allowed values: `scooty`, `cab`
- `staticSurge` (double, optional)
- `eta` (double, optional) — Estimated partner arrival in minutes
- `fareBreakup` (FareBreakup, optional)

### FareBreakup

- `platformFee` (double, optional)
- `platformFeeGst` (double, optional)
- `price` (double, optional)
- `discountedPrice` (double, optional)
- `fareGst` (double, optional)
- `totalFare` (double, optional)
- `discountApplied` (string, optional)
- `discountName` (string, optional)

## Examples

### Fare_estimate_example

**Response**

```json
{
  "statusCode": 200,
  "success": true,
  "message": "Fare details and ETA fetched successfully.",
  "data": {
    "code": "FARE_CALCULATED",
    "requestId": "1717235676225158",
    "rideTime": 8,
    "timeUnit": "minute",
    "rideDistance": 2.1,
    "distanceUnit": "km",
    "quotes": [
      {
        "totalAmount": 52,
        "dynamicSurge": 0,
        "perKM": 8,
        "perMin": 0,
        "serviceType": "scooty",
        "staticSurge": 0,
        "eta": 10,
        "fareBreakup": {
          "platformFee": 0.98,
          "platformFeeGst": 0.05,
          "price": 49,
          "discountedPrice": 49,
          "fareGst": 2.45,
          "totalFare": 52,
          "discountApplied": "0 %",
          "discountName": "No Discount"
        }
      },
      {
        "totalAmount": 98,
        "dynamicSurge": 0,
        "perKM": 14,
        "perMin": 0,
        "serviceType": "cab",
        "staticSurge": 0,
        "eta": 10,
        "fareBreakup": {
          "platformFee": 1.96,
          "platformFeeGst": 0.1,
          "price": 98,
          "discountedPrice": 98,
          "fareGst": 4.9,
          "totalFare": 98,
          "discountApplied": "0 %",
          "discountName": "No Discount"
        }
      }
    ]
  }
}
```

**SDK Code**

```python Fare_estimate_example
import requests

url = "https://uat.feryrides.co.in/dmrc/ride/fare-estimate"

headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Fare_estimate_example
const url = 'https://uat.feryrides.co.in/dmrc/ride/fare-estimate';
const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Fare_estimate_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://uat.feryrides.co.in/dmrc/ride/fare-estimate"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Fare_estimate_example
require 'uri'
require 'net/http'

url = URI("https://uat.feryrides.co.in/dmrc/ride/fare-estimate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Fare_estimate_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://uat.feryrides.co.in/dmrc/ride/fare-estimate")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Fare_estimate_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://uat.feryrides.co.in/dmrc/ride/fare-estimate', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Fare_estimate_example
using RestSharp;

var client = new RestClient("https://uat.feryrides.co.in/dmrc/ride/fare-estimate");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Fare_estimate_example
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://uat.feryrides.co.in/dmrc/ride/fare-estimate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Both scooty and cab

**Request**

```json
{
  "pickupLocation": {
    "lat": 28.459119,
    "lng": 77.072912,
    "address": "Metro Station Exit A"
  },
  "dropLocation": {
    "lat": 28.475482,
    "lng": 77.088265,
    "address": "Destination"
  }
}
```

**Response**

```json
{
  "statusCode": 200,
  "success": true,
  "message": "Fare details and ETA fetched successfully.",
  "data": {
    "code": "FARE_CALCULATED",
    "requestId": "1717235676225158",
    "rideTime": 8,
    "timeUnit": "minute",
    "rideDistance": 2.1,
    "distanceUnit": "km",
    "quotes": [
      {
        "totalAmount": 52,
        "dynamicSurge": 0,
        "perKM": 8,
        "perMin": 0,
        "serviceType": "scooty",
        "staticSurge": 0,
        "eta": 10,
        "fareBreakup": {
          "platformFee": 0.98,
          "platformFeeGst": 0.05,
          "price": 49,
          "discountedPrice": 49,
          "fareGst": 2.45,
          "totalFare": 52,
          "discountApplied": "0 %",
          "discountName": "No Discount"
        }
      },
      {
        "totalAmount": 98,
        "dynamicSurge": 0,
        "perKM": 14,
        "perMin": 0,
        "serviceType": "cab",
        "staticSurge": 0,
        "eta": 10,
        "fareBreakup": {
          "platformFee": 1.96,
          "platformFeeGst": 0.1,
          "price": 98,
          "discountedPrice": 98,
          "fareGst": 4.9,
          "totalFare": 98,
          "discountApplied": "0 %",
          "discountName": "No Discount"
        }
      }
    ]
  }
}
```

**SDK Code**

```python Both scooty and cab
import requests

url = "https://uat.feryrides.co.in/dmrc/ride/fare-estimate"

payload = {
    "pickupLocation": {
        "lat": 28.459119,
        "lng": 77.072912,
        "address": "Metro Station Exit A"
    },
    "dropLocation": {
        "lat": 28.475482,
        "lng": 77.088265,
        "address": "Destination"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Both scooty and cab
const url = 'https://uat.feryrides.co.in/dmrc/ride/fare-estimate';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"pickupLocation":{"lat":28.459119,"lng":77.072912,"address":"Metro Station Exit A"},"dropLocation":{"lat":28.475482,"lng":77.088265,"address":"Destination"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Both scooty and cab
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://uat.feryrides.co.in/dmrc/ride/fare-estimate"

	payload := strings.NewReader("{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912,\n    \"address\": \"Metro Station Exit A\"\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265,\n    \"address\": \"Destination\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Both scooty and cab
require 'uri'
require 'net/http'

url = URI("https://uat.feryrides.co.in/dmrc/ride/fare-estimate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912,\n    \"address\": \"Metro Station Exit A\"\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265,\n    \"address\": \"Destination\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Both scooty and cab
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://uat.feryrides.co.in/dmrc/ride/fare-estimate")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912,\n    \"address\": \"Metro Station Exit A\"\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265,\n    \"address\": \"Destination\"\n  }\n}")
  .asString();
```

```php Both scooty and cab
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://uat.feryrides.co.in/dmrc/ride/fare-estimate', [
  'body' => '{
  "pickupLocation": {
    "lat": 28.459119,
    "lng": 77.072912,
    "address": "Metro Station Exit A"
  },
  "dropLocation": {
    "lat": 28.475482,
    "lng": 77.088265,
    "address": "Destination"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Both scooty and cab
using RestSharp;

var client = new RestClient("https://uat.feryrides.co.in/dmrc/ride/fare-estimate");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912,\n    \"address\": \"Metro Station Exit A\"\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265,\n    \"address\": \"Destination\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Both scooty and cab
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "pickupLocation": [
    "lat": 28.459119,
    "lng": 77.072912,
    "address": "Metro Station Exit A"
  ],
  "dropLocation": [
    "lat": 28.475482,
    "lng": 77.088265,
    "address": "Destination"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://uat.feryrides.co.in/dmrc/ride/fare-estimate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Cab only

**Request**

```json
{
  "pickupLocation": {
    "lat": 28.459119,
    "lng": 77.072912
  },
  "dropLocation": {
    "lat": 28.475482,
    "lng": 77.088265
  },
  "serviceType": "cab"
}
```

**Response**

```json
{
  "statusCode": 200,
  "success": true,
  "message": "Fare details and ETA fetched successfully.",
  "data": {
    "code": "FARE_CALCULATED",
    "requestId": "1717235676225158",
    "rideTime": 8,
    "timeUnit": "minute",
    "rideDistance": 2.1,
    "distanceUnit": "km",
    "quotes": [
      {
        "totalAmount": 52,
        "dynamicSurge": 0,
        "perKM": 8,
        "perMin": 0,
        "serviceType": "scooty",
        "staticSurge": 0,
        "eta": 10,
        "fareBreakup": {
          "platformFee": 0.98,
          "platformFeeGst": 0.05,
          "price": 49,
          "discountedPrice": 49,
          "fareGst": 2.45,
          "totalFare": 52,
          "discountApplied": "0 %",
          "discountName": "No Discount"
        }
      },
      {
        "totalAmount": 98,
        "dynamicSurge": 0,
        "perKM": 14,
        "perMin": 0,
        "serviceType": "cab",
        "staticSurge": 0,
        "eta": 10,
        "fareBreakup": {
          "platformFee": 1.96,
          "platformFeeGst": 0.1,
          "price": 98,
          "discountedPrice": 98,
          "fareGst": 4.9,
          "totalFare": 98,
          "discountApplied": "0 %",
          "discountName": "No Discount"
        }
      }
    ]
  }
}
```

**SDK Code**

```python Cab only
import requests

url = "https://uat.feryrides.co.in/dmrc/ride/fare-estimate"

payload = {
    "pickupLocation": {
        "lat": 28.459119,
        "lng": 77.072912
    },
    "dropLocation": {
        "lat": 28.475482,
        "lng": 77.088265
    },
    "serviceType": "cab"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Cab only
const url = 'https://uat.feryrides.co.in/dmrc/ride/fare-estimate';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"pickupLocation":{"lat":28.459119,"lng":77.072912},"dropLocation":{"lat":28.475482,"lng":77.088265},"serviceType":"cab"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Cab only
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://uat.feryrides.co.in/dmrc/ride/fare-estimate"

	payload := strings.NewReader("{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265\n  },\n  \"serviceType\": \"cab\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Cab only
require 'uri'
require 'net/http'

url = URI("https://uat.feryrides.co.in/dmrc/ride/fare-estimate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265\n  },\n  \"serviceType\": \"cab\"\n}"

response = http.request(request)
puts response.read_body
```

```java Cab only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://uat.feryrides.co.in/dmrc/ride/fare-estimate")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265\n  },\n  \"serviceType\": \"cab\"\n}")
  .asString();
```

```php Cab only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://uat.feryrides.co.in/dmrc/ride/fare-estimate', [
  'body' => '{
  "pickupLocation": {
    "lat": 28.459119,
    "lng": 77.072912
  },
  "dropLocation": {
    "lat": 28.475482,
    "lng": 77.088265
  },
  "serviceType": "cab"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Cab only
using RestSharp;

var client = new RestClient("https://uat.feryrides.co.in/dmrc/ride/fare-estimate");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"pickupLocation\": {\n    \"lat\": 28.459119,\n    \"lng\": 77.072912\n  },\n  \"dropLocation\": {\n    \"lat\": 28.475482,\n    \"lng\": 77.088265\n  },\n  \"serviceType\": \"cab\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Cab only
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "pickupLocation": [
    "lat": 28.459119,
    "lng": 77.072912
  ],
  "dropLocation": [
    "lat": 28.475482,
    "lng": 77.088265
  ],
  "serviceType": "cab"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://uat.feryrides.co.in/dmrc/ride/fare-estimate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```