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

# Get Rate

> Read the latest stored Vanryx reference rate for a currency pair.

```text theme={null}
POST https://api.vanryx.com/api/v1/swap/rate
```

Returns the latest stored rate for a currency pair.

> [!WARNING]
>
> This is a stored reference rate. The endpoint does not execute a swap, reserve funds, or guarantee a conversion price. It does not check the age of the stored rate, so do not treat the result as fresh or executable.

## Headers

**Merchant-API-Key** `string` *required*

Your active Vanryx API key. See [API keys and authentication](https://docs.vanryx.com/authentication.md).

**Content-Type** `string`

Use `application/json`. The examples send JSON request bodies.

## Body parameters

**from\_currency** `string` *required*

Maximum 20 characters. Must resolve through the supported public currency symbol mapping. See [Currency symbols](#currency-symbols).

**to\_currency** `string` *required*

Maximum 20 characters. The value is uppercased and matched against stored rate rows.

## How the rate is defined

`rate` is the value of one unit of `from_currency` expressed in `to_currency`.

For example, `{"from_currency":"BTC","to_currency":"USD"}` returns the stored value of 1 BTC in USD.

## Currency symbols

Public symbols for `from_currency`:

`BTC`, `LTC`, `DOGE`, `BCH`, `ETH`, `BNB`, `TRON`, `USDT`, `SOL`, `XRP`, `USDC`, and `USD`.

Use `BNB` and `USDT` for those two assets. Internal codes such as `BSC` and `USDT_TRON` are not the public symbols.

`to_currency` has no fixed allowlist, but a response requires a matching stored rate row. Stored asset-to-USD rates exist for the 11 supported assets. Other pairs may not be populated.

## Response

**data** `object`

**properties**

**rate** `number`

Latest stored rate. This is a JSON number, not a precision-preserving decimal string.

**message** `string`

Result message.

## Errors

| HTTP status | When |
| - | - |
| `401` | `Missing merchant API Key` or `Invalid or inactive API Key`. |
| `422` | `{"message":"Wrong currency code."}` when `from_currency` is not recognized. |
| `422` | A `Rate … not found.` message when no matching stored pair exists. |
| `422` | Field validation failed. |

See [Errors and integration notes](https://docs.vanryx.com/errors.md).

```bash cURL theme={null}
curl --request POST \
  --url https://api.vanryx.com/api/v1/swap/rate \
  --header 'Merchant-API-Key: <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{"from_currency":"BTC","to_currency":"USD"}'
```

```json 200 theme={null}
{
  "data": {
    "rate": 65000.125
  },
  "message": "Operation completed successfully!"
}
```

```json 422 theme={null}
{
  "message": "Wrong currency code."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.