Request
https://api.zapi.ink/v1/finance:investing/historicalSend your key in the x-api-key header. The response is JSON in the { project, data, timestamp } envelope, and an identical request is served from cache for 5 minutes.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| query | string | query | Yes | Symbol or name of the instrument to resolve (stock ticker, index, commodity, FX pair, crypto). Resolved to an internal id. Example: AAPL |
| pairId | number | query | No | Optional internal instrument id override. When provided, symbol resolution is skipped. Example: 6408 |
| interval | enum: 1m | 5m | 15m | 30m | 1h | 5h | 1d | 1w | 1mo | query | No | Candle interval: 1m, 5m, 15m, 30m, 1h, 5h (intraday) or 1d, 1w, 1mo. Default 1d Example: 1d |
| period | enum: 1d | 1w | 1mo | 3mo | 6mo | 1y | 5y | max | query | No | Lookback range: 1d, 1w, 1mo, 3mo, 6mo, 1y, 5y, max. Default 1mo. The upstream re-aggregates rather than honouring the interval literally — 1y returns ~53 daily rows, 5y ~261. Use max for full-depth candles. Any single call returns at most 5000 rows. Example: 1mo |
| pointscount | number | query | No | Candle density the upstream is asked for. Only 60, 70, 90, 110, 120, 140 and 160 are accepted. Default 120. It is not a row cap — the cap is 5000 rows per call and is driven by period Example: 120 |
Code examples
curl -X GET "https://api.zapi.ink/v1/finance:investing/historical?query=AAPL&pairId=6408&interval=1d&period=1mo&pointscount=120" \ -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
const res = await fetch("https://api.zapi.ink/v1/finance:investing/historical?query=AAPL&pairId=6408&interval=1d&period=1mo&pointscount=120", { method: "GET", headers: { "x-api-key": "zpi_xxxxxxxxxxxxxxxxxxxxxxxx" }, }); const data = await res.json(); console.log(data);
import requests res = requests.get( "https://api.zapi.ink/v1/finance:investing/historical", params={"query":"AAPL","pairId":"6408","interval":"1d","period":"1mo","pointscount":"120"}, headers={"x-api-key":"zpi_xxxxxxxxxxxxxxxxxxxxxxxx"}, ) print(res.json())
Example response
{ "project": "finance:investing", "data": { "count": 22, "pairId": 6408, "period": "1mo", "symbol": "AAPL", "candles": [ { "low": 293.5, "date": "2026-05-13T00:00:00.000Z", "high": 300.92, "open": 293.5, "close": 298.87, "volume": 52684260, "timestamp": 1778630400000 }, { "low": 295.38, "date": "2026-05-14T00:00:00.000Z", "high": 300.45, "open": 299.82, "close": 298.21, "volume": 35324920, "timestamp": 1778716800000 }, { "low": 296.52, "date": "2026-05-15T00:00:00.000Z", "high": 303.2, "open": 297.9, "close": 300.23, "volume": 54862836, "timestamp": 1778803200000 }, { "low": 294.91, "date": "2026-05-18T00:00:00.000Z", "high": 300.66, "open": 300.24, "close": 297.84, "volume": 34482960, "timestamp": 1779062400000 }, { "low": 296.35, "date": "2026-05-19T00:00:00.000Z", "high": 300.51, "open": 296.97, "close": 298.97, "volume": 42243560, "timestamp": 1779148800000 }, { "low": 298.08, "date": "2026-05-20T00:00:00.000Z", "high": 302.8, "open": 298.18, "close": 302.25, "volume": 38229844, "timestamp": 1779235200000 }, { "low": 300.4, "date": "2026-05-21T00:00:00.000Z", "high": 305.54, "open": 301.05, "close": 304.99, "volume": 42965128, "timestamp": 1779321600000 }, { "low": 305.84, "date": "2026-05-22T00:00:00.000Z", "high": 311.4, "open": 306.12, "close": 308.82, "volume": 43670224, "timestamp": 1779408000000 } ], "interval": "1d" }, "timestamp": "2026-06-14T07:37:04Z" }
Frequently asked questions
How do I call the Investing Historical API?
Send a GET request to https://api.zapi.ink/v1/finance:investing/historical?query=AAPL with your Zapi key in the x-api-key header. Parameters — required: query; optional: pairId, interval, period, pointscount. The response is JSON in the { project, data, timestamp } envelope.
What does the Investing Historical API return?
Data OHLCV historis (interval & periode fleksibel). The example response has the fields count, pairId, period, symbol, candles, interval. Each item in candles has fields such as low, date, high, open, close, volume, timestamp.
Is the Investing Historical API free?
Yes. It is on the Zapi free tier: 600 Zap a month with one API key and no credit card. Each call costs 2 Zap. Paid plans raise the limits.
Can an AI assistant call the Investing Historical API?
Yes. Add the Zapi MCP server (https://mcp.zapi.ink/mcp) to Claude, Cursor or another MCP client and ask in plain words; it calls run_scraper with scraper "investing" and endpoint "historical".
What other Investing API endpoints are there?
It has 15 endpoints. Besides Historical: Search, Quote, Technical, News, Article, Calendar, and 8 more.
