Request
https://api.zapi.ink/v1/finance:histdata/gap-reportSend 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 1 day.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| pair | string | query | Yes | Instrument code as HistData spells it. Example: XAUUSD |
| year | number | query | Yes | Calendar year of the file. The current year has no report until it closes. Example: 2024 |
| month | number | query | No | Month 1-12. Required for tick and for the current year; omit for a closed year of M1. Example: 7 |
| timeframe | enum: m1 | tick | query | No | m1 (1-minute bars) or tick. Default m1. Example: m1 |
| sessionBreaks | enum: include | exclude | query | No | Whether to keep the daily 17:00-18:00 EST rollover gaps. Default exclude. Example: exclude |
Code examples
curl -X GET "https://api.zapi.ink/v1/finance:histdata/gap-report?pair=XAUUSD&year=2024&month=7&timeframe=m1&sessionBreaks=exclude" \ -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
const res = await fetch("https://api.zapi.ink/v1/finance:histdata/gap-report?pair=XAUUSD&year=2024&month=7&timeframe=m1&sessionBreaks=exclude", { 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:histdata/gap-report", params={"pair":"XAUUSD","year":"2024","month":"7","timeframe":"m1","sessionBreaks":"exclude"}, headers={"x-api-key":"zpi_xxxxxxxxxxxxxxxxxxxxxxxx"}, ) print(res.json())
Example response
{ "project": "finance:histdata", "data": { "file": "DAT_ASCII_XAUUSD_M1_2024.csv", "pair": "XAUUSD", "year": 2024, "count": 5, "items": [ { "to": "2024-04-10T18:01:06-05:00", "from": "2024-04-10T16:59:59-05:00", "seconds": 3660, "sessionBreak": false }, { "to": "2024-10-09T20:11:48-05:00", "from": "2024-10-09T19:05:51-05:00", "seconds": 3951, "sessionBreak": false }, { "to": "2024-11-21T18:00:00-05:00", "from": "2024-11-21T16:59:34-05:00", "seconds": 3619, "sessionBreak": false }, { "to": "2024-12-11T18:02:01-05:00", "from": "2024-12-11T16:59:59-05:00", "seconds": 3715, "sessionBreak": false }, { "to": "2024-12-26T18:05:00-05:00", "from": "2024-12-26T16:59:59-05:00", "seconds": 3894, "sessionBreak": false } ], "month": null, "dataset": "gap-report", "provider": "histdata", "timezone": "EST-no-DST", "timeframe": "M1", "totalGaps": 313, "sessionBreaks": "exclude", "sessionBreakGaps": 308, "longestGapSeconds": 3951 }, "timestamp": "2026-08-21T02:23:28Z" }
Frequently asked questions
How do I call the Histdata Gap Report API?
Send a GET request to https://api.zapi.ink/v1/finance:histdata/gap-report?pair=XAUUSD&year=2024 with your Zapi key in the x-api-key header. Parameters — required: pair, year; optional: month, timeframe, sessionBreaks. The response is JSON in the { project, data, timestamp } envelope.
What does the Histdata Gap Report API return?
HistData's own audit of where its data is missing, for one file. The example response has the fields file, pair, year, count, items, month, dataset, provider. Each item in items has fields such as to, from, seconds, sessionBreak.
Is the Histdata Gap Report 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 1 Zap. Paid plans raise the limits.
Can an AI assistant call the Histdata Gap Report 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 "histdata" and endpoint "gap-report".
What other Histdata API endpoints are there?
It has 5 endpoints. Besides Gap Report: Coverage, List Instruments, Download M1, Download Tick.
