# Get Exchange Rate By Asset Symbols

Through this endpoint customers can obtain exchange rates by asset symbols. The process represents the exchange rate value of a single unit of one asset versus another one. Data is provided per unique asset symbol.

- **Endpoint:** `GET https://rest.cryptoapis.io/market-data/exchange-rates/by-symbol/{fromAssetSymbol}/{toAssetSymbol}`
- **Authentication:** `x-api-key` header
- **Credits cost:** 270 credits for 1 result
- **Documentation page:** https://developers.cryptoapis.io/v-2.2024-12-12-175/RESTapis/exchange-rates/get-exchange-rate-by-asset-symbols/get

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `fromAssetSymbol` | string | yes | Defines the base asset symbol to get a rate for. |
| `toAssetSymbol` | string | yes | Defines the relation asset symbol in which the base asset rate will be displayed. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `calculationTimestamp` | integer | no | Defines the time of the market data used to calculate the exchange rate in UNIX Timestamp. Oldest possible timestamp is 30 days. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The request has been successful. |
| 400 | 400 |
| 401 | 401 |
| 402 | 402 |
| 403 | 403 |
| 409 | The data provided seems to be invalid. |
| 415 | The selected Media Type is unavailable. The Content-Type header should be 'application/json'. |
| 422 | 422 |
| 429 | The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. |
| 500 | An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. |

### Example 200 response

```json
{
  "apiVersion": "2024-12-12",
  "requestId": "601c1710034ed6d407996b30",
  "context": "yourExampleString",
  "data": {
    "item": {
      "calculationTimestamp": 1618577849,
      "fromAssetId": "5b1ea92e584bf50020130612",
      "fromAssetSymbol": "BTC",
      "rate": "54768.26745499848",
      "toAssetId": "5b1ea92e584bf50020130615",
      "toAssetSymbol": "USD"
    }
  }
}
```

### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apiVersion` | string | yes | Specifies the version of the API that incorporates this endpoint. |
| `requestId` | string | yes | Defines the ID of the request. The `requestId` is generated by Crypto APIs and it's unique for every request. |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `data` | object | yes |  |
| `data.item` | object | yes |  |
| `data.item.calculationTimestamp` | integer | yes | Defines the time of the market data used to calculate the exchange rate in UNIX Timestamp. Oldest possible timestamp is 30 days. |
| `data.item.fromAssetId` | string | yes | Defines the base asset Reference ID to get a rate for. |
| `data.item.fromAssetSymbol` | string | yes | Defines the base asset symbol to get a rate for. |
| `data.item.rate` | string | yes | Defines the exchange rate between assets calculated by weighted average of the last trades in every exchange for the last 24 hours by giving more weight to exchanges with higher volume. |
| `data.item.toAssetId` | string | yes | Defines the relation asset Reference ID in which the base asset rate will be displayed. |
| `data.item.toAssetSymbol` | string | yes | Defines the relation asset symbol in which the base asset rate will be displayed. |
