Skip to main content

Charts and History

InTots provides snapshot-based historical data for pools and markets. Use these endpoints to render price charts, track probability movements over time, and analyze market trends.

Pool Ratio Chart​

Returns historical probability ratios for a pool's markets over a given time scale.

GET /api/v1/pools/{id}/ratio/chart

Path Parameters​

ParameterTypeDescription
idstringThe pool ID.

Query Parameters​

ParameterTypeDescription
scalestringRequired. Time scale for data points. One of: 1h, 1d, 1w, 1m.

Scale Reference​

ScaleMeaningTypical Use
1h1-hour intervalsIntraday view of a single trading session.
1d1-day intervalsMulti-day view for events lasting days to weeks.
1w1-week intervalsWeekly trend for longer-running events.
1m1-month intervalsHigh-level trend for events spanning months.

Response​

Returns an array of time-series data points, each containing a timestamp and the ratio values for the pool's markets at that point in time.

[
{
"timestamp": "2026-03-15T10:00:00Z",
"ratios": {
"Yes": 6200,
"No": 3800
}
},
{
"timestamp": "2026-03-15T11:00:00Z",
"ratios": {
"Yes": 6450,
"No": 3550
}
}
]

Ratio values are on the 0--10000 scale, matching market prices. They always sum to 10000 across all outcomes in a pool.

Example​

# Hourly ratio data for a pool
curl "https://api.intots.com/api/v1/pools/pool_xyz/ratio/chart?scale=1h"

# Daily ratio data
curl "https://api.intots.com/api/v1/pools/pool_xyz/ratio/chart?scale=1d"

Comprehensive Pool Charts​

Returns extended chart data for a pool, including volume and other aggregate metrics alongside price history.

GET /api/v1/pools/{id}/charts

Path Parameters​

ParameterTypeDescription
idstringThe pool ID.

Response​

Returns a richer dataset than the ratio endpoint, suitable for building detailed analytics dashboards. Includes price snapshots, volume bars, and trade counts per interval.


Market Price Chart​

Returns historical price data for a single market (one outcome within a pool).

GET /api/v1/markets/{id}/chart

Path Parameters​

ParameterTypeDescription
idstringThe market ID.

Response​

[
{
"timestamp": "2026-03-15T10:00:00Z",
"price": 6200,
"volume": 350000
},
{
"timestamp": "2026-03-15T11:00:00Z",
"price": 6450,
"volume": 120000
}
]
FieldTypeDescription
timestampstringISO 8601 timestamp for the data point.
priceintegerMarket price at this snapshot (0--10000 scale).
volumeintegerTrading volume during this interval, in cents.

How Snapshots Work​

InTots chart data is snapshot-based: the system periodically records the state of each pool and market at fixed intervals. This means:

  • Data points are evenly spaced according to the selected scale.
  • Each data point reflects the price/ratio at the moment the snapshot was taken, not an average over the interval.
  • Volume figures represent the total trading activity between the current snapshot and the previous one.
  • If no trades occurred during an interval, the snapshot still records the current price (which will match the previous snapshot).

Choosing the Right Endpoint​

Use CaseEndpoint
Compare all outcomes in a pool over timeGET /pools/{id}/ratio/chart
Full analytics dashboard for a poolGET /pools/{id}/charts
Price history for one specific outcomeGET /markets/{id}/chart
Real-time price updates (no polling)WebSocket chart feed

Combining with Real-Time Data​

For a seamless chart experience, load historical data from these endpoints on page load and then append live updates from the WebSocket event chart feed (/api/v1/ws/events/{event_id}/chart). This avoids polling and keeps your charts up to date in real time.

// 1. Load historical data
const history = await fetch('/api/v1/pools/pool_xyz/ratio/chart?scale=1h').then(r => r.json());

// 2. Connect to live updates
const ws = new WebSocket('wss://api.intots.com/api/v1/ws/events/evt_abc123/chart');
ws.onmessage = (event) => {
const update = JSON.parse(event.data);
if (update.type === 'chart_update') {
history.push(update);
renderChart(history);
}
};

Tips​

  • Start with 1d scale for most event pages -- it provides a good balance of detail and coverage.
  • Use 1h for active trading sessions where users want granular price movement.
  • Ratio values always sum to 10000 within a pool. If you display them as percentages, they will always add up to 100%.
  • Volume is in cents. Divide by 100 for display in the base currency unit.