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

# Get Exchange Rates

GET https://sandbox.currenciesdirect.com/v1/rates

Retrieve the current Market Exchange Rates for one or more currency pairs (such as USDGBP). This information is constantly being updated.

**Authentication:** [Bearer token required](/api-guide/getting-started/authentication#oauth-20-authentication)


Reference: https://docs.redpincompany.com/api-reference/customers/api-integration/rates/get-exchange-rates

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 Bearer token authentication. This API uses OAuth 2.0 Client Credentials flow. Please refer to the [Authentication](/api-guide/getting-started/authentication#oauth-20-authentication) section for detailed information on how to obtain and use your OAuth credentials.

## Servers

- `https://sandbox.currenciesdirect.com` (Sandbox, default)
- `https://api.redpincompany.com` (Production)

## Request

### Query parameters

- `pair` (string, required) — A pair of three letter Currency Codes (as specified by ISO4217). You can provide a single currency pair (e.g. ?pair=USDGBP) or multiple currency pairs (e.g. ?pair=EURAUD&pair=USDEUR) to reduce the number of requests you make.

## Response

### 200

Ok. Successfully retrieved exchange rates. The response contains an array of exchange rate objects, each with the following fields: - **Quote** (string): The exchange rate value as a string to preserve precision (e.g., "1.31100000") - **Time** (string): Timestamp when the rate was last updated in the format "Day Mon DD HH:MM:SS UTC YYYY" (e.g., "Wed Nov 12 10:32:20 UTC 2025") - **Name** (string): The currency pair code (e.g., "GBPUSD")

- `list of ExchangeRate`

## Errors

### 401 Unauthorized Error

Unauthorized - invalid authorization header

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

### 500 Internal Server Error

Bad request - invalid parameters

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

## Types

### ExchangeRate

- `Name` (string, required) — The Currency Code pair in the format of two three-letter ISO 4217 currency codes concatenated together (e.g., "GBPUSD" represents the exchange rate from GBP to USD).
- `Time` (string, required) — Timestamp indicating when the exchange rate was last updated. The format follows the pattern "Day Mon DD HH:MM:SS UTC YYYY" (e.g., "Wed Nov 12 10:32:20 UTC 2025").
- `Quote` (string, required) — The exchange rate price as a string. This represents the conversion rate between the two currencies specified in the Name field. The value is returned as a string to preserve precision and can include multiple decimal places (e.g., "1.31100000").

## Examples

### Single Currency Pair

**Response**

```json
[
  {
    "Name": "GBPUSD",
    "Time": "Wed Nov 12 10:32:20 UTC 2025",
    "Quote": "1.31100000"
  },
  {
    "Name": "USDGBP",
    "Time": "Wed Nov 12 10:32:20 UTC 2025",
    "Quote": "0.76238600"
  }
]
```

**SDK Code**

```python Single Currency Pair
import requests

url = "https://sandbox.currenciesdirect.com/v1/rates"

querystring = {"pair":"USDGBP"}

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Single Currency Pair
const url = 'https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Single Currency Pair
package main

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

func main() {

	url := "https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Single Currency Pair
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Single Currency Pair
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Single Currency Pair
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Single Currency Pair
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP")! 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()
```

### Multiple Currency Pairs

**Response**

```json
[
  {
    "Name": "EURAUD",
    "Time": "Fri Nov 14 05:52:37 UTC 2025",
    "Quote": "1.78000000"
  },
  {
    "Name": "USDEUR",
    "Time": "Fri Nov 14 05:52:37 UTC 2025",
    "Quote": "0.85880000"
  },
  {
    "Name": "USDGBP",
    "Time": "Fri Nov 14 05:52:35 UTC 2025",
    "Quote": "0.76053000"
  }
]
```

**SDK Code**

```python Multiple Currency Pairs
import requests

url = "https://sandbox.currenciesdirect.com/v1/rates"

querystring = {"pair":"USDGBP"}

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Multiple Currency Pairs
const url = 'https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Multiple Currency Pairs
package main

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

func main() {

	url := "https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Multiple Currency Pairs
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Multiple Currency Pairs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Multiple Currency Pairs
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Multiple Currency Pairs
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v1/rates?pair=USDGBP")! 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()
```