As a financial professional, analyst, or investor, having access to real-time market data can be a game-changer. With the power of EODHD’s financial API and the versatility of Google Sheets, you can now stream live stock quotes directly into your spreadsheets. This integration empowers you to make informed decisions based on up-to-the-minute market data without leaving the familiar interface.

In this article, we’ll walk you through a step-by-step guide on how to set up a WebSocket connection with EODHD’s API using Google Apps Script. It’ll enable you to continuously fetch and display stock, crypto and FOREX data in your Google Sheets.

A sample Google Sheet.

Register & Get Data

You can also check our guides for Stock Market Dashboard in Google Sheets, Google Sheets Portfolio Tracker, and EODHD Google Sheets Add-in. Here you’ll find more information on our Ready-to-Go solutions.

Getting Started with the Sample Real-Time Market Data Google Sheet

First, get your hands on our sample spreadsheet. Make a copy of the spreadsheet in your Google Drive by clicking on “File” > “Make a copy.” This ensures that you can customize the spreadsheet to your needs, and your changes won’t affect the original spreadsheet.

Locate the “EODHD” button in your copied spreadsheet. This button is linked to the showDiag script, which opens a dialog window for configuring the WebSocket connection.

The extension itself consists of Code.gs and Dialog.html files. Code.gs is responsible for parsing the data and Dialog.html primary functions are interface and calling the Websockets API. You can copy the code from both files after creating your copy of the spreadsheet. You must go to Extensions > Apps Script, select the file, and copy it into your spreadsheet.

Real-Time Market Data in Google Sheets with WebSocket

Run the WebSocket Connection

First, In your spreadsheet, select the cells containing the tickers you want to subscribe to. Make sure each ticker is in a separate cell.

Click on the “EODHD Real-Time” button to open the configuration dialog. Enter your EOD Historical Data API key in the dialog. If you don’t have an API key, sign up for a free trial or subscribe to a plan at:

Register & Get Data

For testing purposes, you can use the “demo” key, which provides access to a limited set of tickers: AAPL.US, MSFT.US, EURUSD.FOREX, AUDUSD.FOREX, ETH-USD.CC and BTC-USD.CC.

Mind that the tickers must be used without the exchange code part when you subscribe to them. You choose the desired market data type (US stocks, forex pairs, or cryptocurrencies) from the options provided in the dialog.

Real-Time Market Data in Google Sheets with WebSocket

Receiving and Analyzing Real-Time Market Data

After selecting the market data type, click the “Connect” button in the configuration dialog to establish the WebSocket connection and start receiving real-time data.(Make sure that you have selected tickers before running the script).

A new sheet will be automatically created based on the selected market data type (e.g., “US_Data,” “FOREX_Data,” or “CRYPTO_Data”). The script will append the live data points as new rows in the corresponding sheet.

To pause the real-time data feed, click the “Disconnect” button in the configuration dialog. You can resume the connection by clicking “Connect” again.

Real-Time Market Data in Google Sheets with WebSocket

Use the real-time data in your spreadsheet for analysis, calculations, and visualizations. Leverage Google Sheets’ built-in functions and tools to gain insights from the live market data.

EOD Historical Data Platform and API

EOD Historical Data is a comprehensive platform that provides high-quality financial market data for various instruments, including stocks, ETFs, mutual funds, indices, forex pairs, and cryptocurrencies. With a vast global coverage of over 70 exchanges and data spanning more than 30 years, EOD Historical Data caters to the needs of investors, traders, and financial professionals.

The platform offers a wide range of data feeds and APIs. EODHD designed these APIs to be flexible, reliable, and easy to integrate into various applications, platforms, and tools, such as Google Sheets, Excel, Python, and more.

Conclusion

With this integration, you now have the power of real-time stock data at your fingertips, integrated into the familiar Google Sheets environment. Whether you’re analyzing market trends or monitoring your portfolio, EODHD’s API and this powerful Google Sheets integration will provide you with the real-time financial data that you need.

Don’t miss out on this game-changing opportunity. Sign up for an EODHD API account today and unlock the full potential of API data integration.

Register & Get Data

Feel free to contact our support to ask for the current discounts, we would be happy to assist and guide you: support@eodhistoricaldata.com.

Do you enjoy our articles?

We can send new ones right to your email box