Skip to content

Fiat & Rates API

Fiat currency conversion and exchange rate API endpoints.

Exchange rates and currency conversion. All endpoints are public - no authentication required.

Get Exchange Rate

GET /api/v1/rate/{currency}

Auth: None

Get the current BTC exchange rate for a specific fiat currency.

Parameters

FieldTypeRequiredDescription
currencystring (path)YesISO 4217 currency code (e.g. USD, EUR, GBP)

Response 200

FieldTypeDescription
ratenumberCurrent BTC price in the requested currency
json
{
  "rate": 43250.50
}

Example:

bash
curl https://your-lnbits.com/api/v1/rate/USD

List Currencies

GET /api/v1/currencies

Auth: None

List all supported fiat currency codes.

Parameters

None.

Response 200

Array of currency code strings:

json
[
  "USD",
  "EUR",
  "GBP",
  "JPY",
  "BRL",
  "CAD",
  "CHF",
  "CZK"
]

Rate History

GET /api/v1/rate/history

Auth: None

Get historical BTC exchange rates.

Parameters

None.

Response 200

Array of historical rate objects:

FieldTypeDescription
currencystringCurrency code
ratenumberExchange rate
timestampintegerUnix timestamp
json
[
  {
    "currency": "USD",
    "rate": 43250.50,
    "timestamp": 1700000000
  },
  {
    "currency": "USD",
    "rate": 43100.00,
    "timestamp": 1699996400
  }
]

Convert Amount

POST /api/v1/conversion

Auth: None

Convert an amount between satoshis and a fiat currency.

Parameters

FieldTypeRequiredDescription
fromstringYesSource unit ("sat", "BTC", or a currency code)
tostringYesTarget unit ("sat", "BTC", or a currency code)
amountnumberYesAmount to convert

Response 200

FieldTypeDescription
resultnumberConverted amount
json
{
  "result": 43.25
}

Example:

bash
curl -X POST https://your-lnbits.com/api/v1/conversion \
  -H "Content-Type: application/json" \
  -d '{"from": "sat", "to": "USD", "amount": 100000}'

News · Shop · SaaS · Telegram · Released under the MIT License.