Skip to content
tool 05 of 05
§ 06 public utilities

BTC → fiat converter

Live exchange rates against the five fiat currencies the chainkit SDK supports today. Sourced from real provider RPC via the same multi-provider rotation a chainkit customer app would use.

price history

BTC → USD, last 30d.

Currency
Range
fig. 01 · btc / usd 0 points · coingecko
how this works

One call, two providers in rotation.

This page calls /v1/public/btc/rates, which asks the chainkit SDK for every supported fiat rate in one shot. Behind the scenes mempool and CoinGecko take turns — whichever is healthiest answers, the other backs it up. The multiplication happens in your browser.

See live provider performance
api · same call, in code

Use this in your code.

The lookup above is a real call to chainkit's public API. Here's the same request as curl, in Go via the SDK, and the raw JSON response — everything you need to wire it into your own app.

$ curl
curl -sS '/v1/public/btc/rates'
client.go
rates, err := provider.GetExchangeRates(ctx, types.CoinTickerBTC)
if err != nil {
    log.Fatal(err)
}
for _, r := range rates {
    fmt.Printf("BTC → %s  %s\n", r.Currency, r.Rate.Text('f', 2))
}
response.json
// run the lookup above to see the live response
api · same call, in code

Use this in your code.

The chart above hits this endpoint. Resolution auto-selected by the upstream provider — 5-min candles at 24h, hourly at 7d/30d, daily at 1y.

$ curl
curl -sS '/v1/public/btc/history?currency=USD&range=30d'
client.go
since := time.Now().Add(-30 * 24 * time.Hour)
until := time.Now()
points, err := provider.GetHistoricalRates(
    ctx, types.CoinTickerBTC, types.Currency("USD"), since, until,
)
if err != nil {
    log.Fatal(err)
}
for _, p := range points {
    fmt.Printf("%s  %s\n", p.Timestamp.Format(time.RFC3339), p.Rate.Text('f', 2))
}
response.json
// run the lookup above to see the live response