Early access is open. Free sample datasets are live now. Download a sample

Market Data in Excel and Google Sheets

Details

Docs navigation

You do not need to write code to use our data. Every endpoint that returns rows can return CSV, and both Excel and Google Sheets can load a CSV straight from a URL. This guide shows how to get stock data in Google Sheets with IMPORTDATA, how to do the same in Excel with Power Query, and how to keep your API key safe when the sheet is shared.

Early access. The API is not live yet, so the API formulas below will work once your key is issued. The free sample CSVs on /sample-data open in either program today.

Sample data

Start with a free sample (works today)

  1. Go to /sample-data and download a ZIP, for example the ECB euro reference rates.
  2. Unzip it and open the .csv file in Excel, or use File > Import > Upload in Google Sheets.
  3. You get one row per date and currency. The first rows of ecb-reference-rates.csv look like this:
date base quote pair rate
2026-11-18 EUR USD EURUSD 1.0968
2026-11-18 EUR GBP EURGBP 0.8329
2026-11-18 EUR JPY EURJPY 174.85

Source: European Central Bank

Details

Google Sheets with IMPORTDATA

1. Build the URL

Take any REST URL, add format=csv and your key as apikey (Sheets cannot send headers):

https://api.marketdata.co/v1/stocks/bars?symbol=AAPL&interval=1d&start=2026-01-01&format=csv&apikey=YOUR_API_KEY

2. Put it in a cell

=IMPORTDATA("https://api.marketdata.co/v1/stocks/bars?symbol=AAPL&interval=1d&start=2026-01-01&format=csv&apikey=YOUR_API_KEY")

The header row lands in the cell you typed into, and the data spills down and to the right.

3. Make the symbol a cell reference

Put a ticker in A1 and your key in a separate, hidden tab called config:

=IMPORTDATA("https://api.marketdata.co/v1/stocks/bars?symbol="&A1&"&interval=1d&start=2026-01-01&format=csv&apikey="&config!B1)

4. Pull only the columns you want

Add fields to cut the response down:

...&fields=date,close,volume

Details

Excel with Power Query

1. Open the web connector

Data > Get Data > From Other Sources > From Web. Choose Advanced.

2. Enter the URL and header

Put the URL without apikey in the URL box. Under HTTP request header parameters, add Authorization with the value Bearer YOUR_API_KEY. This keeps the key out of the URL.

3. Load and set types

Power Query detects the CSV. Check that date is a Date column and prices are Decimal Number, then click Close & Load.

4. Refresh

Data > Refresh All pulls fresh data. Under Query Properties you can refresh every N minutes or when the file opens.

Details

Useful URLs to paste

What URL path and parameters
Daily closes for one stock /v1/stocks/bars?symbol=MSFT&interval=1d&start=2025-01-01&fields=date,close
Latest prices for a watchlist /v1/stocks/snapshot?symbols=AAPL,MSFT,NVDA&fields=symbol,last_price,change_percent
Daily EUR/USD /v1/forex/daily?symbol=EURUSD&start=2025-01-01
Monthly CPI /v1/economic/series?symbol=CPIAUCSL&start=2015-01-01
Dividend history /v1/stocks/corporate-actions?symbol=KO&action_type=cash_dividend

Prefix each with https://api.marketdata.co and add &format=csv.

Watch out

Notes and gotchas

  • Anyone who can view a sheet can read a key typed into a formula. Make a separate key for spreadsheets, name it clearly, and revoke it if the sheet is shared outside your team. See authentication.
  • Google Sheets recalculates IMPORTDATA on its own schedule, roughly hourly, and caches results. It is fine for end-of-day work, not for live trading.
  • Every recalculation is an API call. A sheet with 200 IMPORTDATA cells can use up a Free plan's 5 requests a minute fast. Use the snapshot endpoint with many symbols in one call.
  • Sheets limits a single import to a few megabytes. For minute data, narrow the dates or use a dataset download.
  • Dates arrive as YYYY-MM-DD text in some locales. Wrap with DATEVALUE or set the column format.
  • Times are UTC. Subtract 5 hours (4 in summer) for New York, or ask for daily bars that use a plain date.

Keep reading

Next steps

Details

Was this page useful?

[Yes] [No]

Want a ready-made template for your sheet? Ask on the custom data form.