{"id":7084,"date":"2021-12-12T12:41:58","date_gmt":"2021-12-12T10:41:58","guid":{"rendered":"https:\/\/www.juust.org\/?p=7084"},"modified":"2021-12-12T14:25:34","modified_gmt":"2021-12-12T12:25:34","slug":"how-to-use-coinmarketcap-crypto-and-token-price-data-in-excel","status":"publish","type":"post","link":"https:\/\/www.juust.org\/index.php\/how-to-use-coinmarketcap-crypto-and-token-price-data-in-excel\/2021\/12\/","title":{"rendered":"How to use CoinMarketCap crypto price data in Excel"},"content":{"rendered":"\n<p>How about getting fresh cryptocurrency token price quotes in your Excel spreadsheet ?  <\/p>\n\n\n\n<p>I built a spreadsheet to track the development of the value of an investment in a liquidity pool. I had to register the numbers and prices of each token, the numbers and prices at the start, and the current numbers and prices. I was updating the current price data manually. That gets tiresome, constantly switching screens, typing prices. Clumsy. I wondered if I could use some crypto API to get some of the data. <\/p>\n\n\n\n<p>I figured I could use the CoinMarketCap API to get the price updates of the two pool tokens. I thought I would have to program a routine in VBA to get the data from the CoinMarketCap API.  But that is not necessary. There is an easier way, a web API interface of Excel itself. A working &#8220;no code&#8221; solution.<\/p>\n\n\n\n<p>How does it work ? Well, step by step. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>we define the webrequest<\/li><li>we make the webrequest<\/li><li>we process the response data <\/li><li>we get the prices quotes in a spreadsheet<\/li><li>we refresh the data at the touch of a button<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Defining the webrequest<\/h3>\n\n\n\n<p>Open a new worksheet.<\/p>\n\n\n\n<p>First we are going to define our webrequest : choose &#8216;From Web&#8217; from the Data menu<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/import-data-from-the-web.jpg\"><img fetchpriority=\"high\" decoding=\"async\" width=\"505\" height=\"390\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/import-data-from-the-web.jpg\" alt=\"\" class=\"wp-image-7087\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/import-data-from-the-web.jpg 505w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/import-data-from-the-web-300x232.jpg 300w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/a><\/figure>\n\n\n\n<p> A dialog box will open, choose &#8216;advanced&#8217;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/advanced-settings-.jpg\"><img decoding=\"async\" width=\"966\" height=\"618\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/advanced-settings-.jpg\" alt=\"\" class=\"wp-image-7098\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/advanced-settings-.jpg 966w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/advanced-settings--300x192.jpg 300w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/advanced-settings--768x491.jpg 768w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/a><\/figure>\n\n\n\n<p>We want the current price quote for one particular token. We enter the CoinMarketCap API url for quotes, and the parameters, at &#8216;URL parts&#8217;. First you enter the quotes-Url : <a href=\"https:\/\/pro-api.coinmarketcap.com\/v1\/cryptocurrency\/quotes\/latest?symbol=METADOGE\" target=\"_blank\" rel=\"noopener\">https:\/\/pro-api.coinmarketcap.com\/v1\/cryptocurrency\/quotes\/latest<\/a> Then in the next field you can specify options, like a particular token : <a href=\"https:\/\/pro-api.coinmarketcap.com\/v1\/cryptocurrency\/quotes\/latest?symbol=METADOGE\" target=\"_blank\" rel=\"noopener\">?symbol=METADOGE<\/a> . That limits the returned data to the token we want to track, in this case, the METADOGE token.<\/p>\n\n\n\n<p>We also have to supply an API key with the webrequest, so we enter the API key in the headers. Under &#8216;HTTP request header parameters&#8217; you add the key X-CMC_PRO_API_KEY. The corresponding value is the API key. You can find the API key in the <a href=\"https:\/\/pro.coinmarketcap.com\/account\" target=\"_blank\" rel=\"noreferrer noopener\">account section at the CoinMarketCap website<\/a>. A CoinMarketCap account is free. The basic account gives you 333 calls a day. That is roughly 15 calls an hour.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/apikey.jpg\"><img decoding=\"async\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/apikey.jpg\" alt=\"\" class=\"wp-image-7100\" width=\"803\" height=\"532\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/apikey.jpg 450w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/apikey-300x199.jpg 300w\" sizes=\"(max-width: 803px) 100vw, 803px\" \/><\/a><\/figure>\n\n\n\n<p>When we have entered our URL and our API key, we can make the request, so we can close the form and click OK. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Making the webrequest<\/h3>\n\n\n\n<p>If the webrequest succeeds, we get our response data, that we need to process to get our price quote from the returned data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Processing the response data in Power Query Editor<\/h3>\n\n\n\n<p>Excel made the webrequest, and we have return data. We need to access the response data to get our price quote from it, and to help us do that, a Power Query Editor window will open :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"503\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor-1024x503.jpg\" alt=\"\" class=\"wp-image-7088\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor-1024x503.jpg 1024w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor-300x147.jpg 300w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor-768x378.jpg 768w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor-1536x755.jpg 1536w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Excel-power-query-editor.jpg 1737w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>We can drill down in the response data, which is JSON data. It shows in this form as the &#8220;<strong>data<\/strong>&#8220;-record. We want to access the response data, so click on the &#8220;<strong>data<\/strong>&#8220;-record. The response data of the CoinMarketCap API is a whole data-tree, we are only interested in the price quote, so we have to dig a bit to get at the price data we want.<\/p>\n\n\n\n<p>First we see the requested symbol, METADOGE. Click on it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Metadoge-data-from-CoinMarketCap.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"177\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Metadoge-data-from-CoinMarketCap.jpg\" alt=\"\" class=\"wp-image-7089\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Metadoge-data-from-CoinMarketCap.jpg 583w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Metadoge-data-from-CoinMarketCap-300x91.jpg 300w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/a><\/figure>\n\n\n\n<p>That gives us the basic data of the METADOGE token :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"521\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel.jpg\" alt=\"\" class=\"wp-image-7090\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel.jpg 660w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel-300x237.jpg 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><\/figure>\n\n\n\n<p>We want the token price data, and the last entry in the form is the <strong>quote<\/strong>-record, that is exactly what we are looking for : so click on the <strong>quote<\/strong> record. <\/p>\n\n\n\n<p>We have to choose a currency, we pick USD :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/coinmarketcap-data-in-excel-pick-USD-record.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"566\" height=\"128\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/coinmarketcap-data-in-excel-pick-USD-record.jpg\" alt=\"\" class=\"wp-image-7091\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/coinmarketcap-data-in-excel-pick-USD-record.jpg 566w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/coinmarketcap-data-in-excel-pick-USD-record-300x68.jpg 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/a><\/figure>\n\n\n\n<p>Then we get at the price quote, the data we actually want for our spreadsheet :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel-1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"521\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel-1.jpg\" alt=\"\" class=\"wp-image-7092\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel-1.jpg 660w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-data-from-CoinMarketCap-in-Excel-1-300x237.jpg 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Listing the price quote in the Excel spreadsheet<\/h3>\n\n\n\n<p>That is the data we want, now we want it as table in the spreadsheet. So we pick the button &#8216;Into Table&#8217; from the Convert menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/JSON-data-to-table.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"225\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/JSON-data-to-table.jpg\" alt=\"\" class=\"wp-image-7093\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/JSON-data-to-table.jpg 557w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/JSON-data-to-table-300x121.jpg 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/figure>\n\n\n\n<p>The Power Query Editor will turn the data into a table, ready for the spreadsheet. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Get-crypto-token-data-in-Excel.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"631\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Get-crypto-token-data-in-Excel.jpg\" alt=\"\" class=\"wp-image-7094\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Get-crypto-token-data-in-Excel.jpg 703w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/Get-crypto-token-data-in-Excel-300x269.jpg 300w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><\/a><\/figure>\n\n\n\n<p>We can click &#8220;Close &amp; Load&#8221;, that closes the editor and loads the table in our Excel spreadsheet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The data in Excel<\/h3>\n\n\n\n<p>Once Excel is done getting fresh data from the CoinMarketCap API, we get the data in the table in our workbook :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-cryptocurrency-token-price-data-in-Excel.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"437\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-cryptocurrency-token-price-data-in-Excel.png\" alt=\"\" class=\"wp-image-7095\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-cryptocurrency-token-price-data-in-Excel.png 500w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/METADOGE-cryptocurrency-token-price-data-in-Excel-300x262.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/figure>\n\n\n\n<p>As long as the CoinMarketAPI doesn&#8217;t change, the response data always has the same format. So if you refresh the data link, it returns the exact same table, just with fresh data. You can link to the data in the table and build your spreadsheets based on that table. The API price will always be listed in cell B2 in this example.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Updating, refreshing all data<\/h3>\n\n\n\n<p>If you want the newest data, just hit the Refresh All button on the Data menu : that refreshes all webrequests in the workbook. So you are immediately fully up to date again.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/refresh-all-data-from-webrequests-in-excel-.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"287\" src=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/refresh-all-data-from-webrequests-in-excel-.jpg\" alt=\"\" class=\"wp-image-7096\" srcset=\"https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/refresh-all-data-from-webrequests-in-excel-.jpg 945w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/refresh-all-data-from-webrequests-in-excel--300x91.jpg 300w, https:\/\/www.juust.org\/wp-content\/uploads\/2021\/12\/refresh-all-data-from-webrequests-in-excel--768x233.jpg 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Have fun building your own Excel crypto portfolio manager spreadsheet, with the most recent CoinMarketCap data.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to grab fresh cryptocurrency and token price quotes from CoinMarketCap in Excel.<\/p>\n","protected":false},"author":5796,"featured_media":7097,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[120,119],"tags":[117],"class_list":["post-7084","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bitcoin","category-cryptocurrency","tag-cryptocurrency"],"_links":{"self":[{"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/posts\/7084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/users\/5796"}],"replies":[{"embeddable":true,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/comments?post=7084"}],"version-history":[{"count":9,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/posts\/7084\/revisions"}],"predecessor-version":[{"id":7113,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/posts\/7084\/revisions\/7113"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/media\/7097"}],"wp:attachment":[{"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/media?parent=7084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/categories?post=7084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.juust.org\/index.php\/wp-json\/wp\/v2\/tags?post=7084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}