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

# Get recommended rate

GET https://api.bcdtravel.com/{version}/hotels/get_recommended_rate/

Retrieves a recommended rate for the selected hotel.

**Use case**

This endpoint can be used on a reservation check-out page to suggest a more optimal rate (if available) to a user prior to booking. The response contains the hotel room/rate details (similar to the `get_rate_details` endpoint), and basic hotel room/rate information (similar to the `get_rates` endpoint).

**What's next?**

The hotel ID and `rate_key` in the response can be used to book the hotel via the `book` endpoint.


Reference: https://bcdtravel.ferndocs.com/hotel/api-reference/hotel-api/hotels/get-recommended-rate

## Request

### Path parameters

- `version` (string, required)

### Query parameters

- `api_key` (string, optional) — Your public API key. Example: `api_key=testkey`.
- `timestamp` (string, optional) — The UNIX (UTC) timestamp created by your application for this request (in seconds). Must be within 2.5 minutes of the current time.
- `nonce` (string, optional) — A unique cryptographic identifier created by your application to secure the request. Must be 32 characters or less and cannot be reused within 5 minutes.
- `locale` (string, optional) — The language preference of your user. Valid values: en_US, fr_FR, de_DE, es_ES, it_IT, pt_PT, ja_JP, ko_KR. Default is en_US.
- `customer_ip` (string, optional) — The IP address of your user. Allows determination of the user's location for fraud recovery and analytics purposes.
- `session_id` (string, optional) — A unique user session identifier created by your application. Do not use the real user's session identifier. Allows identification of all requests throughout a user session for error handling and troubleshooting.
- `user_agent` (string, optional) — The user agent (device, application or browser) of your user. Allows retrieval of mobile rates and discounts from some providers. Must be properly encoded. Max 32 characters. Required to get discounted mobile rates.
- `configuration_id` (integer, optional) — Configuration ID for proper company settings. Obtain via the get_configurations endpoint.
- `system` (string, optional) — The booking channel. Valid values include: aft, obt, web.
- `rate_key` (string, optional)
- `guest_count` (integer, optional)
- `hotel_id` (integer, optional)
- `date_format_type` (string, optional)
- `search_id` (string, optional)

### Headers

- `Authorization` (string, optional) — Request signature for authentication. Format: Signature YOUR_SIGNATURE. Calculated using HMAC-SHA256 with your secret key.

## Examples

**SDK Code**

```python
import requests

url = "https://api.bcdtravel.com/version/hotels/get_recommended_rate/"

querystring = {"api_key":"your-api-key","timestamp":"2024-01-15T10:30:00Z","nonce":"abc123def456","locale":"en_US","customer_ip":"127.0.0.1","session_id":"sess-a1b2c3d4-e5f6-7890","user_agent":"curl/7.64.0","configuration_id":"4","system":"aft","rate_key":"eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%2BV6e%2FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%2BRczFUuGFr8f3%2FfYHbBs5xaoR6t0oC0372O6oEr%2Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%2FeLc5NQ%3D%3D","guest_count":"1","hotel_id":"574889","date_format_type":"fr","search_id":"68lkU9QBGOmOLdrI2hlaSl"}

headers = {"Authorization": "Signature your-signature-token"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl';
const options = {method: 'GET', headers: {Authorization: 'Signature your-signature-token'}};

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

```go
package main

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

func main() {

	url := "https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl"

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

	req.Header.Add("Authorization", "Signature your-signature-token")

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

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

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

}
```

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

url = URI("https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Signature your-signature-token'

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

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

HttpResponse<String> response = Unirest.get("https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl")
  .header("Authorization", "Signature your-signature-token")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl', [
  'headers' => [
    'Authorization' => 'Signature your-signature-token',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Signature your-signature-token");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Signature your-signature-token"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bcdtravel.com/version/hotels/get_recommended_rate/?api_key=your-api-key&timestamp=2024-01-15T10%3A30%3A00Z&nonce=abc123def456&locale=en_US&customer_ip=127.0.0.1&session_id=sess-a1b2c3d4-e5f6-7890&user_agent=curl%2F7.64.0&configuration_id=4&system=aft&rate_key=eJxNTEtuwjAU3HOKd4AE7Edw3Nk58QNbhMRKUoTYIcGCql213L8JYsEsRqP5sWLOlc3XatQbaAM2S2W5KC1QAJuysPYDCAFP7IDLz%252BV6e%252FzOXgqNmVboXQ04xc3RAJXeA6xY56rMtX7TPIXWZ1Xw2VZ8Nq2ys3kefw7%252BRczFUuGFr8f3%252FfYHbBs5xaoR6t0oC0372O6oEr%252Bou0OiEGlIIp5iO0rfykgrcilN9Zjc7FLfdYd%252FeLc5NQ%253D%253D&guest_count=1&hotel_id=574889&date_format_type=fr&search_id=68lkU9QBGOmOLdrI2hlaSl")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```