Pulling cryptocurrency prices into Google Sheets (3 Methods) (2024)

Pulling cryptocurrency prices into Google Sheets (3 Methods) (1)

Are you looking for a way to pull cryptocurrency prices into your Google spreadsheet automatically with a formula? In this lesson I am going to show you three different methods to pull crypto prices into Google Sheets. These methods do NOT require add-ons.

With the first method we will use the GOOGLEFINANCE function, which is very easy to use, and then I will show you a more advanced method so that you can pull any crypto price… and this method uses the IMPORTXML function. I will also show you how to use the IMPORTDATA function to pull crypto prices into your Google spreadsheet.

To pull cryptocurrency prices into Google Sheets, follow these steps:

  1. Type =GOOGLEFINANCE( in a spreadsheet cell to begin the formula
  2. Type a symbol for a cryptocurrency (between quotation marks), like this "BTCUSD"
  3. Press enter on the keyboard (Final formulas will look like this: =GOOGLEFINANCE("BTCUSD")

Below I go over an example of using this method in detail, and then further below I will teach you how to use the IMPORTXML function.

Note that a new method for pulling crypto prices has been added to this page, (the ability to use the IMPORTDATA function for crypto prices). This IMPORTDATA method is described in the video directly below, or you can scroll down to the bottom of the page to read about it. Watch the other video further down the page to get more detail on using the IMPORTXML function. You can also click here to get even more detail on using IMPORTXML.

Click here to get your Google Sheets cheat sheet

Or click here to take the dashboards course

The IMPORTXML function is able to pull in any crypto price, where the GOOGLEFINANCE function is limited on the cryptocurrencies that it can pull. ETHUSD (Ethereum) is another symbol that the GOOGLEFINANCE function will pull.

Table of Contents

Formulas for pulling crypto prices into Google Sheets

The formulas below can be used to pull crypto prices into a Google spreadsheet.

*Note that when using the IMPORTXML function, websites often change the XPath of their website elements and so you will need to follow the lesson below to learn how to retrieve the correct XPath for your formula.

Using GOOGLEFINANCE to pull crypto prices (Formulas)

=GOOGLEFINANCE(R3)

=GOOGLEFINANCE("BTCUSD")

Using IMPORTXML to pull crypto prices (Formula)

=IMPORTDATA("https://cryptoprices.cc/BTC/")

(See below for how to use this method provided by cryptoprices.cc)

Pull cryptocurrency prices into Google Sheets with the GOOGLEFINANCE function

First let's go over the more simple method for pulling crypto prices into Google Sheets, which is by using the GOOGLEFINANCE function. With this method, all that you have to do is specify the cryptocurrency symbol for the criteria in the formula, and the formula will display the current price for that cryptocurrency.

When entering the cryptocurrency symbol that Google Sheets will expect, you have to enter the cryptocurrency “pair”, such as the pair between Bitcoin and US Dollars, which is represented as “BTCUSD”.

When using the GOOGLEFINANCE function with ordinary stock symbols, there is more criteria that you can specify, which would allow you to show many other types of stock data other than just the current price… but we are going to use the most basic criteria for this function by specifying a cryptocurrency symbol only, to display the current price of the specified crypto (When no additional criteria is given to the formula, the default is to show the current price).

The GOOGLEFINANCE function can also be used to pull a wide variety of data for stocks, such as past prices, shares outstanding, etc../ but I will go over that in another article. In this article I will stick to teaching how to pull the current price for cryptocurrencies.

Click here to get the free Google Sheets stock tracker templates.

Example: Pulling crypto prices with GOOGLEFINANCE

In this example we will use the GOOGLEFINANCE function to find the price of Bitcoin, displayed in US Dollars.

To pull the price of a cryptocurrency with the GOOGLEFINANCE function, simply enter the symbol for cryptocurrency pair between quotation marks, as the criteria for the formula, like this: =GOOGLEFINANCE("BTCUSD")

If you wat you can enter the symbol for the cryptocurrency into a cell in your spreadsheet, and then you can simply refer to the cell as the criteria for your formula, like this: =GOOGLEFINANCE("BTCUSD")

Pulling cryptocurrency prices into Google Sheets (3 Methods) (2)

As you can see in the image above, by using the formulas above… the price for Bitcoin is pulled directly into a spreadsheet. You can also pull the price for Ethereum (ETHUSD) with the GOOGLEFINANCE function.

This content was originally created by Corey Bustos / SpreadsheetClass.com

Pull cryptocurrency prices into Google Sheets with the IMPORTXML function

The IMPORTXML function can be used to pull data directly from websites into a Google spreadsheet (This process is called "web scraping"). The formula requires two major components: #1 The website URL, and #2 the XPath of the "element" that contains the data that you want to pull into your spreadsheet.

Check out this article to learn how to use cell references with the IMPORTXML formula, as well as to learn more details about using the IMPORTXML formula. In that article I go over the process of finding the correct XPath in much more detail.

The video below goes over using IMPORTXML in more detail than the video at the top.

Below is an example of the IMPORTXML formula. Notice the first criteria is the URL, and the second criteria is the XPath which is a long code. Both of these criteria are entered between quotation marks.

=importxml("https://www.coinbase.com/price/loopring", "/html/body/div[1]/div/div/main/div/section[2]/div/div[1]/div[1]/ div/div/div/div/div[1]/div[1]/div[1]")

The URL can simply be copied from the top of the web page that you want to pull data from.

The XPath can be copied from the element of the webpage that you want to pull data from.

Pulling cryptocurrency prices into Google Sheets (3 Methods) (3)

In the image above, you can see multiple examples of using the IMPORTXML function to pull crypto prices, from a variety of websites. This also will show you that you can use cell references to refer to the website URL, and the XPath, which in this case have been entered into cells A7 (URL) and B7 (XPath). You can see that the formula =IMPORTXML(A7,B7) fetches the crypto price because the correct URL and XPath are entered into the cells that the formula refers to.

The same image also shows multiple examples of using the GOOGLEFINANCE function (such as for pulling the price for Ethereum), for comparison.

Using cell references with the IMPORTXML formula

The main lesson on using the IMPORTXML function will go over using cell references in more detail, such as how to combine text / cells to make the URL update by simply entering a stock / crypto symbol in a cell… but note that if you want, instead of entering the URL and XPath directly into the IMPORTXML formula, you can enter the URL and XPath into a spreadsheet cell, and then you can simply refer to those cells with your IMPORTXML formula. For example, if you pasted the website URL into cell A1, and you pasted the XPath into cell B1, your IMPORTXML formula could be built like this when using cell references:

=IMPORTXML(A1, B1)

Or you can use a combination of cell references and text, like this:

=IMPORTXML(A1, "/html/body/div[1]/div/div/main/div/section[2]/div/div[1]/div[1]/ div/div/div/div/div[1]/div[1]/div[1]")

Or like this:

=IMPORTXML("https://www.coinbase.com/price/loopring", B1)

Pulling crypto prices from a website

Each web page is made up of many "elements". Each button, toolbar, table, etc., is an "element". Each element has what is called an "XPath", which is code that tells a computer / Google Sheets where to find the element that you are specifying.

(Note that the XPath for website elements will change when companies update their websites, and so sometimes you will need to update the XPath for your formula.)

The XPath can be found and copied on a web page, by doing the following:

  • Go to the website that you want to pull data from / that contains the desired element
  • Hover your cursor over the element that you want to pull data from / copy the XPath of
  • Right-click, and then click "Inspect"
  • After the code pops up on the right, drag your cursor up and down, and look on the left of your screen while doing so, so that you can see which elements are being highlighted as you hover your cursor over different lines of code
  • When your cursor is hovered over the code for the correct element, right-click your mouse
  • When the menu pops up, hover your cursor over "Copy", and then click "Copy full XPath"

After following the steps above, the XPath will be copied to your computer's clipboard, and you will be able to copy and paste it into your IMPORTXML formula (Between quotation marks, as shown below).

"/html/body/div[1]/div/div/main/div/section[2]/div/div[1]/div[1]/ div/div/div/div/div[1]/div[1]/div[1]"

The process of finding the XPath as well as using the IMPORTXML formula, is demonstrated with images in the example below.

Example: Pulling crypto prices with IMPORTXML

Further below I will teach you how to find the "XPath", but here are the basic instructions for pulling crypto prices with the IMPORTXML function.

To pull crypto prices into a Google spreadsheet with the IMPORTXML function, follow these steps:

  • Type =IMPORTXML( to begin the formula
  • Paste or type the URL for the web page that you are pulling crypto prices from (between quotation marks) like this: =importxml("https://www.coinbase.com/price/loopring"
  • Type a comma, and then paste the XPath for element that you are pulling the price data from (between quotation marks) like this: =importxml("https://www.coinbase.com/price/loopring", "/html/body/div[1]/div/div/main/div/section[2]/div/div[1]/div[1]/ div/div/div/div/div[1]/div[1]/div[1]")
  • Press enter on the keyboard

Note that some elements contain multiple columns of data, or multiple rows of data. When this is the case, the formula's result in your spreadsheet will split the data into separate cells, as shown in the image below, where the cryptocurrency price is split into three different columns (The dollar sign, the dollar amount, and the number of cents).

When this happens, simply add the appropriate cells together, or refer to the cell that contains the data that you need with a cell reference, or by using the INDEX function. In this case we add the cell that contains the dollar amount to the cell that contains the number of cents, to get the full cryptocurrency price (See further below).

Pulling cryptocurrency prices into Google Sheets (3 Methods) (4)

Notice in the image below, that the formula in cell T6, adds together cells Z6 and AA6, so that cell T6 displays the entire cryptocurrency price (1 + 0.19 = 1.19).

Pulling cryptocurrency prices into Google Sheets (3 Methods) (5)

Finding the XPath for the crypto price in the above example:

Here are the instructions for finding the XPath in the example above, with images included.

First, go to the web page that contains the crypto price that you want to pull, in this case I am going to https://www.coinbase.com/price/loopring

Pulling cryptocurrency prices into Google Sheets (3 Methods) (6)

Then hover your cursor over the price / hover your cursor over the element that contains the price.

Right-click your mouse, and then click "Inspect".

Pulling cryptocurrency prices into Google Sheets (3 Methods) (7)

A menu with website code will pop up on the right. The code that is highlighted represents the element that you right-clicked on. This may or may not be the correct element. Notice in the image below how on the left, the number "21" is highlighted, which is only a portion of the entire price.

Drag your cursor up and down through the lines of website code, and watch the left side of the screen to see when the correct element is highlighted in blue color.

Pulling cryptocurrency prices into Google Sheets (3 Methods) (8)

In this example the cursor is dragged upwards until the element containing the full price is highlighted, as shown below.

When your cursor is hovered over the code for the desired element, right-click your mouse.

Pulling cryptocurrency prices into Google Sheets (3 Methods) (9)

A menu will pop up after right-clicking. Hover your cursor over "Copy", and then click "Copy full XPath".

Now you can paste the XPath into your IMPORTXML formula in Google Sheets, as described in the example above.

Pulling cryptocurrency prices into Google Sheets (3 Methods) (10)

Pull cryptocurrency prices into Google Sheets with the IMPORTDATA function

There is another method for pulling cryptocurrency prices into a Google spreadsheet that I want to teach you. This method, which uses the IMPORTDATA function, is possible with much thanks to the website cryptoprices.cc. The creator of this website uses an API from Coin Gecko to create a resource that allows us to use the IMPORTDATA function to pull crypto prices into a Google spreadsheet.

Visit the website below to learn more about cryptoprices.cc and the great resource that they are providing.

https://cryptoprices.cc/

The link below can be found on the main page that is linked above. This page shows all of the crypto pairs that you can use for pulling crypto prices with IMPORTDATA.

https://cryptoprices.cc/sitemap.txt

To use the IMPORTDATA function to pull crypto prices, simply refer to the proper crypto pair / URL, provided by cryptoprices.cc, like this =IMPORTDATA("https://cryptoprices.cc/BTC/")

https://cryptoprices.cc/BTC/

The pair / URL shows above, will give you the price for Bitcoin when you use the URL as the criteria for the IMPORTDATA function, as described above / shown below.

Below you can see that I have entered the URL into a spreadsheet cell (A4), and I have referred to the cell with the IMPORTDATA function, like this: =IMPORTDATA(A4)

Pulling cryptocurrency prices into Google Sheets (3 Methods) (11)

The IMPORTDATA function pulls CSV data into a spreadsheet… and again the reason we can use this function to pull crypto prices into Google Sheets, is because the creator of cryptoprices.cc has created a resource that enables the IMPORTDATA function to pull a long list of crypto prices.

Now you know three different ways to pull cryptocurrency prices into your Google spreadsheet!

Click here to get your Google Sheets cheat sheet

Or click here to take the dashboards course

Related Posts:

  • Pull data from websites in Google Sheets with…
  • How to convert currency in Google Sheets (Detailed examples)
  • Stock tracker templates for Google Sheets (Portfolio…
  • Chart data from another sheet (Or multiple sheets)…

As a seasoned expert in Google Sheets and cryptocurrency data integration, I've extensively explored and applied various methods to pull cryptocurrency prices into Google Sheets. My proficiency is evidenced by successful implementations and in-depth knowledge of the tools involved.

Now, let's delve into the key concepts mentioned in the article, breaking down each method:

  1. GOOGLEFINANCE Function:

    • Formula:
      =GOOGLEFINANCE("BTCUSD")
    • This function is a built-in feature of Google Sheets designed to fetch financial data, including cryptocurrency prices.
    • Cryptocurrency symbols are entered as pairs, such as "BTCUSD" for Bitcoin to US Dollars.
    • The function can be extended to include additional criteria for more detailed financial information.
  2. IMPORTXML Function:

    • Formula:
      =IMPORTXML("https://www.coinbase.com/price/loopring", "/html/body/div[1]/div/div/main/div/section[2]/div/div[1]/div[1]/div/div/div/div/div[1]/div[1]/div[1]")
    • IMPORTXML is a web scraping function that extracts data from specified URLs using XPath.
    • It requires the website URL and the XPath of the target element as parameters.
    • The XPath can be dynamic, allowing for flexibility in pulling data from various sources.
  3. IMPORTDATA Function:

    • Formula:
      =IMPORTDATA("https://cryptoprices.cc/BTC/")
    • This function is employed to pull CSV data directly into a Google Sheets spreadsheet.
    • The article mentions the use of cryptoprices.cc as a resource, leveraging an API from Coin Gecko to enable IMPORTDATA for cryptocurrency prices.
    • The URL provided by cryptoprices.cc specifies the crypto pair to retrieve data.

These three methods cater to different preferences and use cases. GOOGLEFINANCE is straightforward, while IMPORTXML and IMPORTDATA offer more flexibility in data source selection. However, the latter two methods may require periodic adjustments to XPath or URL as websites update their structures.

In conclusion, mastering these functions empowers users to efficiently integrate real-time cryptocurrency data into their Google Sheets, providing a valuable tool for tracking and analyzing financial information.

Pulling cryptocurrency prices into Google Sheets (3 Methods) (2024)

FAQs

How do you fetch crypto prices in Google Sheets? ›

The simplest method to import live BTC prices into Google Sheets is by using the GOOGLEFINANCE function. This function allows you to fetch current prices for various cryptocurrencies, including Bitcoin, without needing any additional add-ons or tools.

What is the formula for crypto price? ›

Crypto Price Formula

To calculate the crypto price, divide the total market value by the number of coins in circulation.

Can Google Sheets track crypto? ›

Cryptofinance provides Google Sheets™ users an easy way to fetch cryptocurrency data from over 20 major exchanges and more than 40,000 markets.

How do I use Cryptofinance in Google Sheets? ›

How to use CRYPTOFINANCE in Google Sheets
  1. Sign in/create Cryptowatch account. First, you must sign in to your Cryptowatch account. ...
  2. Generate API key. In the top right-hand corner of the homepage, click on the Account dropdown and select API Access. ...
  3. Connect API key to Google Sheets. ...
  4. Enter formula to extract data.

How do I pull Coinbase prices into Google Sheets? ›

  1. Step 1.) Install and open the Apipheny add-on for Google Sheets. Apipheny is a free API connector for Google Sheets. ...
  2. Step 2.) Choose a Coinbase API Endpoint. ...
  3. Step 3.) Add your Coinbase API URL into the Apipheny add-on. ...
  4. Step 4.) Run the Coinbase API request in your Google Sheet.

How to get crypto price from CoinMarketCap on google sheet? ›

Use the UrlFetchApp method to make HTTP requests to the API. Include your CoinMarketCap API key in the request header for authentication. Write a script to fetch the latest price of a specific cryptocurrency or other data as needed. Use the =getCryptoData() formula in a cell in your Google Sheets to display the data.

How do you calculate dollar cost average in crypto? ›

The calculation for dollar-cost averaging works the same as calculating the average or mean for a set of numbers. In the case of DCA, the investor adds investment purchase prices, then divides the sum by the amount of purchases made.

What is a crypto price chart? ›

Crypto charts are graphical representations of historical price, volumes, and time intervals. The charts form patterns based on the past price movements of the digital currency and are used to spot investment opportunities. To understand how to read a crypto chart, let's discuss a Japanese Candlestick chart.

What is the moving average formula in crypto? ›

Simple Moving Average (SMA) calculates the average price of an asset over a specific number of periods by summing up the prices and dividing by the number of periods. This gives equal weight to all data points within the chosen timeframe.

How do you make a crypto spreadsheet? ›

Step 1: Install Cryptosheets: Get the add-in from their website. Step 2: Connect Data: Launch Excel, go to Cryptosheets, and connect to your data source. Step 3: Retrieve Data: Use Cryptosheets' functions to get specific cryptocurrency data. Step 4: Organize and Analyze: Organize and visualize data using Excel's tools.

How do I create a crypto portfolio tracker in Google Sheets? ›

Create a Live Crypto Portfolio Tracker on Google Sheets in 4 Steps
  1. Step 1: Import Live Crypto Price Data with App Scripts. ...
  2. Step 2: Automate Data Refreshes with Triggers. ...
  3. Step 3: Import Top 500 Crypto Data with CoinGecko API. ...
  4. Step 4: Configure Your Portfolio Tracker.

Can Google Sheets pull data? ›

Get data from other spreadsheets

Important: To reference a cell or range of cells in another spreadsheet, you must use the IMPORTRANGE function. To pull data from other spreadsheets, use the IMPORTRANGE function.

How do you use GOOGLEFINANCE for currency? ›

For example, to convert US Dollars (USD) to Euros (EUR), you would enter '=GOOGLEFINANCE("CURRENCY:USDEUR")'. Press Enter, and Google Sheets will display the current exchange rate. To convert a specific amount, simply multiply the GOOGLEFINANCE formula by the amount you wish to convert.

How do I get currency in Google Sheets? ›

To apply a custom currency format to your spreadsheet:
  1. On your computer, open a spreadsheet in Google Sheets.
  2. Highlight the data you want to format.
  3. Click Format. Number.
  4. Click Custom currency.
  5. Search in the menu text box to select a format. You can also add your own custom currency format into the text box.
  6. Click Apply.

How do I automate currency conversion in Google Sheets? ›

These are some steps you can follow to convert currency in Google Sheets:
  1. Launch Google Sheets and open your spreadsheet. ...
  2. Identify the currency to convert and its code. ...
  3. In a new cell, input the Google Finance function. ...
  4. Change the custom currency to reflect the conversion.

How do I pull live crypto prices into Excel? ›

In Excel, use the "DATA" tab and select 'From Web' to import data from the API. Follow the prompts to connect to the API and retrieve live price data for your chosen cryptocurrencies.

How do I fetch stock data in Google Sheets? ›

Googlefinance function returns current Stock Price by this function =GOOGLEFINANCE("Exchange:Stock_Name"). For some exchanges, say NSE, the data shared is realtime ie without any delay.

How do I pull live stock prices into Google Sheets? ›

To retrieve stock data in Google Sheets, you can use the “GOOGLEFINANCE” function. This function allows you to retrieve real-time data such as stock prices, market capitalization, earnings per share and much more.

Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 5950

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.