NAV
shell python javascript html

Introduction

Welcome to the CryptoTreeMap API! You can use our API Endpoints to retreive an image of our TreeMap charts. You can use this API to embed our charts into your website, or use them with bots.

The TreeMaps generated by this API contain the top 100 assets of a given asset class (Crypto, Stocks, ...), sorted by market cap.

The images are generated every minute server side in a PNG format.

Get URL of the Latest Image

This endpoint gets the url to the most recent chart, charts are generated every minute.

import request 
res    = requests.get("https://api.cryptotreemap.com/latest_url/coins")
result = json.loads(res.text)

curl "https://api.cryptotreemap.com/latest_url/coins"
fetch('https://api.cryptotreemap.com/latest_url/coins')
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
    "url" : "https://api.cryptotreemap.com/pic/top_100_coins_311217_1647727181781.png"
}

HTTP Request

GET http://api.cryptotreemap.com/latest_url/<ID>

URL Parameters

Parameter Description
ID The ID of the asset class requested

Valid ID Values

ID Description
coins Returns a TreeMap of the crypto market (BTC, ETH, ADA, XMR, DOGE, ...)
assets Return a TreeMap of all the assets (Metals (Gold, Silver, ...), Stocks, Crypto)

Redirect to the Latest Image

This endpoint returns a HTTP 302 satus code that redirects you to the image of the most recent chart requested.

<img src="https://api.cryptotreemap.com/latest/assets"></img>

curl "https://api.cryptotreemap.com/latest/assets"
# Found. Redirecting to https://api.cryptotreemap.com/pic/top_100_assets_311293_1647729506099.png

HTTP Request

GET http://api.cryptotreemap.com/latest/<ID>

URL Parameters

Parameter Description
ID The ID of the asset class requested

Valid ID Values

ID Description
coins Returns a TreeMap of the crypto market (BTC, ETH, ADA, XMR, DOGE, ...)
assets Return a TreeMap of all the assets (Metals (Gold, Silver, ...), Stocks, Crypto)

Errors

The CryptoTreeMap API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The requested is hidden for administrators only.
404 Not Found -- The specified file could not be found.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.