intraday history
Fill a gap in today's data: stream up to 8 hours of intraday snapshots for one ticker, package and category. Small daily limit.
chart
Streams the same snapshots that the snapshot endpoints return, for a time range of today.
Streams the snapshots of one ticker, package and category between start and end, in time order.
Use it only to fill gaps
This endpoint has a small daily request limit. Use it only to fill intraday gaps that the WebSocket stream or the other REST endpoints did not capture. Do not use it as a primary data feed.
After the market close, get the full day from the endpoint for your subscription:
- Classic, State or Orderflow: the EOD report. It holds the latest trading day only. The report of the current day is available from 5:00 PM ET. Before then, the endpoint returns the report of the previous trading day.
- Quant: historical download, for any day in about the last 90 days. Quant can also use the EOD report.
Subscription
Requires a Classic subscription or higher. The subscription must include the package that you request.
When do I use intraday history?
Use it when your client missed part of today's session. For example, your WebSocket connection dropped for 20 minutes. Request only the missing range. Then return to the live feed.
Do not use it to load a full day. Do not request the same range again. After the market close, a full day comes from the EOD report (Classic and up, latest trading day, from 5:00 PM ET) or from historical download (Quant, about the last 90 days).
Request
Example: POST /hist/SPX/classic/gex_full with the body {"start": 1789133400, "end": 1789134600}.
Headers
| Name | Type | Description |
|---|---|---|
Authorization | string | Required. Format: "Bearer <YOUR_API_KEY>" |
User-Agent | string | Required. Identify your client application. |
Content-Type | string | Required. Set to "application/json". |
Accept | string | Optional. Selects the stream format. See Stream formats. |
Path parameters
| Name | Type | Description | Options |
|---|---|---|---|
ticker | string | The ticker symbol (e.g., SPX, AAPL). | |
package | string | The data package to query. | classic, state, orderflow |
category | string | The specific data category within the package. | gex_full (Classic, State), gex_zero (Classic, State), gex_one (Classic, State), delta_zero (State), gamma_zero (State), vanna_zero (State), charm_zero (State), delta_one (State), gamma_one (State), vanna_one (State), charm_one (State), orderflow (Orderflow) |
The label after each category names the package that holds it. volume_zero and volume_one are not available on this endpoint (400).
Request body
| Field | Type | Description |
|---|---|---|
start | integer | Required. The start of the range, in Unix epoch seconds or milliseconds. |
end | integer | Required. The end of the range, in the same unit as start. |
The server reads start to select the unit: a value above 100,000,000,000 is milliseconds. end must use the same unit. start must be before end. The range must be 8 hours or less.
The server rounds a millisecond value down to the whole second, because the snapshots are one second apart. The timestamp field of each snapshot is in Unix seconds for both units.
Response
The status is 200 OK and the server sets Cache-Control: no-store. The server sends the status before it streams. If an error occurs during the stream, the body ends early and the status stays 200.
Stream formats
Accept value | Response Content-Type | Body |
|---|---|---|
application/x-ndjson or application/jsonlines | application/x-ndjson | One JSON snapshot on each line. |
application/json-seq | application/json-seq | A JSON text sequence: each snapshot starts with the record separator (0x1E) and ends with a line feed. |
application/protobuf | application/octet-stream | Binary records. Each record is a 4-byte little-endian length, then a Zstandard-compressed Protocol Buffer message of that length. |
Any other value, or no Accept header | application/stream+json | One JSON snapshot on each line. |
The JSON snapshots have the same fields as the snapshot endpoint of the package: classic, state and orderflow. The Protocol Buffer messages use the schemas of the WebSocket stream.
Each JSON line is one snapshot. The fields are the fields of the snapshot endpoint of the package. The schema tabs show the request body.
curl -X POST "https://api.gex.bot/v2/hist/SPX/classic/gex_full" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "User-Agent: my-client/1.0" \
-H "Content-Type: application/json" \
-H "Accept: application/x-ndjson" \
-d '{"start": 1789133400, "end": 1789134600}'The response holds one classic gex_full snapshot on each line, in time order.
{
"type": "object",
"description": "A time range in Unix epoch time. The server reads start to select seconds or milliseconds, so end must use the same unit. The range must be 8 hours or less.",
"required": ["start", "end"],
"properties": {
"start": { "type": "integer", "format": "int64" },
"end": { "type": "integer", "format": "int64" }
}
}type: object
description: A time range in Unix epoch time. The server reads start to select seconds
or milliseconds, so end must use the same unit. The range must be 8 hours or less.
required:
- start
- end
properties:
start:
type: integer
format: int64
end:
type: integer
format: int64Errors
Errors raised by the API have the body {"error": "<message>"}.
| Status | Message | Cause |
|---|---|---|
400 Bad Request | User-Agent not found. | The request has no User-Agent header. |
400 Bad Request | Authorization header not found. | The request has no Authorization header. |
400 Bad Request | Invalid ticker format. or Unknown ticker symbol: <ticker> | The ticker is not a supported symbol. |
400 Bad Request | Invalid package type. | The package is not classic, state or orderflow. |
400 Bad Request | Invalid category type. or Invalid category package combination. | The category does not exist, or it does not belong to the package. |
400 Bad Request | Invalid category | The category is volume_zero or volume_one. |
400 Bad Request | Date range too large. | The range is longer than 8 hours. |
400 Bad Request | Start time cannot be greater than or equal to end time. | start is not before end. |
400 Bad Request | start and end must use the same unit; start is in seconds and end is not. | start is in seconds and end is in milliseconds. |
400 Bad Request | Invalid JSON payload for dateRange. | The body is not valid JSON, or start or end is absent. |
401 Unauthorized | — | The API key is not valid. The response carries no {"error": ...} body. |
403 Forbidden | User does not have permission to access this endpoint. | The account has no paid subscription. |
403 Forbidden | User is not subscribed., Classic package does not have access. or User is not subscribed to Orderflow package. | The subscription does not include the package. |
403 Forbidden | This response format is not available for restricted commercial API keys. | The key belongs to a commercial account or a commercial child seat. The server cannot remove the spot price from a stream. |
415 Unsupported Media Type | Content-Type header must be application/json. | The Content-Type header is not application/json. |
429 Too Many Requests | Rate limit exceeded. | The account used its daily or monthly quota for this endpoint. For a full day, use the EOD report (Classic and up) or historical download (Quant). |
Notes & Data Handling
Quota
- Small quota: This endpoint has its own quota pool (
api_history), separate from the other endpoints. The daily limit is small. All API keys of the account share this pool. - Request only the gap: Request the missing range only. A range of 8 hours or less is one request.
- After the close: Classic, State and Orderflow use the EOD report for the latest trading day, from 5:00 PM ET. Quant uses historical download for about the last 90 days.