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.
Query Parameters
The source (base) currency code, e.g. 'USD'. The rate is expressed as how much of `to` one unit of `from` is worth.
The target currency code, e.g. 'NGN'. Supports fiat (NGN, KES, GHS, ...) and crypto (BTC, USDT, USDC).
Sample Response
The source currency the rate is quoted from.
The currency the rate is quoted into.
Rate applied when buying `target_currency` with `base_currency`.
Rate applied when selling `target_currency` for `base_currency`.
The midpoint between `buy_rate` and `sell_rate`, useful for display.
The rate in the opposite direction (one `target_currency` in `base_currency`).
How many seconds the quote remains valid before you should re-fetch.
Percentage change in the rate over the last 24 hours.
When the rate was generated.
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.
Query Parameters
The base currency code to list all rates against, e.g. 'USD'.
Sample Response
The base currency all returned rates are quoted from.
List of rate objects, one per available target currency.
The currency this rate entry is quoted into.
Rate applied when buying `target_currency` with `base_currency`.
Rate applied when selling `target_currency` for `base_currency`.
The rate in the opposite direction.
Percentage change in the rate over the last 24 hours.
Currencies that were requested by the base set but have no rate available, each with a short reason.
When the rate set was generated.
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.
Query Parameters
The currency to convert from, e.g. 'USD'.
The currency to convert to, e.g. 'NGN'.
The amount of `from` currency to convert.
Sample Response
The currency that was converted from.
The currency that was converted to.
The original amount supplied in the request.
The resulting converted amount.
The exact rate applied to perform the conversion.
When the conversion rate was generated.