gexbot api
general

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.

POST/hist/{ticker}/{package}/{category}Classic Tier

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

NameTypeDescription
AuthorizationstringRequired. Format: "Bearer <YOUR_API_KEY>"
User-AgentstringRequired. Identify your client application.
Content-TypestringRequired. Set to "application/json".
AcceptstringOptional. Selects the stream format. See Stream formats.

Path parameters

NameTypeDescriptionOptions
tickerstringThe ticker symbol (e.g., SPX, AAPL).
packagestringThe data package to query.classic, state, orderflow
categorystringThe 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

FieldTypeDescription
startintegerRequired. The start of the range, in Unix epoch seconds or milliseconds.
endintegerRequired. 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 valueResponse Content-TypeBody
application/x-ndjson or application/jsonlinesapplication/x-ndjsonOne JSON snapshot on each line.
application/json-seqapplication/json-seqA JSON text sequence: each snapshot starts with the record separator (0x1E) and ends with a line feed.
application/protobufapplication/octet-streamBinary 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 headerapplication/stream+jsonOne 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: int64

Errors

Errors raised by the API have the body {"error": "<message>"}.

StatusMessageCause
400 Bad RequestUser-Agent not found.The request has no User-Agent header.
400 Bad RequestAuthorization header not found.The request has no Authorization header.
400 Bad RequestInvalid ticker format. or Unknown ticker symbol: <ticker>The ticker is not a supported symbol.
400 Bad RequestInvalid package type.The package is not classic, state or orderflow.
400 Bad RequestInvalid category type. or Invalid category package combination.The category does not exist, or it does not belong to the package.
400 Bad RequestInvalid categoryThe category is volume_zero or volume_one.
400 Bad RequestDate range too large.The range is longer than 8 hours.
400 Bad RequestStart time cannot be greater than or equal to end time.start is not before end.
400 Bad Requeststart 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 RequestInvalid 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 ForbiddenUser does not have permission to access this endpoint.The account has no paid subscription.
403 ForbiddenUser 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 ForbiddenThis 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 TypeContent-Type header must be application/json.The Content-Type header is not application/json.
429 Too Many RequestsRate 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.

On this page