Spreadsheets

Prices, candles, company figures and the economic calendar straight into Google Sheets or Excel. The add-on uses your API key and its credits, like any other program.

Google Sheets

  1. Download marketapi.gs and open it in a text editor.
  2. In your spreadsheet: Extensions › Apps Script. Replace what is there with the file's text and click Save.
  3. Reload the spreadsheet. A MarketAPI menu appears: choose Set API key and paste a key from Dashboard › API keys. Google asks once for permission to call the API.
FormulaGives
=MARKETAPI_PRICE("EURUSD")The latest mid price. Add "bid", "ask", "last", "time" or "status" as a second value for that instead.
=MARKETAPI_PRICES(A2:A20)A table of the latest prices of the tickers in the range.
=MARKETAPI_BARS("EURUSD", "D1", "2026-01-01", "2026-03-31")Candles (time, open, high, low, close, volume), up to 5,000 rows.
=MARKETAPI_FUNDAMENTALS("AAPL", "income", "annual", 5)A company's statement: income, balance or cashflow, one column per period.
=MARKETAPI_VALUATION("AAPL")The cash-flow valuation: fair value, price, gap and verdict.
=MARKETAPI_CALENDAR("today", "tomorrow", "US", 3)Economic calendar releases (here: high importance, United States).

Answers are kept for a short time (prices 60 seconds, the rest one hour), so a sheet that recalculates often does not use your credits again and again. MarketAPI › Refresh prices now fetches everything again.

The key is saved with the spreadsheet, so anyone who can edit the spreadsheet can use it. Give the spreadsheet a key of its own and revoke it if you share the sheet.

Excel

  1. Put your API key in a cell and name the cell ApiKey (Formulas › Define Name).
  2. Download marketapi.pq. It holds two queries: latest prices (from a table named Tickers) and candles.
  3. Data › Get Data › From Other Sources › Blank Query › Advanced Editor, paste one query and click Done. If Excel asks how to connect, choose Anonymous.
  4. Close & Load. Data › Refresh All fetches new data; each refresh uses credits.

Works in Excel for Windows and Mac (Microsoft 365, Excel 2016 and later). Anyone with the workbook can read the key from its cell: use a key of its own.

Prices and credits

Each formula is an API call and costs the same credits as the endpoint it uses (pricing). The request log of each key (Dashboard › API keys) shows the calls your sheets make.