Overview

Exchange Rates expose Bitnob's live fiat and crypto conversion rates. Fetch a single currency pair, list every rate available for a base currency, or convert a specific amount. Each rate is quoted with separate buy_rate and sell_rate values and is valid for a short window (valid_for_seconds).


Get Exchange Rate

Use Case

Retrieve the live exchange rate for a single currency pair. Pass the source currency as from and the destination as to. Returns the buy_rate, sell_rate, and mid_rate, plus how long the quote stays valid.

Base URL

Query Parameters
1
fromstringRequired

The source (base) currency code, e.g. 'USD'. The rate is expressed as how much of `to` one unit of `from` is worth.

2
tostringRequired

The target currency code, e.g. 'NGN'. Supports fiat (NGN, KES, GHS, ...) and crypto (BTC, USDT, USDC).

Sample Response
1
base_currencystring

The source currency the rate is quoted from.

2
target_currencystring

The currency the rate is quoted into.

3
buy_ratestring

Rate applied when buying `target_currency` with `base_currency`.

4
sell_ratestring

Rate applied when selling `target_currency` for `base_currency`.

5
mid_ratestring

The midpoint between `buy_rate` and `sell_rate`, useful for display.

6
inverse_ratestring

The rate in the opposite direction (one `target_currency` in `base_currency`).

7
valid_for_secondsnumber

How many seconds the quote remains valid before you should re-fetch.

8
percent_change_24hstring

Percentage change in the rate over the last 24 hours.

9
timestampstring (ISO 8601)

When the rate was generated.

Sample Response

List Exchange Rates

Use Case

Retrieve every available rate for a single base currency in one call. Pass the base currency as base. Currencies with no available rate are returned in skipped_currencies rather than failing the request.

Base URL

Query Parameters
1
basestringRequired

The base currency code to list all rates against, e.g. 'USD'.

Sample Response
1
base_currencystring

The base currency all returned rates are quoted from.

2
ratesarray

List of rate objects, one per available target currency.

3
target_currencystring

The currency this rate entry is quoted into.

4
buy_ratestring

Rate applied when buying `target_currency` with `base_currency`.

5
sell_ratestring

Rate applied when selling `target_currency` for `base_currency`.

6
inverse_ratestring

The rate in the opposite direction.

7
percent_change_24hstring

Percentage change in the rate over the last 24 hours.

8
skipped_currenciesstring[]

Currencies that were requested by the base set but have no rate available, each with a short reason.

9
timestampstring (ISO 8601)

When the rate set was generated.

Sample Response

Convert Amount

Use Case

Convert a specific amount from one currency to another using the live sell_rate. Pass from, to, and amount. Returns the converted to_amount and the exact rate_used.

Base URL

Query Parameters
1
fromstringRequired

The currency to convert from, e.g. 'USD'.

2
tostringRequired

The currency to convert to, e.g. 'NGN'.

3
amountnumberRequired

The amount of `from` currency to convert.

Sample Response
1
from_currencystring

The currency that was converted from.

2
to_currencystring

The currency that was converted to.

3
from_amountstring

The original amount supplied in the request.

4
to_amountstring

The resulting converted amount.

5
rate_usedstring

The exact rate applied to perform the conversion.

6
timestampstring (ISO 8601)

When the conversion rate was generated.

Sample Response
Did you find this page useful?

Join our Discord