Rate Widget
Show the best current lending, staking or borrowing rates for a coin on your own site with two lines of HTML. No API key is needed, and the "Powered by Bitcompare" credit link is built in.
Embed code
Paste where the table should appear
<div class="bitcompare-rates" data-coin="tether" data-category="lending-rates" data-limit="5"><a href="https://bitcompare.net/coins/tether/lending-rates">Powered by Bitcompare</a></div>
<script async src="https://bitcompare.net/static/embed/rates-widget.js"></script>
Add the <script> tag once per page, even if you use several widgets. Each div.bitcompare-rates becomes its own table.
Options
- Name
data-coin- Type
- string
- Description
Coin slug as used on bitcompare.net, for example
tether,usd-coin,bitcoin,ethereum. Defaulttether.
- Name
data-category- Type
- string
- Description
lending-rates(savings and lending),staking-rewardsorloan-rates(borrowing). Defaultlending-rates.
- Name
data-limit- Type
- integer
- Description
Number of providers to show, 1–10. Default
5.
- Name
data-theme- Type
- string
- Description
light(default) ordark.
What it shows
- The top providers for that coin and category, ranked by rate: highest first for lending and staking, lowest first for borrowing.
- Organic rates only. Sponsored placements are left out, so the table is the same neutral data the API returns.
- The rate basis (APY or APR) where we have it, and when the rates were last updated.
- A link to the full comparison on bitcompare.net.
Rates are cached for about 10 minutes, so the widget adds no load to your site and very little to ours.
The credit link
The <a> inside the div is the credit. It links to the Bitcompare page for the coin and category the widget shows (https://bitcompare.net/coins/{coin}/{category}). It is plain HTML in your page, so it works even before the script loads. If it is missing when the script runs, the script adds it back, so the widget always carries "Powered by Bitcompare". Please don't hide it or add rel="nofollow". See Attribution for the rules.
Content Security Policy
If your site sends a CSP header, allow the script and the data request:
CSP directives
script-src https://bitcompare.net;
connect-src https://bitcompare.net;
img-src https://bitcompare-public.sgp1.cdn.digitaloceanspaces.com;
The last line is only needed for provider logos. Without it the table still renders, just without the logos.
Need more?
For your own layout, call the Rates API with a free key (and show the credit link), or use a paid plan to show the data without one.