Skip to content

Prediction Markets Events History

Use this endpoint to retrieve historical snapshots for a prediction market event by its ticker, including model/market probability deltas and time-series context for deeper analysis.

Like the Chat Completions and Responses endpoints, this is a direct REST endpoint and is called relative to the Octagon API base URL:

text
https://api.octagonagents.com/v1

Endpoint

GET /prediction-markets/events/<event_ticker>/history

Where <event_ticker> is the ticker of the prediction market event for which you want to retrieve the historical snapshots.

As a general rule, the event ticker is the last part of the market URL. See the examples below for more details.

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoNumber of records to return. Default 50; minimum 1; maximum 200.
cursorstringNoCursor for pagination. Use the cursor returned from a previous response to continue.
captured_fromdatetime (ISO 8601)NoStart timestamp filter (inclusive) for snapshot capture time.
captured_todatetime (ISO 8601)NoEnd timestamp filter (inclusive) for snapshot capture time.
includestringNoSet to analysis to include heavier analysis columns in the response payload.

Use Cases

  • Build time-series views of model vs. market probability for a specific event ticker.
  • Backtest signal quality (for example, edge_pp and expected_return) across historical snapshots.
  • Track how confidence and liquidity metrics evolve as an event approaches resolution.

Examples

For the Kalshi market with URL https://kalshi.com/markets/kxbtcminy/how-low-will-bitcoin-get-in-2026/kxbtcminy-27jan01.

Get recent history for an event

Python
import requests

url = "https://api.octagonagents.com/v1/prediction-markets/events/kxbtcminy-27jan01/history"
headers = {"Authorization": "Bearer your-octagon-api-key"}
params = {"limit": 50}

response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
print(response.json())
JavaScript
const params = new URLSearchParams({
  limit: "50",
});

const response = await fetch(
  `https://api.octagonagents.com/v1/prediction-markets/events/kxbtcminy-27jan01/history?${params}`,
  {
    headers: {
      Authorization: "Bearer your-octagon-api-key",
    },
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
sh
curl -G "https://api.octagonagents.com/v1/prediction-markets/events/kxbtcminy-27jan01/history" \
  -H "Authorization: Bearer <your-octagon-api-key>" \
  --data-urlencode "limit=50"

Example response (truncated for brevity):

json
{
  "event_ticker": "kxbtcminy-27jan01",
  "data": [
    {
      ...
      "captured_at": "2026-03-18T19:03:37.293044Z",
      "event_ticker": "KXBTCMINY-27JAN01",
      "name": "How low will Bitcoin get in 2026?",
      "slug": "how-low-will-bitcoin-get-in-2026",
      "series_category": "Crypto",
      "close_time": "2027-01-01T05:00:00Z",
      ...
    }
  ],
  "next_cursor": "eyJjYXB0dXJlZF9hdCI6IjIwMjYtMDMtMThUMTk6MDM6MzcuMjkzMDQ0WiIsImhpc3RvcnlfaWQiOjg5MjZ9",
  "has_more": true
}

Get a time-windowed history with analysis fields

Python
import requests

url = "https://api.octagonagents.com/v1/prediction-markets/events/kxbtcminy-27jan01/history"
headers = {"Authorization": "Bearer your-octagon-api-key"}
params = {
    "captured_from": "2026-01-01T00:00:00Z",
    "captured_to": "2026-01-31T23:59:59Z",
    "limit": 100,
    "include": "analysis",
}

response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
print(response.json())
JavaScript
const params = new URLSearchParams({
  captured_from: "2026-01-01T00:00:00Z",
  captured_to: "2026-01-31T23:59:59Z",
  limit: "100",
  include: "analysis",
});

const response = await fetch(
  `https://api.octagonagents.com/v1/prediction-markets/events/kxbtcminy-27jan01/history?${params}`,
  {
    headers: {
      Authorization: "Bearer your-octagon-api-key",
    },
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
sh
curl -G "https://api.octagonagents.com/v1/prediction-markets/events/kxbtcminy-27jan01/history" \
  -H "Authorization: Bearer your-octagon-api-key" \
  --data-urlencode "captured_from=2026-01-01T00:00:00Z" \
  --data-urlencode "captured_to=2026-01-31T23:59:59Z" \
  --data-urlencode "limit=100" \
  --data-urlencode "include=analysis"

Notes

  • Use cursor for pagination when the response is truncated by limit.
  • Start with the default payload and only set include=analysis when those heavier fields are required.
  • Prefer bounded time windows (captured_from and captured_to) for more stable and predictable retrieval.