Build a trending widget

A small widget on your site or app that shows the assets the market talks about most today.

You need: an API key (opens in a new tab) and a place on your page for a small list.

  1. Get an API key

    Create a key on the API keys (opens in a new tab) page and keep it in an environment variable, not in your code. Each request uses credits.

    The API keys page
  2. Call the trending endpoint

    Call get_trending from your server, not from the browser, so the key stays private.

    An example request to the API
  3. Cache for an hour

    Keep the answer for an hour and serve it to your visitors from the cache. This saves credits.

  4. Show the top five

    List the top five with their rank and a link to the asset page. Compare with the Assets (opens in a new tab) page to check that it matches.

  • What you will see

    A widget with the top five assets by attention, refreshed every hour.

  • Data used

    get_trending through the API (opens in a new tab) with one key.

  • Limits

    • Keep the key on your server.
    • Say that the list shows attention, not advice.