DEV Community

Cover image for Free crypto price widgets and a JSON API, no key or sign-up needed
Pratyush Pranjal
Pratyush Pranjal

Posted on

Free crypto price widgets and a JSON API, no key or sign-up needed

At CoinFenla, we've opened up two parts of our crypto market data platform for other developers:

  1. Web Components you can drop into any page with one script tag
  2. A plain JSON API for when you want the numbers and your own UI

The widgets are free on any website, commercial ones included, and the API is free for personal blogs, hobby sites and side projects. You can start with either right now: no key, no account. Here's how they work.

The widgets: one script tag, then HTML

Load the module once, anywhere on the page:

<script type="module"
  src="https://cdn.coinfenla.com/widgets/1/coinfenla-widget.js"
  crossorigin="anonymous"></script>
Enter fullscreen mode Exit fullscreen mode

Then use the elements where you want them:

<!-- Price card with a 7-day line -->
<coinfenla-price coin="ethereum" chart="7d" currency="USD" theme="auto">
  <a href="https://www.coinfenla.com/price/ethereum">CoinFenla</a>
</coinfenla-price>

<!-- Top 5 coins by market cap -->
<coinfenla-list top="5" layout="rows" currency="USD"></coinfenla-list>

<!-- A compact strip of coins you pick -->
<coinfenla-list coins="bitcoin,ethereum,solana,xrp" layout="strip"></coinfenla-list>

<!-- Scrolling ticker of the top 10 -->
<coinfenla-ticker top="10"></coinfenla-ticker>

<!-- Coin-to-currency converter -->
<coinfenla-converter coin="bitcoin" currency="USD"></coinfenla-converter>
Enter fullscreen mode Exit fullscreen mode

Here's a short video of the widgets in action:

A few details that matter in practice:

  • They're standard custom elements, so they work anywhere you can render HTML: a static site, a blog theme or a component in your framework of choice.
  • Make them match your site. theme takes light, dark or auto (follows the visitor's system setting), currency takes any of 8 currencies, and CSS custom properties control colours, corners and font.
  • Small and self-contained. No dependencies, about 10 KB gzipped, rendered in Shadow DOM so your styles and ours don't collide, and they work under a strict Content Security Policy.
  • Accessible by default. 4.5:1 contrast, labelled fields, and checked with axe.
  • Keep the "Powered by CoinFenla" link visible. That's the one condition of using the widgets. The link inside the element also shows on its own if the script doesn't load.
  • Prices refresh on their own while a widget is on screen.
  • No cookies, no tracking. The widgets store nothing in your visitors' browsers. The script and coin logos come from cdn.coinfenla.com and prices from widgets.coinfenla.com, so add both to your privacy notice if it lists third parties.
  • Open source under MIT, free for any website, commercial ones included: github.com/coinfenla/coinfenla-widget

Prefer not to write the markup by hand? The widget builder lets you pick a widget, preview it and copy the code.

The API: JSON over HTTPS

Every route starts with https://api.coinfenla.com/v1. The five largest coins:

curl "https://api.coinfenla.com/v1/coins?size=5"
Enter fullscreen mode Exit fullscreen mode

It answers browser code directly, so you don't need a proxy for a quick prototype:

const res = await fetch('https://api.coinfenla.com/v1/coins?size=5')
const { coins } = await res.json()
console.log(coins[0].name, coins[0].price)
Enter fullscreen mode Exit fullscreen mode

Routes

Route What you get
GET /coins Coins in market-cap order: price, 24h and 7d change, market cap, 24h volume, circulating supply. Takes page, size (1 to 250, default 100) and currency.
GET /coins/{slug} The full record for one coin
GET /coins/{slug}/history Chart points for period=24h, 7d, 1m or 1y, oldest first
GET /global Total market cap and 24h volume, Bitcoin's share, and how many coins rose and fell over the last hour, day and week
GET /currencies Supported currencies and the rate used that day

The slug is the coin's name in its page address, so bitcoin for coinfenla.com/price/bitcoin. Prices come in USD by default; currency also accepts EUR, GBP, JPY, CNY, INR, AUD and CHF. For example, a week of Bitcoin in euros:

https://api.coinfenla.com/v1/coins/bitcoin/history?period=7d&currency=EUR
Enter fullscreen mode Exit fullscreen mode

Rate limits and caching

You get up to 10 requests a second from one address, with bursts of up to 100. Past that the API answers 429 with a Retry-After header. A small wrapper that respects it:

async function getJSON(url, tries = 3) {
  const res = await fetch(url)
  if (res.status === 429 && tries > 0) {
    // Retry-After is in seconds; fall back to 1s if it isn't readable
    const wait = Number(res.headers.get('Retry-After')) || 1
    await new Promise(resolve => setTimeout(resolve, wait * 1000))
    return getJSON(url, tries - 1)
  }
  if (!res.ok) throw new Error(`CoinFenla API returned ${res.status}`)
  return res.json()
}
Enter fullscreen mode Exit fullscreen mode

On a busy site, don't call the API once per visitor. Fetch on the server, keep the answer for a short while and serve everyone from that copy. Each price carries updatedAt, so you always know how fresh it is.

Things the docs will save you from finding out later

  • Numbers come unrounded. Round once, at the point you display them.
  • Times are UTC in ISO 8601, like 2026-11-13T09:41:30Z.
  • Errors share one JSON shape, so one error handler covers every route.
  • There's an OpenAPI description of every route and field, so you can generate a client or load it into your API tool.
  • v1 only grows. Fields can be added but won't be renamed or removed.

API plans and terms, briefly

The free API is for personal blogs and hobby sites. Wherever you show the data, keep a visible "Data from CoinFenla" link. Don't resell the data, build a paid data feed on it or keep a bulk copy as your own database. The free API has no uptime guarantee, and its limits can change. Prices come from exchanges as they're read, and none of it is financial advice. The full terms are in the API docs, linked below.

Why the data is worth embedding

Most price feeds pass along one source's number. CoinFenla reads prices from major exchanges and compares them, so one exchange's odd quote doesn't set the figure your users see. A coin only gets a market cap and rank once its circulating supply has been checked. The widgets and the API serve that same checked data. It's what powers the live crypto prices on our home page and every coin page, such as Bitcoin price today.

If you want a feel for the data before you build on it, the daily crypto market summary and today's top gainers are a quick way to see how it reads at market level.

Links

Building something commercial? Commercial websites and apps use our paid API. Email us at contact@coinfenla.com and we'll set you up.

If you build something with it, drop a link in the comments. We'd also like to hear which endpoint or widget you'd want next.

Top comments (0)