{"id":46648,"date":"2021-06-12T00:00:00","date_gmt":"2021-06-12T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/"},"modified":"2025-11-13T12:55:23","modified_gmt":"2025-11-13T20:55:23","slug":"step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/","title":{"rendered":"Step-By-Step Guide to Collecting &#038; Visualizing Historical Cryptocurrency Market Data with GridDB"},"content":{"rendered":"<p>This blog is a continuation of our previous cryptocurrency blog found <a href=\"https:\/\/griddb.net\/en\/blog\/collect-cryptomarket-data-with-griddb\/\">here<\/a><\/p>\n<p>With Bitcoin currently leading the cryptocurrency market, as of this writing, its market cap stands at $1,083,949,725,691l; and by the time we publish this blog post, it may go even higher, all thanks to its high volatility.<\/p>\n<p>Satoshi Nakamoto invented the Bitcoin network in 2009, which was then followed by the cryptocurrency&#8217;s first-ever recorded commercial transaction where Laszlo Hanyecz, a programmer, purchased two Papa John\u00e2\u20ac\u2122s Pizza for 10,000 bitcoins. Back then, the coin didn\u00e2\u20ac\u2122t hold any real value and wasn\u00e2\u20ac\u2122t that big of a deal. But in the past decade, we have witnessed a massive surge, as the coin keeps crossing all-time highs. As of this writing, Bitcoin&#8217;s current value stands at $55,000+ per coin.<\/p>\n<p>If the word of a few of the experts is to be believed, the coin will cross the $100,000 mark soon.Similarly, cryptocurrencies like Ethereum, Binance Coin, XRP, ADA, and various others have been predicted to skyrocket in the next few years. Their prices have been predicted to surge at an exponential rate as well.<\/p>\n<p>The ever-increasing prices of different cryptocurrencies have been attracting countless retail as well as institutional investors from all across the world. Unlike the traditional financial markets, the cryptocurrency market is highly volatile and unpredictable. While financial markets are predictable, the same isn&#8217;t the case with the cryptocurrency market, thanks to its decentralized way of working, growing interest, and high volatility.<\/p>\n<p>That\u00e2\u20ac\u2122s the reason investors and traders all across the world have been looking for fast and reliable analysis tools to stay ahead in the game, helping them make bold predictions in this ever-growing dynamic market. So, to help them with their goals in a much efficient manner, we\u00e2\u20ac\u2122ve come up with a fairly easy way of collecting historical cryptocurrency market data with the help of GridDB, which we\u00e2\u20ac\u2122ll later visualize using Python.<\/p>\n<p>This blog post focuses on collecting historical cryptocurrency market data from the Coingecko API and storing it in a GridDB, and further visualizing it using a Python script. Before we dive in, let&#8217;s look at the technologies we&#8217;ll be using:<\/p>\n<h2>The Technologies We\u00e2\u20ac\u2122ll Be Using to Achieve Our Goal<\/h2>\n<p>Following are the technologies we\u00e2\u20ac\u2122ll be building our tool on top of:<\/p>\n<ul>\n<li>OS: Ubuntu 18.04<\/li>\n<li>Python 3.6<\/li>\n<li>GridDB c Client: v4.5.0<\/li>\n<li>GridDB Server: latest version<\/li>\n<li>GridDB Python Client: 0.8.3<\/li>\n<\/ul>\n<h2>Fetching &amp; Visualizing the Data<\/h2>\n<p>Day-to-day cryptocurrency market data can be fetched via numerous tactics. However, right now, our focus will be on collecting and visualizing the historical data of both Bitcoin and Ethereum.<\/p>\n<p>First, let\u00e2\u20ac\u2122s do it for Bitcoin. While Bitcoin was officially created in 2009, you won\u00e2\u20ac\u2122t be able to fetch the data for the first few years, as the coin wasn\u00e2\u20ac\u2122t traded publicly. Obviously, there exist transactions in the first blocks of the chain; however, back then, the price wasn\u00e2\u20ac\u2122t controlled by the market.<\/p>\n<p>Now, we\u00e2\u20ac\u2122ll be fetching its historical data from the Coingecko API. To do that, we need to install the Python client using the command:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">python3.6 -m pip install pycoingecko\n<\/code><\/pre>\n<\/div>\n<p>We&#8217;re now about to write the Python script, which will help us collect and visualize the historical Bitcoin and Ethereum market data from the Coingecko API.<\/p>\n<p>Let\u00e2\u20ac\u2122s start writing our python script.<\/p>\n<p><strong>Step I:<\/strong> We\u00e2\u20ac\u2122ll import the CoinGecko API.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">from pycoingecko import CoinGeckoAPI\n<\/code><\/pre>\n<\/div>\n<p><strong>Step II:<\/strong> Now, we will import Matplotlib (for data visualization), Pandas, Numpy and Scipy.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">install matplotlib.pylot as plt\nimport pandas as pd\nimport numpy as np\nimport scipy as sp\n<\/code><\/pre>\n<\/div>\n<p><strong>Step III:<\/strong> Here, we are creating the Coingecko APIs instance:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">coingecko = CoinGeckoAPI()\n<\/code><\/pre>\n<\/div>\n<p><strong>Step IV:<\/strong> Next, we will define the functions to be used. We\u00e2\u20ac\u2122ll get our hands on a given cryptocurrency\u00e2\u20ac\u2122s market data with the <em>get_coin_by_id()<\/em> API call. The data fetched will be saved in the cryptocurrency_data.csv.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">def get_data(cryptocurrency):\n    cryptocurrency_data = coingecko.get_coin_by_id(cryptocurrency, market_data='true', sparkline='true')\n    df = pd.DataFrame.from_dict(cryptocurrency_data, orient='index')\n    df.to_csv(r'cryptocurrency_data.csv')\n    return df\n<\/code><\/pre>\n<\/div>\n<p><strong>Step V:<\/strong> Let\u00e2\u20ac\u2122s fetch the data for both Bitcoin and Ethereum.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">get_data('bitcoin')\n\nget_data('ethereum')\n<\/code><\/pre>\n<\/div>\n<p>Now, you can see two cryptocurrency_data.csv files. Let&#8217;s open them one by one.<\/p>\n<p>Here\u00e2\u20ac\u2122s what Bitcoin\u00e2\u20ac\u2122s CSV file looks like:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/8.png?raw=true\" alt=\"\" \/><\/p>\n<p>And the next CSV represents Ethereum\u00e2\u20ac\u2122s market data:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/9.png?raw=true\" alt=\"\" \/><\/p>\n<p><strong>Step VI:<\/strong> Our end-game is to get our hands on the Bitcoin and Ethereum historical market data and ultimately visualize it, so we\u00e2\u20ac\u2122ll now define a function <em>get_historical_data()<\/em> to serve the purpose.<\/p>\n<p>According to the official documentation, the data presented depends on the number of days. If we are tracking one-day Bitcoin data, then it\u00e2\u20ac\u2122ll be presented in minutes. However, if we track historical data ranging from 2-90 days, then the data will be divided and presented in hours.<\/p>\n<p>For more than 90 days, it\u00e2\u20ac\u2122ll be divided and presented on a daily basis.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">def get_historical_data(cryptocurrency, fiat_currency, number_of_days):\n    historic_price = coingecko.get_coin_market_chart_by_id(cryptocurrency, fiat_currency, number_of_days)\n    prices = [price[1] for price in historic_price['prices']]\n    return prices\n<\/code><\/pre>\n<\/div>\n<p>Here, the variable \u00e2\u20ac\u0153prices\u00e2\u20ac\u009d is a list.<\/p>\n<p>For example, for the function:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    print(get_historical_data('bitcoin', 'USD', 5))\n<\/code><\/pre>\n<\/div>\n<p>The output will be:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/49.png?raw=true\" alt=\"\" \/><\/p>\n<p>Let\u00e2\u20ac\u2122s further divide this post into two sections, where Section I represents collecting and visualizing 30-days Ethereum data, and Section II represents the same for Bitcoin.<\/p>\n<h3>Section I: Collecting &amp; Visualizing the Past 30-Days Ethereum Market Data<\/h3>\n<p><strong>Step I:<\/strong> Let\u00e2\u20ac\u2122s capture the past 30 days data for Ethereum and store it in a variable like we did for Bitcoin<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    ethereum = get_historical_data('ethereum', 'USD', 30)\n<\/code><\/pre>\n<\/div>\n<p><strong>Step II:<\/strong> Let\u00e2\u20ac\u2122s save this data in Ethereum.csv.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    et_df = pd.DataFrame(ethereum, columns = ['Ethereum Value'])\n    et_df.index.name = 'Every Hour Count in the Past 30 Days'\n    et_df.to_csv(r'Ethereum.csv')\n    df = pd.read_csv(\"Ethereum.csv\")\n<\/code><\/pre>\n<\/div>\n<p>Here, we are storing all of the generated data in Ethereum.csv. Now, let\u00e2\u20ac\u2122s load it into the GridDB database.<\/p>\n<p><strong>Step III:<\/strong> Now, we\u00e2\u20ac\u2122ll be initializing the GridDB database parameters.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    factory = griddb.StoreFactory.get_instance()\n    argv = sys.argv\n    try:\n    #Get GridStore object\n    gridstore = factory.get_store(\n        notification_member=\"griddb-server:10001\",\n        cluster_name=\"defaultCluster\",\n        username=\"admin\",\n        password=\"admin\"\n    )\n<\/code><\/pre>\n<\/div>\n<p><strong>Step IV:<\/strong> Now, we will create a data frame for our CSV file.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    ethereum_data = pd.read_csv(\"\/ethereum.csv\", na_values=['\\N'])\n    ethereum_data.info()\n<\/code><\/pre>\n<\/div>\n<p>Here\u00e2\u20ac\u2122s what we\u00e2\u20ac\u2122ll get:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/17.png?raw=true\" alt=\"TextDescription automatically generated\" \/><\/p>\n<p><strong>Step V:<\/strong> Now, let\u00e2\u20ac\u2122s interact with the database. The usual way of interacting with the GridDB container is to create a container in it and load the information using the put or multi_put function.<\/p>\n<p>So, let\u00e2\u20ac\u2122s create the container ethereum_container for storing the data. Now, here the most important point to keep in mind is to make sure that the correct data types are defined, otherwise it may cause errors while performing the database operations.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    ethereum_container = \"ETHEREUM\"\n    ethereum_containerInfo = griddb.ContainerInfo(ethereum_container,\n    [[\"count\", griddb.Type.INTEGER],[\"value\", griddb.Type.STRING]],\n    griddb.ContainerType.COLLECTION, True)\n    ethereum_columns = gridstore.put_container(ethereum_containerInfo)\n    ethereum_columns.create_index(\"count\", griddb.IndexType.DEFAULT)\n    ethereum_columns.put_rows(ethereum_data)    \n    print(\"Data added successfully\")    \n    db_data = gridstore.get_container(ethereum_container)\n<\/code><\/pre>\n<\/div>\n<p>Once we have created the container, we loaded the data using the put_rows function. When loaded, the \u00e2\u20ac\u0153Data added successfully\u00e2\u20ac\u009d message will appear in front of you.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/19.png?raw=true\" alt=\"\" \/><\/p>\n<p><strong>Step VI:<\/strong> Now, let\u00e2\u20ac\u2122s play around a bit and run some queries.<\/p>\n<p><strong>Query 1:<\/strong> First of all, let\u00e2\u20ac\u2122s fetch all of that Ethereum data we loaded using the \u00e2\u20ac\u0153Select *\u00e2\u20ac\u009d query.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    query = db_data.query(\"Select *\")\n    rs = query.fetch(False)\n    print(f\"{ethereum_container} Data\")\n    retrieved_data = []\n    while rs.has_next():\n        data = rs.next()\n        retrieved_data = append(newdata)\n        print(retrieved_data)\n<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/21.png?raw=true\" alt=\"Background patternDescription automatically generated\" \/><\/p>\n<p><strong>Query 2:<\/strong> Let\u00e2\u20ac\u2122s fetch Ethereum\u00e2\u20ac\u2122s value for the seventh hour on Day I of the 30 days data we are tracking.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    query = db_data.query(\"select * where count = 7\")\n    rs = query.fetch(False)\n    print(f\"{ethereum_container} Data\")\n    retrieved_data = []\n    while rs.has_next():\n        data = rs.next()\n        retrieved_data = append(newdata)\n        print(retrieved_data)\n<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/23.png?raw=true\" alt=\"\" \/><\/p>\n<p><strong>Query 3:<\/strong> Let\u00e2\u20ac\u2122s fetch some recent data.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    query = db_data.query(\"select * where count &gt;= 600\")\n    rs = query.fetch(False)\n    print(f\"{ethereum_container} Data\")\n    retrieved_data = []\n    while rs.has_next():\n        data = rs.next()\n        retrieved_data = append(newdata)\n        print(retrieved_data)\n<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/25.png?raw=true\" alt=\"Graphical user interface Description automatically generated with medium confidence\" \/><\/p>\n<p><strong>Query 4:<\/strong> Let\u00e2\u20ac\u2122s fetch the time period when the Ethereum value crossed $2,400.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    query = db_data.query(\"select * where value &gt; 2400\")\n    rs = query.fetch(False)\n    print(f\"{ethereum_container} Data\")\n    retrieved_data = []\n    while rs.has_next():\n        data = rs.next()\n        retrieved_data = append(newdata)\n        print(retrieved_data)\n<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/27.png?raw=true\" alt=\"\" \/><\/p>\n<p><strong>Query V:<\/strong> Let\u00e2\u20ac\u2122s do the same for values above $2,000.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    query = db_data.query(\"select * where value &gt;2000\")\n    rs = query.fetch(False)\n    print(f\"{ethereum_container} Data\")\n    retrieved_data = []\n    while rs.has_next():\n        data = rs.next()\n        retrieved_data = append(newdata)\n        print(retrieved_data)\n<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/29.png?raw=true\" alt=\"\" \/><\/p>\n<p><strong>Step VII:<\/strong> We\u00e2\u20ac\u2122ll use this piece of code to avoid any exceptions.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    except griddb.GSException as e:\n    for i in range(e.get_error_stack_size()):\n        print(\"[\", i, \"]\")\n        print(e.get_error_code(i))\n        print(e.get_location(i))\n        print(e.get_message(i))\n<\/code><\/pre>\n<\/div>\n<p><strong>Step VIII:<\/strong> Finally, it\u00e2\u20ac\u2122s time to visualize the data.<\/p>\n<ol>\n<li><strong>Scatter Plot:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    df.plot(x = 'Every Hour Count in the Past 30 Days', y = 'Ethereum Value', kind = 'scatter')\n    plt.xlabel('Every Hour Count in the Past 30 Days')\n    plt.ylabel('Ethereum Value')\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/32.png?raw=true\" alt=\"\" \/><\/p>\n<ol>\n<li><strong>Line Graph:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    df.plot(x = 'Every Hour Count in the Past 30 Days', y = 'Ethereum Value', kind = 'line')\n    plt.xlabel('Every Hour Count in the Past 30 Days')\n    plt.ylabel('Ethereum Value')\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/34.png?raw=true\" alt=\"\" \/><\/p>\n<ol>\n<li><strong>Bar:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    df.plot(x = 'Every Hour Count in the Past 30 Days', y = 'Ethereum Value', kind = 'bar')\n    plt.xlabel('Every Hour Count in the Past 30 Days')\n    plt.ylabel('Ethereum Value')\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/36.png?raw=true\" alt=\"\" \/><\/p>\n<ol>\n<li><strong>Autocorrelogram or Autocorrelation Plot using Statsmodel:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    import statsmodel.api as sm\n    sm.graphics.tsa.plot_acf(df[\"Ethereum Value\"])\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/38.png?raw=true\" alt=\"\" \/><\/p>\n<p>Now that we have visualized the Ethereum market data from the past 30 days let&#8217;s do the same for Bitcoin.<\/p>\n<h3>Section I: Collecting &amp; Visualizing the Past 30-Days Bitcoin Market Data<\/h3>\n<p><strong>Step I:<\/strong> Let\u00e2\u20ac\u2122s fetch the Bitcoin\u00e2\u20ac\u2122s data from the past 30 days and store this list in a variable for better analysis.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    bitcoin = get_historical_data('bitcoin', 'USD', 30)\n<\/code><\/pre>\n<\/div>\n<p><strong>Step II:<\/strong> Now, we will save all of this data in a CSV.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    bt_df = pd.DataFrame(bitcoin, columns = ['Bitcoin Value'])\n    bt_df.index.name = 'Every Hour Count in the Past 30 Days'\n    bt_df.to_csv(r'Bitcoin.csv')\n    df = pd.read_csv(\"Bitcoin.csv\")\n<\/code><\/pre>\n<\/div>\n<p>Here, we are storing all of the generated data in Bitcoin.csv. We can also load all of Bitcoin\u00e2\u20ac\u2122s data into the GridDB database, but here we will just be visualizing it.<\/p>\n<p><strong>Step III:<\/strong> Let\u00e2\u20ac\u2122s visualize it.<\/p>\n<ol>\n<li><strong>Scatter Plot:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    df.plot(x = 'Every Hour Count in the Past 30 Days', y = 'Bitcoin Value', kind = 'scatter')\n    plt.xlabel('Every Hour Count in the Past 30 Days')\n    plt.ylabel('Bitcoin Value')\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/42.png?raw=true\" alt=\"\" \/><\/p>\n<ol>\n<li><strong>Line Graph:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    df.plot(x = 'Every Hour Count in the Past 30 Days', y = 'Bitcoin Value', kind = 'line')\n    plt.xlabel('Every Hour Count in the Past 30 Days')\n    plt.ylabel('Bitcoin Value')\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/44.png?raw=true\" alt=\"\" \/><\/p>\n<ol>\n<li><strong>Bar:<\/strong><\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    df.plot(x = 'Every Hour Count in the Past 30 Days', y = 'Bitcoin Value', kind = 'bar')\n    plt.xlabel('Every Hour Count in the Past 30 Days')\n    plt.ylabel('Bitcoin Value')\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/46.png?raw=true\" alt=\"\" \/><\/p>\n<p><strong>Note:<\/strong> We are tracking every single hour&#8217;s data for the past 30 days, which is why all the values in the X-Axis are colliding.<\/p>\n<p><strong>Autocorrelogram or Autocorrelation Plot using Statsmodel:<\/strong><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-py\">    import statsmodel.api as sm\n    sm.graphics.tsa.plot_acf(df[\"Bitcoin Value\"])\n    plt.show()\n<\/code><\/pre>\n<\/div>\n<p><strong>Graph:<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/Ankit-X\/Ankit\/blob\/main\/48.png?raw=true\" alt=\"\" \/><\/p>\n<p>Similarly, we can capture and visualize historical data of other cryptocurrencies supported by Coingecko API.<\/p>\n<h2>Conclusion<\/h2>\n<p>If you have been planning to invest in Bitcoin, Ethereum, or other cryptocurrencies, you can conduct your research by collecting and visualizing data as we did in this blog post.<\/p>\n<p>The full source code can be found here: <a href=\"https:\/\/github.com\/griddbnet\/Blogs\/blob\/main\/Step-By-Step%20Guide%20to%20Collecting%20%26%20Visualizing%20Historical%20Cryptocurrency%20Market%20Data%20with%20GridDB\/python-code.py\">GitHub<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing, its market cap stands at $1,083,949,725,691l; and by the time we publish this blog post, it may go even higher, all thanks to its high volatility. Satoshi Nakamoto invented the Bitcoin network [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":27582,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46648","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Step-By-Step Guide to Collecting &amp; Visualizing Historical Cryptocurrency Market Data with GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Step-By-Step Guide to Collecting &amp; Visualizing Historical Cryptocurrency Market Data with GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-12T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:55:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1442\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Israel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Israel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\"},\"author\":{\"name\":\"Israel\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/c8a430e7156a9e10af73b1fbb46c2740\"},\"headline\":\"Step-By-Step Guide to Collecting &#038; Visualizing Historical Cryptocurrency Market Data with GridDB\",\"datePublished\":\"2021-06-12T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\"},\"wordCount\":1343,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\",\"url\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\",\"name\":\"Step-By-Step Guide to Collecting & Visualizing Historical Cryptocurrency Market Data with GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg\",\"datePublished\":\"2021-06-12T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:23+00:00\",\"description\":\"This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing,\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg\",\"width\":1920,\"height\":1442},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/c8a430e7156a9e10af73b1fbb46c2740\",\"name\":\"Israel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4df8cfc155402a2928d11f80b0220037b8bd26c4f1b19c4598d826e0306e6307?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4df8cfc155402a2928d11f80b0220037b8bd26c4f1b19c4598d826e0306e6307?s=96&d=mm&r=g\",\"caption\":\"Israel\"},\"url\":\"https:\/\/www.griddb.net\/en\/author\/israel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Step-By-Step Guide to Collecting & Visualizing Historical Cryptocurrency Market Data with GridDB | GridDB: Open Source Time Series Database for IoT","description":"This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Step-By-Step Guide to Collecting & Visualizing Historical Cryptocurrency Market Data with GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing,","og_url":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-06-12T07:00:00+00:00","article_modified_time":"2025-11-13T20:55:23+00:00","og_image":[{"width":1920,"height":1442,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg","type":"image\/jpeg"}],"author":"Israel","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"Israel","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#article","isPartOf":{"@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/"},"author":{"name":"Israel","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/c8a430e7156a9e10af73b1fbb46c2740"},"headline":"Step-By-Step Guide to Collecting &#038; Visualizing Historical Cryptocurrency Market Data with GridDB","datePublished":"2021-06-12T07:00:00+00:00","dateModified":"2025-11-13T20:55:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/"},"wordCount":1343,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/","url":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/","name":"Step-By-Step Guide to Collecting & Visualizing Historical Cryptocurrency Market Data with GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage"},"image":{"@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg","datePublished":"2021-06-12T07:00:00+00:00","dateModified":"2025-11-13T20:55:23+00:00","description":"This blog is a continuation of our previous cryptocurrency blog found here With Bitcoin currently leading the cryptocurrency market, as of this writing,","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/blog\/step-by-step-guide-to-collecting-visualizing-historical-cryptocurrency-market-data-with-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg","contentUrl":"\/wp-content\/uploads\/2021\/06\/coins_1920x1442.jpeg","width":1920,"height":1442},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/c8a430e7156a9e10af73b1fbb46c2740","name":"Israel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4df8cfc155402a2928d11f80b0220037b8bd26c4f1b19c4598d826e0306e6307?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4df8cfc155402a2928d11f80b0220037b8bd26c4f1b19c4598d826e0306e6307?s=96&d=mm&r=g","caption":"Israel"},"url":"https:\/\/www.griddb.net\/en\/author\/israel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46648"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46648\/revisions"}],"predecessor-version":[{"id":51323,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46648\/revisions\/51323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/27582"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}