Generating Price Sparklines

Sparklines are small inlined chart (usually line charts) that you see on CoinMarketCap homepage (the small yellow charts on the right of each row).

You can generate the same thing in your sheet, and even more with a simple call to CRYPTOFINANCE:

=SPARKLINE(CRYPTOFINANCE("BTC/USD", "sparkline"))

By default sparklines are returned over the last 7 days.

Note: Calls to sparkline data fall into the Historical Data quota of 25 calls per day per user.

Generating Volume Sparklines

This will show a sparline for the volume in USD in the last 7 days.

=SPARKLINE(CRYPTOFINANCE("BTC/USD", "sparkline_volume"))

Specifying an Exchange

Like any other call to CRYPTOFINANCE, you can prefix an exchange name:

=SPARKLINE(CRYPTOFINANCE("BINANCE:BNB/USDT", "sparkline_volume"))
=SPARKLINE(CRYPTOFINANCE("BINANCE:BNB/USDT", "sparkline"))

Specifying a Different Timeframe

The following timeframes are available: 7d, 10d, 20d, 30d. Default is 7d. Examples of valid calls:

=SPARKLINE(CRYPTOFINANCE("BTC/USD", "sparkline", "10d"))
=SPARKLINE(CRYPTOFINANCE("BTC/USD", "sparkline_volume", "30d"))
=SPARKLINE(CRYPTOFINANCE("BINANCE:BTC/USDT", "sparkline", "20d"))

Hacking Sparklines

The SPARKLINE() function is a built-in function of Google Sheets. CRYPTOFINANCE is just returning data in a format compatible with it, which is a list of numbers.

This means you could compute, for instance, the average price of the last 10 days with:

=AVERAGE(CRYPTOFINANCE("BTC/USD", "sparkline", "10d"))

Or the maximum of the last 7 days volume for a specific exchange/market:

=MAX(CRYPTOFINANCE("BINANCE:ETH/BTC", "sparkline_volume"))