> For the complete documentation index, see [llms.txt](https://docs.taal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taal.com/core-products/whatsonchain/exchange-rate.md).

# Exchange Rate

## Get Exchange Rate

This endpoint provides the current exchange rate for the specified blockchain.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/exchangerate
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/exchangerate"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/exchangerate"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "rate": 27.055,
    "time": 1752257180,
    "currency": "USD"
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "rate": 117581.6,
    "time": 1752257200,
    "currency": "USD"
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |

## Get Historical Exchange Rate

This endpoint provides the historical exchange rate data for the specified blockchain.&#x20;

Exchange rate data goes back to:

* `2018/11/19` for BSV.
* `2010/07/18` for BTC.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/main/exchangerate/historical?from=<unixtimestamp>&to=<unixtimestamp>
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/exchangerate/historical?from=1660139745&to=1660312545"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/exchangerate/historical?from=1660139745&to=1660312545"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "rate": 60.3905,
    "time": 1660089600
},{
    "rate": 62.661,
    "time": 1660176000
},{
    "rate": 62.9375,
    "time": 1660262400
}]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "rate": 23962.9,
    "time": 1660089600
},{
    "rate": 23935.3,
    "time": 1660176000
},{
    "rate": 24398.7,
    "time": 1660262400
}]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                                                             |
| --------- | ----------------------------------------------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`.                                     |
| from      | The starting date (`unixtimestamp`) to retrieve the exchange rate data. |
| to        | The end date (`unixtimestamp`) to retrieve the exchange rate data.      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.taal.com/core-products/whatsonchain/exchange-rate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
