Market Data in Excel and Google Sheets
Details
Docs navigation
- Getting started: Quickstart, Authentication, Rate limits, Errors and retries
- Guides: Symbol formats, Timestamps and time zones, Pagination, Split and dividend adjustments, WebSocket streaming, Dataset downloads, Excel and Google Sheets (you are here), Changelog
- API reference: Stock bars, Stock trades and quotes, Snapshots and movers, Tickers, exchanges, calendar, Splits and dividends, Fundamentals and SEC filings, Options chain and Greeks, Options EOD, bars, OI, Forex, Crypto, Crypto derivatives, Futures bars and continuous, Settlements and COT, Indices, Economic data, Technical indicators
- SDKs: Python, JavaScript
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)
- Go to /sample-data and download a ZIP, for example the ECB euro reference rates.
- Unzip it and open the
.csvfile in Excel, or use File > Import > Upload in Google Sheets. - You get one row per date and currency. The first rows of
ecb-reference-rates.csvlook 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
IMPORTDATAon 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
IMPORTDATAcells 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-DDtext in some locales. Wrap withDATEVALUEor 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.