Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

CryptocurrencyData

Tech Notes

  • Crypto-currencies data acquisition with visualization
  • Cryptocurrencies data explorations

Symbols

  • CryptocurrencyData
Crypto-currencies data acquisition with visualization
Introduction
data.bitcoinity.org
Yahoo! Finance
References
Introduction
In this notebook we show how to obtain crypto-currencies data from several data sources and make some basic time series visualizations. We assume the described data acquisition workflow is useful for doing more detailed (exploratory) analysis.
There are multiple crypto-currencies data sources, but a small proportion of them give a convenient way of extracting crypto-currencies data automatically. I found the easiest to work with to be https://finance.yahoo.com/cryptocurrencies, [YF1]. Another easy to work with Bitcoin-only data source is https://data.bitcoinity.org , [DBO1].
(I also looked into using https://www.coindesk.com/coindesk20. )
Remark: The code below is made with certain ad-hoc inductive reasoning that brought meaningful results. This means the code has to be changed if the underlying data organization in [YF1, DBO1] is changed.
Load the paclet (not used below)
In[94]:=
Needs["AntonAntonov`CryptocurrencyData`"]
Yahoo! Finance

Getting cryptocurrencies symbols and summaries

In this section we get all crypto-currencies symbols and related metadata.
Get the data of all crypto-currencies in [YF1]:
In[95]:=
AbsoluteTiming[​​lsData=Import["https://finance.yahoo.com/cryptocurrencies","Data"];​​]
Out[95]=
{7.94988,Null}
Locate the data:
In[96]:=
pos=First@Position[lsData,{"Symbol","Name","Price (Intraday)","Change","% Change",___}];​​dsCryptoCurrenciesColumnNames=lsData〚Sequence@@pos〛​​Length[dsCryptoCurrenciesColumnNames]
Out[97]=
{Symbol,Name,Price (Intraday),Change,% Change,Market Cap,Volume in Currency (Since 0:00 UTC),Volume in Currency (24Hr),Total Volume All Currencies (24Hr),Circulating Supply,52 Week Range,Day Chart}
Out[98]=
12
Get the data:
In[99]:=
dsCryptoCurrencies=lsData〚Sequence@@Append[Most[pos],2]〛;​​Dimensions[dsCryptoCurrencies]
Out[100]=
{25,10}
Make a dataset:
In[101]:=
dsCryptoCurrencies=Dataset[dsCryptoCurrencies][All,AssociationThread[dsCryptoCurrenciesColumnNames〚1;;-3〛,#]&]
Out[101]=
Symbol
Name
Price (Intraday)
Change
% Change
Market Cap
Volume in Currency (Since 0:00 UTC)
Volume in Currency (24Hr)
Total Volume All Currencies (24Hr)
Circulating Supply
BTC-USD
Bitcoin USD
30,254.11
867.5
+2.95%
585.424B
19.032B
19.032B
19.032B
19.35M
ETH-USD
Ethereum USD
2,096.10
21.78
+1.05%
250.207B
8.869B
8.869B
8.869B
119.368M
USDT-USD
Tether USD
1.0003
-0.0001
-0.01%
81.087B
31.712B
31.712B
31.712B
81.061B
BNB-USD
BNB USD
342.18
2.27
+0.67%
53.334B
731.234M
731.234M
731.234M
155.865M
USDC-USD
USD Coin USD
1.0
0.0001
+0.01%
31.38B
4.339B
4.339B
4.339B
31.379B
XRP-USD
XRP USD
0.526506
0.014994
+2.93%
27.247B
1.211B
1.211B
1.211B
51.751B
ADA-USD
Cardano USD
0.440402
0.007689
+1.78%
15.318B
331.455M
331.455M
331.455M
34.782B
DOGE-USD
Dogecoin USD
0.093236
0.002771
+3.06%
12.959B
810.359M
810.359M
810.359M
138.996B
STETH-USD
Lido Staked ETH USD
2,083.12
13.1
+0.63%
12.593B
20.447M
20.447M
20.447M
6.045M
HEX-USD
HEX USD
0.066948
-0.002883
-4.13%
11.61B
8.946M
8.946M
8.946M
173.411B
MATIC-USD
Polygon USD
1.1738
0.0205
+1.78%
10.821B
303.782M
303.782M
303.782M
9.219B
SOL-USD
Solana USD
24.74
0.4
+1.65%
9.706B
452.706M
452.706M
452.706M
392.364M
DOT-USD
Polkadot USD
6.8758
0.1918
+2.87%
8.216B
233.629M
233.629M
233.629M
1.195B
LTC-USD
Litecoin USD
101.3
1.95
+1.96%
7.368B
678.738M
678.738M
678.738M
72.736M
AVAX-USD
Avalanche USD
21.15
0.54
+2.61%
6.906B
272.264M
272.264M
272.264M
326.618M
SHIB-USD
Shiba Inu USD
0.000012
0.0
+1.39%
6.8B
204.38M
204.38M
204.38M
589.544T
WTRX-USD
Wrapped TRON USD
0.066616
0.000679
+1.03%
6.773B
378,412
378,412
378,412
101.676B
BUSD-USD
Binance USD USD
0.999999
-0.000046
-0.00%
6.641B
3.283B
3.283B
3.283B
6.641B
TRX-USD
TRON USD
0.066821
0.000894
+1.36%
6.065B
180.006M
180.006M
180.006M
90.772B
DAI-USD
Dai USD
0.999289
-0.000937
-0.09%
5.055B
124.708M
124.708M
124.708M
5.059B
rows 1–20 of
25
Here are the (generic) crypto-currency symbols:
In[102]:=
lsCryptoCurrencySymbols=StringSplit[Normal@dsCryptoCurrencies[All,"Symbol"],"-"]〚All,1〛
Out[102]=
{BTC,ETH,USDT,BNB,USDC,XRP,ADA,DOGE,STETH,HEX,MATIC,SOL,DOT,LTC,AVAX,SHIB,WTRX,BUSD,TRX,DAI,WBTC,LINK,UNI7083,ATOM,OKB}

Get all time series

In this section we get all the crypto-currencies time series from [YF1].
In[103]:=
AbsoluteTiming[​​ccNow=Round@AbsoluteTime[Date[]]-AbsoluteTime[{1970,1,1,0,0,0}];​​currencySymbol="USD";​​stYFURL=StringTemplate["https://query1.finance.yahoo.com/v7/finance/download/`cryptoCurrencySymbol`-`currencySymbol`?period1=1410825600&period2="<>ToString[ccNow]<>"&interval=1d&events=history&includeAdjustedClose=true"];​​aCryptoCurrenciesDataRaw=​​Association@​​Map[​​(#<>"-"<>currencySymbol)ResourceFunction["ImportCSVToDataset"][stYFURL["cryptoCurrencySymbol"#,"currencySymbol"currencySymbol]]&,lsCryptoCurrencySymbols​​];​​]
Out[103]=
{7.36703,Null}
Remark: Note that in the code above we specified the upper limit of the time span to be the current date. (And shifted it with respect to the epoch start 1970-01-01 used by [YF1].)
Check we good the data with dimensions retrieval:
In[104]:=
Dimensions/@aCryptoCurrenciesDataRaw
Out[104]=
BTC-USD{3136,7},ETH-USD{1987,7},USDT-USD{1987,7},BNB-USD{1987,7},USDC-USD{1654,7},XRP-USD{1987,7},ADA-USD{1987,7},DOGE-USD{1987,7},STETH-USD{847,7},HEX-USD{1219,7},MATIC-USD{1452,7},SOL-USD{1104,7},DOT-USD{972,7},LTC-USD{3136,7},AVAX-USD{1010,7},SHIB-USD{991,7},WTRX-USD{410,7},BUSD-USD{1307,7},TRX-USD{1987,7},DAI-USD{1244,7},WBTC-USD{1540,7},LINK-USD{1987,7},UNI7083-USD{943,7},ATOM-USD{1497,7},OKB-USD{1450,7}
Check we good the data with random sample:
In[105]:=
RandomSample[#,6]&/@KeyTake[aCryptoCurrenciesDataRaw,RandomChoice[Keys@aCryptoCurrenciesDataRaw]]
Out[105]=
DOGE-USD
Date
Open
High
Low
Close
Adj Close
Volume
2019-08-31
0.002482
0.002529
0.002459
0.002511
0.002511
23927277
2017-12-02
0.002122
0.002212
0.002017
0.002149
0.002149
4978180
2020-06-21
0.002447
0.002478
0.002441
0.002447
0.002447
169917761
2018-09-21
0.005695
0.005961
0.005553
0.005684
0.005684
22345300
2021-01-27
0.008255
0.008259
0.007294
0.007482
0.007482
204797186
2022-08-04
0.066197
0.067502
0.066007
0.067357
0.067357
256457805

Here we add the crypto-currencies symbols and convert date strings into date objects.
In[106]:=
AbsoluteTiming[​​aCryptoCurrenciesData=Association@KeyValueMap[Function[{k,v},kv[All,Join["Symbol"k,"DateObject"DateObject[#Date],#]&]],aCryptoCurrenciesDataRaw];​​]
Out[106]=
{3.78473,Null}

Summary

In this section we compute the summary over all datasets:
In[107]:=
ResourceFunction["RecordsSummary"][Join@@Values[aCryptoCurrenciesData],"MaxTallies"30]
Out[107]=

1 Symbol
BTC-USD
3136
LTC-USD
3136
ADA-USD
1987
BNB-USD
1987
DOGE-USD
1987
ETH-USD
1987
LINK-USD
1987
TRX-USD
1987
USDT-USD
1987
XRP-USD
1987
USDC-USD
1654
WBTC-USD
1540
ATOM-USD
1497
MATIC-USD
1452
OKB-USD
1450
BUSD-USD
1307
DAI-USD
1244
HEX-USD
1219
SOL-USD
1104
AVAX-USD
1010
SHIB-USD
991
DOT-USD
972
UNI7083-USD
943
STETH-USD
847
WTRX-USD
410
,
2 DateObject
Min
Wed 17 Sep 2014 00:00:00GMT-4
1st Qu
Fri 6 Sep 2019 00:00:00GMT-4
Mean
Wed 7 Oct 2020 08:55:41GMT-4
Median
Tue 26 Jan 2021 00:00:00GMT-4
3rd Qu
Wed 16 Mar 2022 00:00:00GMT-4
Max
Tue 18 Apr 2023 00:00:00GMT-4
,
3 Date
2022-03-05
25
2022-03-06
25
2022-03-07
25
2022-03-08
25
2022-03-09
25
2022-03-10
25
2022-03-11
25
2022-03-12
25
2022-03-13
25
2022-03-14
25
2022-03-15
25
2022-03-16
25
2022-03-17
25
2022-03-18
25
2022-03-19
25
2022-03-20
25
2022-03-21
25
2022-03-22
25
2022-03-23
25
2022-03-24
25
2022-03-25
25
2022-03-26
25
2022-03-27
25
2022-03-28
25
2022-03-29
25
2022-03-30
25
2022-03-31
25
2022-04-01
25
2022-04-02
25
(Other)
39083
,
4 Open
0.
259
null
94
0.000011
92
0.000012
85
8.×
-6
10
75
9.×
-6
10
61
7.×
-6
10
47
0.00001
47
1.
43
1.0001
41
0.000013
38
0.9999
36
1.0002
32
6.×
-6
10
23
0.000024
17
0.9998
17
0.000022
16
0.000026
15
0.000025
14
0.000023
13
0.000027
13
0.000031
13
0.000021
12
0.000028
12
2.×
-6
10
11
1.0001
11
1.00004
10
1.00019
10
1.×
-6
10
9
(Other)
38642
,
5 High
0.
258
1.0002
117
null
94
0.000011
89
0.000012
83
8.×
-6
10
70
9.×
-6
10
66
0.000013
50
0.00001
42
7.×
-6
10
41
1.0004
36
1.0003
30
0.000025
23
1.0005
21
0.000014
17
0.000022
17
1.0002
17
2.×
-6
10
13
1.0006
13
1.002
13
0.000023
12
0.000028
12
0.000029
12
0.000027
11
0.000032
11
6.×
-6
10
10
0.000024
10
0.000026
10
1.00199
10
(Other)
38600
,
6 Low
0.
259
0.9998
102
null
94
0.000011
90
0.000012
77
8.×
-6
10
75
0.00001
67
7.×
-6
10
63
9.×
-6
10
48
0.9997
42
6.×
-6
10
30
0.9996
29
0.000013
24
0.999801
20
0.9999
20
0.9995
19
0.000024
18
0.000022
16
0.000023
16
0.000026
15
1.×
-6
10
14
1.
14
0.000025
13
0.000028
13
0.00002
12
0.000021
12
0.000033
10
0.000014
9
0.000027
9
(Other)
38578
,
7 Close
0.
258
null
94
0.000011
92
0.000012
85
8.×
-6
10
74
9.×
-6
10
60
7.×
-6
10
49
0.00001
48
1.0001
45
1.
43
0.9999
41
0.000013
38
1.0002
31
6.×
-6
10
23
0.000024
17
0.9998
17
0.000022
16
0.000026
15
0.000025
14
0.000031
14
0.000023
13
0.000027
13
0.000021
12
0.000028
12
2.×
-6
10
11
0.999993
10
1.00005
10
1.00009
10
1.×
-6
10
9
(Other)
38634
,
8 Adj Close
0.
258
null
94
0.000011
92
0.000012
85
8.×
-6
10
74
9.×
-6
10
60
7.×
-6
10
49
0.00001
48
1.0001
45
1.
43
0.9999
41
0.000013
38
1.0002
31
6.×
-6
10
23
0.000024
17
0.9998
17
0.000022
16
0.000026
15
0.000025
14
0.000031
14
0.000023
13
0.000027
13
0.000021
12
0.000028
12
2.×
-6
10
11
0.999993
10
1.00005
10
1.00009
10
1.×
-6
10
9
(Other)
38634
,
9 Volume
null
94
0
66
9
4
36
4
13
3
45
3
51
3
5446317941
3
2
2
4
2
6
2
8
2
10
2
20
2
32
2
50
2
52
2
53
2
69
2
429
2
1881
2
7745
2
1211900
2
2783960
2
3696066
2
12387900
2
14529600
2
15499400
2
26124800
2
(Other)
39586


Plots

Here we plot the “Low” and “High” price time series for each crypto-currency for the last 120 days:
Here we plot the volume time series for each crypto-currency for the last 120 days:
data.bitcoinity.org

Metadata

In this sub-section we assign different metadata elements used in data.bitcoinity.org.
The currencies and exchanges we obtained by examining the output of:
In[60]:=
Import["https://data.bitcoinity.org/markets/price/30d/USD?t=l", "Plaintext"]

Assignments

Getting BTC data

Here we make a template string that for CSV data retrieval from data.bitcoinity.org:
Here is an association with default values for the string template above:
Remark: The metadata assigned above is used to form valid queries for the query string template.
Remark: Not all combinations of parameters are “fully respected” by data.bitcoinity.org. For example, if a data request is with time granularity that is too fine over a large time span, then the returned data is with coarser granularity.

Price for a particular currency and exchange pair

Here we retrieve data by overwriting the parameters for currency, time unit, time span, and exchange:
Here is a summary:

Volume data

Here we retrieve data by overwriting the parameters for data type, time unit, time span, and exchange:
Here is a summary:

Plots

Price data

Here we extract the non-time columns in the tabular price data obtained above and plot the corresponding time series:

Volume data

Here we extract the non-time columns (corresponding to exchanges) in the tabular volume data obtained above and plot the corresponding time series:
References
[DBO1] https://data.bitcoinity.org.

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com