Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (2024)

Google Sheets has a built-in function called GOOGLEFINANCE which fetches current or historical securities information from Google Finance to a Google Sheet. This article details how this function can be used with our Spreadsheets data source to display market data on your Geckoboard dashboard.

Note: Widgets powered by spreadsheets using the GoogleFinance function refresh approx. every 15 minutes. If this isn't fast enough for your needs, you can run a script and set your own refresh interval.

Here's the syntax of the GOOGLEFINANCE function:

=GOOGLEFINANCE(ticker, [attribute], [start_date], [num_days|end_date], [interval])

ticker: The ticker symbol for the security to consider.

attribute: (Optional - "price" by default ) - The attribute to fetch about ticker from Google Finance.

start_date: (Optional) - The start date when fetching historical data.

end_date|num_days: (Optional) - The end date when fetching historical data, or the number of days from start_date for which to return data.

interval: (Optional)- The frequency of returned data; either "DAILY" or "WEEKLY".

Example: How to display Google's stock price on a dashboard

In this example, we'll use the GOOGLEFINANCE function and a Google Sheet Number Widget to display Google's current stock price on a dashboard.

  1. To fetch Google's current stock price into Google Sheets, open a new Google Sheet and type the following formula into cell A2:

    =GOOGLEFINANCE("GOOG", "price")

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (1)

    Essentially, what this formula is doing is querying Google Finance for GOOG current price (GOOG is the ticker symbol for Google Inc.). Something similar happens when you Google "Google stock price".

  2. Save your Google Sheet and give it a name.

  3. With Google's stock price information in a Google Sheet, switch to your Geckoboard dashboard.

  4. Click Add widget.

  5. Choose the Spreadsheets integration.

  6. Select the Google Sheets file that you just saved.

  7. Select the Number widget.

  8. Select the appropriate Sheet (Sheet1 in this example).

  9. Enter the value of GOOG price in the Number selection (in the above example, it's A2).

  10. Disable the Comparison Visualization and adjust the title.

  11. Click Add to dashboard to add your widget to your dashboard.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (2)

  12. And that's it! Your Geckoboard dashboard is now displaying the information found in Cell A2 of the Google Sheet – Google's current stock price.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (3)

Widgets powered by spreadsheets using the GOOGLEFINANCE function refresh approx. every 15 minutes. If this isn't fast enough for your needs – and your G Suite account allows it – you can write a script that can further reduce the refresh times.

Please open a new Google Sheet to work through these next steps.

  1. Click on the Tools menu and select the option Script Editor.

  2. A Google Apps Script window will appear. Click the Blank Project option.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (4)

  3. Replace the default function with the following script:

    Important note

    Make sure you follow the aforementioned instructions to the letter, otherwise, cells in the Sheet might not match the ones in the script and your countdown will not update automatically

    function getData() { SpreadsheetApp.getActiveSheet().getRange('A2').setValue('=GOOGLEFINANCE("GOOG", "price")');}
  4. Save your function and give it a name.

  5. From inside the Script Editor, click on the Edit menu and select the option Current project's triggers.

  6. Click on the project's trigger's menu.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (5)

  7. Click the + Add Trigger button in the bottom right corner of the page.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (6)

  8. Set a trigger for the myFunction function, that runs from Head on a Time-driven source that's triggered on a Minute timer.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (7)

  9. Once you set the trigger (and so that you don't have to wait 1 hour to get data), run the script for the first time.

    Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (8)

You're done!

Now that you've written the script and set the trigger running, you'll be able to see the data on your Google Sheet refresh faster than the default 15 minutes. This will continue to refresh even when your Google Sheet is closed.

Potential Google server errors

We've found that a few times a week, a server error will occur on Google's end and the script will fail to run. By default, you'll receive an email to notify you that this has happened. Considering the script runs every minute of the day which totals 1440 times, a few times a week is nothing to be concerned about.

Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (9)

Tip: If you're interested in finance and economic data, you might find Quandl very useful. This website has a wide range of public (and private) data from a variety of sources available as hosted CSV files i.e. https://www.quandl.com/api/v3/datasets/WIKI/GOOGL.csv which can be used in combination with our CSV integration.

Related Articles

Track more metrics using Parabola with GeckoboardPrepare your spreadsheet for connecting to GeckoboardUse ImportData to display online data in GeckoboardUse Google Sheets’ ImportHTML function to display data in GeckoboardImport data into your spreadsheet before connecting to Geckoboard
Use GoogleFinance to display market data in Geckoboard | Geckoboard Help Center (2024)

FAQs

How do I pull market data into Google Sheets? ›

Retrieving Stock Data with Google Sheets
  1. Open a new Google Sheet or select an existing sheet.
  2. In a cell, enter the “GOOGLEFINANCE” function and the desired stock symbol as the argument, for example “=GOOGLEFINANCE(“AAPL”)”.
  3. The function will return the current market price for the stock symbol.
Jan 29, 2023

How to extract data from GOOGLEFINANCE? ›

Access the data in Google Sheets
  1. Create a new sheet in Google Sheets 'sheets. ...
  2. To access the finance data, click on a cell and start your query by entering:=GOOGLEFINANCE(“The full query requires the following:=GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])

How to display Google Sheet data on webpage? ›

If you're embedding a spreadsheet, you can show or hide parts of the spreadsheet after you publish to the web.
  1. Open a file in Google Sheets.
  2. At the top, click File Share. ...
  3. In the window that appears, click Embed.
  4. Click Publish.
  5. Copy the code in the text box and paste it into your site or blog.

Does GOOGLEFINANCE still work? ›

Google still offers financial data for use Google Sheets spreadsheets through the use of the GOOGLEFINANCE formula, but the API is no longer available to users. If you are interested in using Google's financial data, learning about the GOOGLEFINANCE formula is the best way to access this data.

What is the alternative to wisesheets? ›

Top 10 competitors of Wisesheets, ranked by Tracxn score:
  • TrendSpider. Automated trade analysis software. ...
  • NGEN Markets. Online platform for real-time updates on stock and indices market. ...
  • The FinBerg. Online quantitative research platform for stock market. ...
  • DefineEdge. ...
  • Research360. ...
  • Thematic. ...
  • Screener. ...
  • Bloom.
Mar 25, 2024

Does Google Finance have an API? ›

As far as public endpoints go, the Google Finance API is very standard. It's able to take REST requests, and it returns the desired data in JSON format. To reiterate, the Google Finance API is no longer supported by Google so it's undocumented and unreliable.

Does Google Finance allow web scraping? ›

Scraping financial data from Google Finance can be a valuable skill for investors, data analysts, and financial professionals alike. It allows us to access real-time and historical information about stocks, indices, currencies, and more, enabling us to make informed decisions in the world of finance.

How to get NSE data in Google Sheets? ›

NSE Option Chain in Google Sheets

To import NSE option chain data, follow these steps: Identify the URL of the NSE option chain data you wish to import. Use the '=IMPORTHTML' function in Google Sheets with the URL, specify "table" as the type of data, and choose the appropriate table number.

Can I use GOOGLEFINANCE in Excel? ›

In the Get External Data section of Excel, choose the 'From Web' option to initiate the process of importing stock prices from Google Finance. This action opens up a pathway for users to seamlessly extract real-time stock data from an online source directly into their Excel spreadsheets.

What is the formula for the stock market 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.

Is GOOGLEFINANCE any good? ›

Google Finance is one of the best places to get a large volume of stock quotes and financial news as you explore your various investment options before investing your money. In addition to having a ton of outstanding information on thousands of companies, Google Finance also has an excellent Portfolio tool.

How to link a Google Sheet in HTML? ›

Embedding a table from Sheets to a website
  1. Open a file in Google Sheets.
  2. At the top, click File Share Publish to web.
  3. In the window that appears, click Embed.
  4. Click Publish.
  5. Copy the code in the text box and paste it into your site or blog.
  6. To show or hide parts of the spreadsheet, edit the HTML on your site or blog.
Apr 23, 2023

How to display data from Google Sheet in PHP? ›

Download the Code and Examples​
  1. Create a Google Project and Configure Sheets API.
  2. Create and Share a Google Sheets.
  3. Install and Configure the PHP Client.
  4. Get the Spreadsheet.
  5. Fetch All the Rows of a Sheet.
  6. Fetch a Few Rows by Using a Range.
  7. Fetch Only Cells of a Given Column.
  8. Convert Rows into JSON Objects.
Mar 14, 2022

Can Google Sheets pull stock prices? ›

Google Finance allows such functionality via Google Sheets by picking stocks and defining their attributes, such as price, change, and high and low prices during the day. In this step-by step Tools tutorial, we will create a table to track a few stocks and specific attributes.

How to get GOOGLEFINANCE function in Excel? ›

In the Get External Data section of Excel, choose the 'From Web' option to initiate the process of importing stock prices from Google Finance. This action opens up a pathway for users to seamlessly extract real-time stock data from an online source directly into their Excel spreadsheets.

Top Articles
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 6222

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.