veriql forecast public API, v1
Forecast, not financial advice. The API shows forecast ranges for crypto and metal prices and the record of how those ranges held. It gives no buy or sell calls.
- Read-only: every route is
GET. Any other method answers405withAllow: GET. - JSON, UTF-8. Every time is an integer: unix seconds, UTC.
Access-Control-Allow-Origin: *on every response, so a page on any site can read it.- Every
200has a strongETag. Send it back inIf-None-Matchand an unchanged payload answers304with no body. A browser revalidates on its own. SettingIf-None-Matchby hand from a page on another site is not supported: the browser first sends anOPTIONSpreflight, and it answers405. Clients outside a browser may send it. - The JSON Schemas (2020-12) of every payload ship with the client package, in its
schema/v1folder. A field not listed there is never sent. - Credits: Price data: Bitstamp. Metal prices: gold-api.com.
The envelope
Every payload, errors included, carries the envelope:
Table: Field, Value (5 rows)
| Field | Value |
|---|---|
api |
always "v1" |
generated_at |
when the producer wrote the object, unix seconds UTC (errors have none: nothing produced them; the two seal routes have none either, because a seal carries its own sealed_at) |
credits |
the price sources of the payload: "Price data: Bitstamp" for crypto, "Metal prices: gold-api.com" for gold and silver, both for a payload about every asset |
disclaimer |
always "Forecast, not financial advice." |
labels |
the asset's labels as keys (see below); [] for a payload about every asset |
Labels
Table: Key, Words (3 rows)
| Key | Words |
|---|---|
in_testing |
In testing |
beta |
Beta |
thin_data |
Thin data |
Assets
The asset names are case-sensitive.
Table: Asset, Name, Class, Labels (9 rows)
| Asset | Name | Class | Labels |
|---|---|---|---|
BTC |
Bitcoin | crypto | none |
ETH |
Ether | crypto | none |
XRP |
XRP | crypto | none |
SOL |
Solana | crypto | none |
NEAR |
NEAR | crypto | thin_data |
XAU |
Gold | metal | beta |
XAG |
Silver | metal | beta |
XAUXAG |
Gold/silver ratio | ratio | beta |
OIL |
Oil | oil | none |
OIL is listed but has no live price feed yet (copy: "Oil: tested, live soon. We tested oil privately. No free live oil price feed allows this use yet, so oil shows no numbers."), so its routes answer 503
not_ready, and /v1/latest has no OIL entry.
The gold/silver ratio (XAUXAG)
XAUXAG is the price of gold divided by the price of silver, on the metals' hours and from the same source. Its price is a
plain number: show it with no $ and two decimals (for example 84.50). Nothing about it is a dollar amount.
A ratio price is made only from a gold price and a silver price that gold-api.com stamped no more than 60 seconds apart. When
the newest pair is further apart than that, the newest ratio stays as it was, and its ts (the later of the two stamps) does
not move. A ratio price turns out of date 840 seconds after its ts (price.stale is true, counted in open-market seconds),
which is the 900 second limit the metals have, less the 60 seconds a pair may be apart. The same limit makes a ratio forecast
stale.
Its credit is "Metal prices: gold-api.com", the same as gold and silver. It follows the metal market hours, so it has no forecast while the market is closed.
show is a display flag. A ratio is recorded and served whether or not it is shown: /v1/latest/XAUXAG and
/v1/hourly/XAUXAG answer as they do for any asset (/v1/hourly answers as it does for gold: there is no hourly file). The
listings follow the flag: /v1/now, the scorecard and the challenger list include XAUXAG only once it is shown.
In plain words
The fields below are defined in the tables of each route. These sentences say the same things in plain words. The "How to read this" page on the site quotes them word for word, and a test checks that every one of them is here.
- A forecast here is a range of prices that the price is likely to end in, not a single predicted price.
- The forecasts give no buy or sell calls.
- A window is the stretch of time one forecast covers: the next 24 hours or the next 8 hours, from its start to its end.
- The start price is the price the range starts from.
- The 90% range is where the price is likely to end the window, 90% of the time.
- The 80% range is narrower: where the price is likely to end the window, 80% of the time.
- A 90% range is built so that the price ends inside it about 9 times in 10, and outside it about 1 time in 10.
- A level is a move from the start price, written as a share of it: 0.01 is 1%.
- A touch chance is the chance that the price reaches a level, up or down from the start price, at any moment before the window ends.
- The chance of ending beyond a level is the chance that the price ends the window past that level, and it is never more than the touch chance.
- Gold and silver show touch chances once their own live record passes the touch-chance check. Crypto assets already show theirs.
- The so-far low and high are the lowest and highest price from the start of the window to the newest minute that is final.
- A level counts as touched when it lies between the so-far low and high of the same window.
- The comparison with usual is today's 90% range width divided by the usual width, which is the median over every forecast of the last 365 days.
- There is no comparison with usual until there are 365 days of forecasts.
- An input's effect compares today's 90% range width with the width when only that input is set to its usual value: above 0 the input widens the range, below 0 it narrows it.
- The effects are each one input at a time; they are not parts of the comparison with usual, and no combination of them gives it.
- A touch sample is the past cases that touch chances come from: for each one, how far the price went up, how far it went down and where it ended, measured against the volatility of that forecast. A touch chance is the share of those past cases that reached the level, with the level measured against today's volatility.
- The hours that add the most are the hours in which the 90% range widens the most from the hour before.
- A range is shown only when the status is live.
- A warming-up metal shows how many checks it has done of the checks it needs before a range is shown.
- The note about the model fit shows when the fit is older than usual.
- A range held when the price ended its window inside that range.
- The record is how many past ranges were checked and the share of them that held.
- Self-correction is the published 90% range width divided by the width the plain model would give: above 1 testing on past data widened the range, below 1 it narrowed it.
- The 52-week range is the lowest and highest price of the past 365 days. The position is how far up it the last price sat, and the drawdown is how far below the high.
- The 50-day and 200-day averages are the plain averages of the last 50 and 200 daily prices. The page says how far above or below each the last price sat, or level within 0.05%. Gold and silver use the gold-api.com daily average price for each day it has one, and so does the gold/silver ratio, which is gold's daily average divided by silver's. A pair of two of them compares those daily averages; a pair with a crypto uses the midpoint of the crypto's day high and low.
- The volatility percentile is the share of 30-day stretches in the past 365 days that moved less than the last 30 days, rounded down. Gold and silver count trading days.
- A correlation, r, runs from −1 to 1. Near 1 means two prices moved together over the last 90 days, near −1 means opposite ways, near 0 no clear link. It is not a cause or a forecast. The approximate 95% range shows how much r can change with other days. A pair with under 30 days shows no r.
- A price is at most a minute old, plus the time the cache holds it.
Status words
Each forecast horizon has a status. A range is shown only when it is live.
Table: Status, Words (8 rows)
| Status | Words |
|---|---|
live |
Live |
warming_up |
Warming up: not enough data yet to show a range. |
thin_data |
Thin data: little trading history for this asset. |
market_closed |
Market closed. |
paused |
Paused. |
stale |
Out of date, so no range is shown. |
coming_soon |
Coming soon. |
testing_hidden |
In testing: not shown yet. |
stale has two true causes, and the entry says which in stale_cause (below): price when the price the range starts from did
not arrive, state when the forecast itself could not be made or updated. A client words stale by that field, and says
"the price at this window's start did not arrive" only for price. A gold or silver entry that is stale while checks_done is still below
checks_needed is, for the reader, a forecast that is still warming up: show "checks_done of checks_needed".
Endpoints
GET /v1/now
The live price of every asset, and for each forecast window that is open now, the lowest and highest price so far.
Cache: Cache-Control: public, max-age=60. The Worker rewrites the object every minute, so it is at most a minute old plus
the cache.
Fields: the envelope, plus assets, keyed by asset: {price, windows}.
Table: Field, Meaning (9 rows)
| Field | Meaning |
|---|---|
price |
{value, ts, source, stale}, or null when no price has been seen for the asset |
price.value |
crypto: the close of the newest stored 1-minute Bitstamp candle. Gold and silver: the newest gold-api price. The gold/silver ratio: the newest gold price divided by the newest silver price. No other source is used |
price.ts |
when it was observed: crypto, the end of that candle's minute; metals, the updated_at gold-api reported |
price.source |
the credit for the source |
price.stale |
true when the price is older than the limit: 300 seconds for crypto, and for metals the same limit as a stale metal forecast, counted in open-market time (the gold/silver ratio: 840 seconds, see "The gold/silver ratio") |
windows |
{"24h", "8h"}, each {origin, ends_at, low, high, until} or null |
windows.<h>.origin, ends_at |
the window of the newest published forecast whose window contains now: origin <= now < ends_at, and ends_at - origin is the horizon |
windows.<h>.low, high |
the lowest and highest price from origin to until |
windows.<h>.until |
the end of the newest minute that low and high include; never after ends_at |
How low, high and until are worked out. They use the data and the rule the nightly check uses to record a window.
Crypto: the highest high and the lowest low of the traded 1-minute Bitstamp candles (volume above 0) that start at
or after origin and before until. Gold and silver: the highest and lowest of the minute prices the poll stored,
one price per minute (the last of that minute), from origin to until. A minute counts once it is final and it has
arrived. Final: Bitstamp publishes a candle about a minute after it ends, so a minute counts only after now - 60.
Arrived: until is the end of the newest minute the Worker actually received (for gold and silver, a minute counts
once a poll snapshot from a later minute has arrived, because the last snapshot of a minute is the one that counts),
but never later than floor((now - 60) / 60) * 60 (seconds) and never after ends_at. A minute that has not
arrived is asked for again the next minute, so until stops moving while the source is late, and the price turns
stale. A so-far value is a value of the minutes already final and received: low and high equal the recorded lo
and hi computed over [origin, until). The recorded lo and hi of a finished window also include the minutes from
until to ends_at, up to two of them (the minute still open and the one inside the 60 second lag), so they can be a
little wider than the last /v1/now value of that window. Once a window has ended, read its result, not its so-far
value.
A window is null when no forecast has been published for the window that contains now, when no minute of it has been
seen yet, or (gold and silver) when the market is closed. A window of a forecast other than the one /v1/latest shows
is never reported: origin is the shown forecast's ends_at minus its horizon. A window is reported when its forecast
is published, even if /v1/latest shows that asset as stale or without a number: price, low and high are observed
prices, not forecasts. After a failed read of the price
source the last good numbers stay and the price turns stale once it is older than the limit; a number is never half
written. This feed carries no candle list; the closed 5-minute bars are at /v1/candles/{asset}.
Example response (48 lines)
{
"api": "v1",
"generated_at": 1830340833,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"assets": {
"BTC": {
"price": {
"value": 100420.5,
"ts": 1830340740,
"source": "Price data: Bitstamp",
"stale": false
},
"windows": {
"24h": {
"origin": 1830297600,
"ends_at": 1830384000,
"low": 99100.0,
"high": 101650.25,
"until": 1830340740
},
"8h": {
"origin": 1830326400,
"ends_at": 1830355200,
"low": 99870.0,
"high": 101020.5,
"until": 1830340740
}
}
},
"XAU": {
"price": {
"value": 2651.4,
"ts": 1830340821,
"source": "Metal prices: gold-api.com",
"stale": false
},
"windows": {
"24h": null,
"8h": null
}
}
}
}
GET /v1/candles/{asset}
The 5-minute candles of one market: complete bars only, oldest first, about the last two days. The forming bar is not
included; build it from /v1/now. asset is one of BTC, ETH, XRP, SOL, NEAR, XAU, XAG or XAUXAG; oil has no live
feed and, like any other symbol, answers 404 unknown_asset. A market whose first bar is not written yet answers 503
not_ready. Cache: Cache-Control: public, max-age=60. The Worker adds the bars of one market every five minutes, so a
bar usually appears within six minutes after it closed (crypto); a tick busy with a forecast job or the hourly seal waits, and the market takes its next turn five minutes later. Metal and ratio bars are built one minute (now.lag_s) after the bar closed, so a late price still lands in it; a market whose turn falls in that minute builds the bar at its next turn, up to ten minutes after the close.
Freshness: judge it by the last bar's t plus bar_s compared with now, not by generated_at. Each tick reads only a few rows per market, so after a cold start or an outage the newest bar can be hours old while the older bars fill in, even though generated_at is recent.
Fields: the envelope, plus asset, bar_s (the seconds in a bar, always 300) and bars, a list of
[t, o, h, l, c]: t is the bar's start (a multiple of bar_s, ascending, never repeated), then the open, high, low and
close.
- Crypto:
handlare the highest high and lowest low of the bar's one-minute candles andcis the last minute's close.ois the previous bar's close when that bar is the one right before, else the first minute's close. - Metals:
o,h,landccome from the gold-api prices inside the bar (first, highest, lowest, last). A bar with no price does not exist: while the market is closed there are no bars, and nothing is filled in. XAUXAG:cis the bar's last gold price over its last silver price, when both have a price in the bar, ando,handlequal it. A bar with only one metal does not exist.
{
"api": "v1",
"generated_at": 1799928300,
"credits": [
"Price data: Bitstamp"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [
"in_testing"
],
"asset": "BTC",
"bar_s": 300,
"bars": [
[1799927700, 64210.5, 64233.1, 64198.0, 64225.4],
[1799928000, 64225.4, 64240.0, 64210.2, 64219.9]
]
}
GET /v1/latest
The latest forecast of every asset that has one. Cache: Cache-Control: public, max-age=300 (the widget's refresh floor).
Fields: the envelope, plus assets, keyed by asset: {name, labels, horizons}. horizons holds 24h
and/or 8h, each a horizon entry as in /v1/latest/{asset}.
Example response (262 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"assets": {
"BTC": {
"name": "Bitcoin",
"labels": [
"in_testing"
],
"horizons": {
"24h": {
"start_price": 97000.0,
"range90": {
"low": 93993.0,
"high": 100104.0,
"low_pct": -3.1,
"high_pct": 3.2
},
"range80": {
"low": 94672.0,
"high": 99425.0,
"low_pct": -2.4,
"high_pct": 2.5
},
"ends_at": 1830384000,
"status": "live",
"fit_stale": false,
"touch": [
{
"level": 0.01,
"side": "up",
"chance": 0.62,
"chance_text": "62%",
"beyond_end": 0.31,
"beyond_end_text": "31%"
},
{
"level": 0.01,
"side": "dn",
"chance": 0.58,
"chance_text": "58%",
"beyond_end": 0.29,
"beyond_end_text": "29%"
},
{
"level": 0.13,
"side": "up",
"chance": 0.0,
"chance_text": "under 1 in 4000",
"beyond_end": 0.0,
"beyond_end_text": "under 1 in 4000"
}
],
"record": {
"checks": 212,
"held90": 0.896,
"held80": 0.792
},
"closed_until": null,
"why": {
"vs_usual": {
"ratio": 1.0091,
"basis_days": 365,
"n": 317
},
"drivers": [
{
"key": "xw",
"value": -7.0914,
"usual": -7.1717,
"effect": 0.01786
},
{
"key": "xm",
"value": -6.7449,
"usual": -7.0626,
"effect": -0.00898
},
{
"key": "xd",
"value": -7.2637,
"usual": -7.2406,
"effect": -0.00561
},
{
"key": "wk",
"value": 1,
"usual": 0,
"effect": -0.00264
},
{
"key": "coverage",
"value": 1.007,
"usual": 1.0065,
"effect": 0.00047
}
]
}
},
"8h": {
"start_price": 97000.0,
"range90": {
"low": 93993.0,
"high": 100104.0,
"low_pct": -3.1,
"high_pct": 3.2
},
"range80": {
"low": 94672.0,
"high": 99425.0,
"low_pct": -2.4,
"high_pct": 2.5
},
"ends_at": 1830326400,
"status": "live",
"fit_stale": false,
"touch": [
{
"level": 0.01,
"side": "up",
"chance": 0.62,
"chance_text": "62%",
"beyond_end": 0.31,
"beyond_end_text": "31%"
},
{
"level": 0.01,
"side": "dn",
"chance": 0.58,
"chance_text": "58%",
"beyond_end": 0.29,
"beyond_end_text": "29%"
},
{
"level": 0.13,
"side": "up",
"chance": 0.0,
"chance_text": "under 1 in 4000",
"beyond_end": 0.0,
"beyond_end_text": "under 1 in 4000"
}
],
"record": {
"checks": 212,
"held90": 0.896,
"held80": 0.792
},
"closed_until": null,
"why": {
"vs_usual": {
"ratio": 0.88,
"basis_days": 365,
"n": 1047
},
"drivers": [
{
"key": "x3",
"value": -8.7908,
"usual": -8.3165,
"effect": -0.09722
},
{
"key": "x1",
"value": -8.7819,
"usual": -8.3781,
"effect": -0.01398
},
{
"key": "j2",
"value": 1,
"usual": 0,
"effect": -0.01018
},
{
"key": "x21",
"value": -8.2875,
"usual": -8.2575,
"effect": -0.00648
},
{
"key": "x90",
"value": -7.856,
"usual": -8.1491,
"effect": -0.00529
},
{
"key": "wk",
"value": 1,
"usual": 0,
"effect": 0.00431
},
{
"key": "coverage",
"value": 0.9905,
"usual": 0.9886,
"effect": 0.00196
},
{
"key": "j1",
"value": 0,
"usual": 0,
"effect": 0
}
]
}
}
}
},
"XAU": {
"name": "Gold",
"labels": [
"in_testing",
"beta"
],
"horizons": {
"24h": {
"start_price": 2650.5,
"range90": {
"low": 2618.69,
"high": 2684.96,
"low_pct": -1.2,
"high_pct": 1.3
},
"range80": {
"low": 2626.65,
"high": 2677.01,
"low_pct": -0.9,
"high_pct": 1.0
},
"ends_at": 1830384000,
"status": "live",
"fit_stale": false,
"touch": [],
"record": {
"checks": 40,
"held90": null,
"held80": null
},
"closed_until": null,
"why": {
"vs_usual": null,
"drivers": null
},
"market_open": true,
"reopen_jump": {
"weekends": 52,
"median_pct": 0.31,
"p90_pct": 1.12
},
"checks_done": 44,
"checks_needed": 30
}
}
}
}
}
GET /v1/latest/{asset}
One asset's latest forecast. Cache: Cache-Control: public, max-age=300. An asset not in the table above answers 404
unknown_asset.
Fields: the envelope, plus asset, name and horizons (24h and/or 8h). Each horizon entry:
Table: Field, Meaning (14 rows)
| Field | Meaning |
|---|---|
start_price |
the price the range starts from (null unless live) |
range90, range80 |
{low, high, low_pct, high_pct}: where the price is likely to end, 90% and 80% of the time; low and high are prices, low_pct and high_pct the moves from start_price in percent (null unless live) |
ends_at |
when the range ends (null for a paused or closed entry) |
status |
a status word (above) |
fit_stale |
true when the model fit is older than usual |
stale_cause |
only on an entry whose status is stale: price when no current price reached the publish (no price at its slot, or one older than the limit), state when the engine had no state to forecast from. The field is absent on every other status |
touch |
[{level, side, chance, chance_text, beyond_end, beyond_end_text}]: the chance the price touches start_price moved by level (0.01 is 1%) up or dn (down) before ends_at; chance_text is the same as words. beyond_end is the chance the price ends the window beyond this level, always at most chance; beyond_end_text is the same as words. Empty for gold and silver for now |
record |
{checks, held90, held80}: how many past ranges were checked and the share that held (null before the first check). One source for every asset: held90 and held80 are shares of these checks |
closed_until |
metals: when a closed market reopens, else null |
why |
{vs_usual, drivers}: why the 90% range is this size (below); both null unless live |
market_open |
gold and silver only: the market is open now (null when unknown) |
reopen_jump |
gold and silver only: {weekends, median_pct, p90_pct}, the size of past weekend reopen moves in percent, or null |
checks_done |
gold and silver only: the count of checks the model itself uses to decide whether it shows a range (the larger of the main and the cold-start counts while the cold start is used), or null when it is not known. It is not record.checks, which counts the recorded live ranges |
checks_needed |
gold and silver only: how many checks checks_done must reach before a range is shown. While checks_done is lower the status is warming_up (or stale, when the price or the state is missing at the same time), so a client can show "checks_done of checks_needed" |
long: the gold/silver ratio's 30 and 90 day ranges
Only /v1/latest/XAUXAG has it, and only once the first long forecast is written; the field is optional, so a client that
does not know it can ignore it. A long forecast is made once a day, in the first five minutes after 00:00 UTC, from the
ratio's last price in the five minutes before 00:00, on a day the market is open at 00:00. It is a range of prices that the
ratio is likely to end in 30 or 90 days later, not a single predicted price. long is {t, stale, windows}:
Table: Field, Meaning (3 rows)
| Field | Meaning |
|---|---|
t |
the 00:00 UTC (unix seconds) of the newest long forecasts |
stale |
true when t is more than five days before 00:00 UTC today |
windows |
30d and/or 90d, each as below |
Each window: status (shown: the ranges are shown; cannot_tell: the past data did not support a range for this window,
so there is none; removed: the live record fell short of its preregistered bar, so the range was taken off and stays off),
start_price (the ratio price the ranges start from), ends_at, range90 and range80 ({low, high, low_pct, high_pct}
as in a horizon entry, or null: a level that did not pass its past-data test has none), lean, checks (how many
non-overlapping 30 or 90 day windows have been checked), next_due (when the next window ends, or null) and test (what
the past-data test found: {since_year, n, levels} with each level's state, hit share and its lo and hi bounds, or
null).
lean is {state, dir, hit, naive_hit, n, source, since_year}: a lean is a direction (dir, higher or lower, else
null) that the ratio moved in, compared with a plain rule's hit rate (naive_hit). dir is set only when state is
pass. source is history until 30 live checks exist, then live. A lean is not a range and not advice.
A removal shows in the record the night it fires (the nightly runs at 00:07 UTC) and reaches latest at the next 00:00 UTC,
up to about a day later.
why: why the range is this size
Every width here is the 90% range's log-width, ln(high / low) of range90 (the same in log returns, so no price is
needed). The usual values come from the forecasts this asset and horizon published on the shown chain over the 365 days
before the nightly fit the forecast uses, walk-forward, with no look-ahead.
vs_usualis{ratio, basis_days, n}:ratiois today's 90% log-width divided by the usual width, the median over every forecast in the last 365 days;basis_daysis always 365 andnis how many forecasts the median is over.vs_usualis null when there are fewer than 365 days of forecasts; the window is never shortened, so gold and silver have novs_usualfor now.driversis[{key, value, usual, effect}], largest|effect|first, one row per model input:valueis today's input, andusual, each input's usual value, is its median over the forecasts in those 365 days where it is defined.- An input with no usual value, no value today or no defined
effectis left out ofdrivers, never filled in. effectis today's 90% log-width divided by the width recomputed with that one input set tousualand everything else kept, minus 1: above 0 the input widens the range, below 0 it narrows it.- The
effectvalues are each one input at a time; they are not parts ofvs_usual, and no combination of them gives it. keynames the input:xd,xw,xm(24h) andx1,x3,x21,x90(8h) are the log of the average realised variance over the last 1, 7 and 30 days (24h) or the last 1, 3, 21 and 90 eight-hour windows (8h);j1andj2are 1 for the 8h windows that start at 08:00 and 16:00 UTC;wkis 1 on a Saturday or Sunday (UTC);ewmais the gold and silver EWMA variance;coverageis the self-correction ratio (as in/v1/evolution).- The crypto inputs are the HAR terms and
coverage. The EWMA and the blend weight are left out: the blend has one member (har_pooled), whose weight cancels from the width and which does not use the EWMA. - Gold and silver's inputs are the HAR terms,
ewmaandcoverage, on thespecchain; their blend weights are fixed, so they are no input. driversis null whenevervs_usualis, when the blend has more than one member, for a metal without a HAR variance and when no input is left.
Example response (211 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [
"in_testing"
],
"asset": "BTC",
"name": "Bitcoin",
"horizons": {
"24h": {
"start_price": 97000.0,
"range90": {
"low": 93993.0,
"high": 100104.0,
"low_pct": -3.1,
"high_pct": 3.2
},
"range80": {
"low": 94672.0,
"high": 99425.0,
"low_pct": -2.4,
"high_pct": 2.5
},
"ends_at": 1830384000,
"status": "live",
"fit_stale": false,
"touch": [
{
"level": 0.01,
"side": "up",
"chance": 0.62,
"chance_text": "62%",
"beyond_end": 0.31,
"beyond_end_text": "31%"
},
{
"level": 0.01,
"side": "dn",
"chance": 0.58,
"chance_text": "58%",
"beyond_end": 0.29,
"beyond_end_text": "29%"
},
{
"level": 0.13,
"side": "up",
"chance": 0.0,
"chance_text": "under 1 in 4000",
"beyond_end": 0.0,
"beyond_end_text": "under 1 in 4000"
}
],
"record": {
"checks": 212,
"held90": 0.896,
"held80": 0.792
},
"closed_until": null,
"why": {
"vs_usual": {
"ratio": 1.0091,
"basis_days": 365,
"n": 317
},
"drivers": [
{
"key": "xw",
"value": -7.0914,
"usual": -7.1717,
"effect": 0.01786
},
{
"key": "xm",
"value": -6.7449,
"usual": -7.0626,
"effect": -0.00898
},
{
"key": "xd",
"value": -7.2637,
"usual": -7.2406,
"effect": -0.00561
},
{
"key": "wk",
"value": 1,
"usual": 0,
"effect": -0.00264
},
{
"key": "coverage",
"value": 1.007,
"usual": 1.0065,
"effect": 0.00047
}
]
}
},
"8h": {
"start_price": 97000.0,
"range90": {
"low": 93993.0,
"high": 100104.0,
"low_pct": -3.1,
"high_pct": 3.2
},
"range80": {
"low": 94672.0,
"high": 99425.0,
"low_pct": -2.4,
"high_pct": 2.5
},
"ends_at": 1830326400,
"status": "live",
"fit_stale": false,
"touch": [
{
"level": 0.01,
"side": "up",
"chance": 0.62,
"chance_text": "62%",
"beyond_end": 0.31,
"beyond_end_text": "31%"
},
{
"level": 0.01,
"side": "dn",
"chance": 0.58,
"chance_text": "58%",
"beyond_end": 0.29,
"beyond_end_text": "29%"
},
{
"level": 0.13,
"side": "up",
"chance": 0.0,
"chance_text": "under 1 in 4000",
"beyond_end": 0.0,
"beyond_end_text": "under 1 in 4000"
}
],
"record": {
"checks": 212,
"held90": 0.896,
"held80": 0.792
},
"closed_until": null,
"why": {
"vs_usual": {
"ratio": 0.88,
"basis_days": 365,
"n": 1047
},
"drivers": [
{
"key": "x3",
"value": -8.7908,
"usual": -8.3165,
"effect": -0.09722
},
{
"key": "x1",
"value": -8.7819,
"usual": -8.3781,
"effect": -0.01398
},
{
"key": "j2",
"value": 1,
"usual": 0,
"effect": -0.01018
},
{
"key": "x21",
"value": -8.2875,
"usual": -8.2575,
"effect": -0.00648
},
{
"key": "x90",
"value": -7.856,
"usual": -8.1491,
"effect": -0.00529
},
{
"key": "wk",
"value": 1,
"usual": 0,
"effect": 0.00431
},
{
"key": "coverage",
"value": 0.9905,
"usual": 0.9886,
"effect": 0.00196
},
{
"key": "j1",
"value": 0,
"usual": 0,
"effect": 0
}
]
}
}
}
}
A closed metal market:
Example response (43 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [
"in_testing",
"beta"
],
"asset": "XAU",
"name": "Gold",
"horizons": {
"24h": {
"start_price": null,
"range90": null,
"range80": null,
"ends_at": null,
"status": "market_closed",
"fit_stale": false,
"touch": [],
"record": {
"checks": 40,
"held90": null,
"held80": null
},
"closed_until": 1830459600,
"why": {
"vs_usual": null,
"drivers": null
},
"market_open": false,
"reopen_jump": {
"weekends": 52,
"median_pct": 0.31,
"p90_pct": 1.12
},
"checks_done": 44,
"checks_needed": 30
}
}
}
GET /v1/hourly/{asset}
The 24 hourly ranges of the 00:00 UTC forecast: where the price is likely to be at the end of each hour.
Cache: Cache-Control: public, max-age=300.
Fields: the envelope, plus asset, origin (the 00:00 UTC start), start_price and hours, 24 entries of
{hour, t, range90, range80} (hour 1 to 24 after origin, t the end of that hour).
Example response (400 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [
"in_testing"
],
"asset": "BTC",
"origin": 1830297600,
"start_price": 97000.0,
"hours": [
{
"hour": 1,
"t": 1830301200,
"range90": {
"low": 96388.9,
"high": 97630.5,
"low_pct": -0.63,
"high_pct": 0.65
},
"range80": {
"low": 96524.7,
"high": 97494.7,
"low_pct": -0.49,
"high_pct": 0.51
}
},
{
"hour": 2,
"t": 1830304800,
"range90": {
"low": 96136.7,
"high": 97892.4,
"low_pct": -0.89,
"high_pct": 0.92
},
"range80": {
"low": 96330.7,
"high": 97698.4,
"low_pct": -0.69,
"high_pct": 0.72
}
},
{
"hour": 3,
"t": 1830308400,
"range90": {
"low": 95933.0,
"high": 98096.1,
"low_pct": -1.1,
"high_pct": 1.13
},
"range80": {
"low": 96175.5,
"high": 97853.6,
"low_pct": -0.85,
"high_pct": 0.88
}
},
{
"hour": 4,
"t": 1830312000,
"range90": {
"low": 95768.1,
"high": 98270.7,
"low_pct": -1.27,
"high_pct": 1.31
},
"range80": {
"low": 96049.4,
"high": 97989.4,
"low_pct": -0.98,
"high_pct": 1.02
}
},
{
"hour": 5,
"t": 1830315600,
"range90": {
"low": 95632.3,
"high": 98416.2,
"low_pct": -1.41,
"high_pct": 1.46
},
"range80": {
"low": 95933.0,
"high": 98105.8,
"low_pct": -1.1,
"high_pct": 1.14
}
},
{
"hour": 6,
"t": 1830319200,
"range90": {
"low": 95496.5,
"high": 98552.0,
"low_pct": -1.55,
"high_pct": 1.6
},
"range80": {
"low": 95836.0,
"high": 98212.5,
"low_pct": -1.2,
"high_pct": 1.25
}
},
{
"hour": 7,
"t": 1830322800,
"range90": {
"low": 95380.1,
"high": 98678.1,
"low_pct": -1.67,
"high_pct": 1.73
},
"range80": {
"low": 95739.0,
"high": 98309.5,
"low_pct": -1.3,
"high_pct": 1.35
}
},
{
"hour": 8,
"t": 1830326400,
"range90": {
"low": 95263.7,
"high": 98794.5,
"low_pct": -1.79,
"high_pct": 1.85
},
"range80": {
"low": 95651.7,
"high": 98396.8,
"low_pct": -1.39,
"high_pct": 1.44
}
},
{
"hour": 9,
"t": 1830330000,
"range90": {
"low": 95157.0,
"high": 98901.2,
"low_pct": -1.9,
"high_pct": 1.96
},
"range80": {
"low": 95574.1,
"high": 98484.1,
"low_pct": -1.47,
"high_pct": 1.53
}
},
{
"hour": 10,
"t": 1830333600,
"range90": {
"low": 95060.0,
"high": 99007.9,
"low_pct": -2.0,
"high_pct": 2.07
},
"range80": {
"low": 95496.5,
"high": 98561.7,
"low_pct": -1.55,
"high_pct": 1.61
}
},
{
"hour": 11,
"t": 1830337200,
"range90": {
"low": 94963.0,
"high": 99104.9,
"low_pct": -2.1,
"high_pct": 2.17
},
"range80": {
"low": 95428.6,
"high": 98639.3,
"low_pct": -1.62,
"high_pct": 1.69
}
},
{
"hour": 12,
"t": 1830340800,
"range90": {
"low": 94875.7,
"high": 99192.2,
"low_pct": -2.19,
"high_pct": 2.26
},
"range80": {
"low": 95351.0,
"high": 98716.9,
"low_pct": -1.7,
"high_pct": 1.77
}
},
{
"hour": 13,
"t": 1830344400,
"range90": {
"low": 94788.4,
"high": 99289.2,
"low_pct": -2.28,
"high_pct": 2.36
},
"range80": {
"low": 95283.1,
"high": 98784.8,
"low_pct": -1.77,
"high_pct": 1.84
}
},
{
"hour": 14,
"t": 1830348000,
"range90": {
"low": 94701.1,
"high": 99366.8,
"low_pct": -2.37,
"high_pct": 2.44
},
"range80": {
"low": 95224.9,
"high": 98852.7,
"low_pct": -1.83,
"high_pct": 1.91
}
},
{
"hour": 15,
"t": 1830351600,
"range90": {
"low": 94623.5,
"high": 99454.1,
"low_pct": -2.45,
"high_pct": 2.53
},
"range80": {
"low": 95157.0,
"high": 98920.6,
"low_pct": -1.9,
"high_pct": 1.98
}
},
{
"hour": 16,
"t": 1830355200,
"range90": {
"low": 94545.9,
"high": 99531.7,
"low_pct": -2.53,
"high_pct": 2.61
},
"range80": {
"low": 95098.8,
"high": 98978.8,
"low_pct": -1.96,
"high_pct": 2.04
}
},
{
"hour": 17,
"t": 1830358800,
"range90": {
"low": 94468.3,
"high": 99609.3,
"low_pct": -2.61,
"high_pct": 2.69
},
"range80": {
"low": 95040.6,
"high": 99037.0,
"low_pct": -2.02,
"high_pct": 2.1
}
},
{
"hour": 18,
"t": 1830362400,
"range90": {
"low": 94400.4,
"high": 99686.9,
"low_pct": -2.68,
"high_pct": 2.77
},
"range80": {
"low": 94982.4,
"high": 99104.9,
"low_pct": -2.08,
"high_pct": 2.17
}
},
{
"hour": 19,
"t": 1830366000,
"range90": {
"low": 94322.8,
"high": 99764.5,
"low_pct": -2.76,
"high_pct": 2.85
},
"range80": {
"low": 94924.2,
"high": 99153.4,
"low_pct": -2.14,
"high_pct": 2.22
}
},
{
"hour": 20,
"t": 1830369600,
"range90": {
"low": 94254.9,
"high": 99832.4,
"low_pct": -2.83,
"high_pct": 2.92
},
"range80": {
"low": 94875.7,
"high": 99211.6,
"low_pct": -2.19,
"high_pct": 2.28
}
},
{
"hour": 21,
"t": 1830373200,
"range90": {
"low": 94187.0,
"high": 99900.3,
"low_pct": -2.9,
"high_pct": 2.99
},
"range80": {
"low": 94827.2,
"high": 99269.8,
"low_pct": -2.24,
"high_pct": 2.34
}
},
{
"hour": 22,
"t": 1830376800,
"range90": {
"low": 94119.1,
"high": 99968.2,
"low_pct": -2.97,
"high_pct": 3.06
},
"range80": {
"low": 94769.0,
"high": 99318.3,
"low_pct": -2.3,
"high_pct": 2.39
}
},
{
"hour": 23,
"t": 1830380400,
"range90": {
"low": 94060.9,
"high": 100036.1,
"low_pct": -3.03,
"high_pct": 3.13
},
"range80": {
"low": 94720.5,
"high": 99376.5,
"low_pct": -2.35,
"high_pct": 2.45
}
},
{
"hour": 24,
"t": 1830384000,
"range90": {
"low": 93993.0,
"high": 100104.0,
"low_pct": -3.1,
"high_pct": 3.2
},
"range80": {
"low": 94672.0,
"high": 99425.0,
"low_pct": -2.4,
"high_pct": 2.5
}
}
]
}
GET /v1/touch/{asset}/{h}
The touch sample of one crypto forecast, for a client that computes its own touch chances at any level. h is
24h or 8h; anything else answers 400 bad_horizon. Cache: Cache-Control: public, max-age=300.
Fields: the envelope, plus asset, horizon, t (the start), ends_at, p0 (the start price), sigma_now
(the forecast volatility over the horizon, as a log-return), n (the sample size) and samples
{e_up, e_dn, z}: for each past case, how far the price went up, how far it went down and where it ended, measured against the volatility of that forecast. The chances come from them.
Optional from_now, present only when the asset's hourly view is ready and at least one part passed its history test:
share (24 numbers, the hour-by-hour split of the window that the hourly bands use),
chances and ranges (whether each part passed its history test and is not switched off) and off
({chances?, ranges?}, the YYYY-MM-DD date a part was switched off; left out when no part is). The flags show
which parts passed their history test.
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [
"in_testing"
],
"asset": "BTC",
"horizon": "24h",
"t": 1830297600,
"ends_at": 1830384000,
"p0": 97000.0,
"sigma_now": 0.0188,
"n": 4,
"samples": {
"e_up": [
0.41,
1.02,
2.37,
0.12
],
"e_dn": [
0.88,
0.05,
1.71,
0.64
],
"z": [
0.3,
-1.2,
0.7,
-0.1
]
}
}
GET /v1/scorecard
How the ranges did against their targets, per asset and horizon, over the last 365 days; and the challenger
models scored beside them. Updated nightly. Cache: Cache-Control: public, max-age=3600.
Fields: the envelope, plus:
card, keyed by asset then horizon:nchecks ofNneeded,window{start, end},held90andheld80({count, share, range},rangethe counts a correct model gives 95% of the time),misses(loandhimisses per band),thirds(calm,mediumandwilddays), the targetsT1toT6(each either{text, n, N, pass: null}while there are not enough checks, or its values,limitandpass),touch_bins(10 bins of{p_lo, p_hi, checks, happened}),winkler(interval scores against theewmaandnaivebaselines),stale_share,stale_hidden,backtest(per band and side,ewith analarm,kupiec_panddq_p) anddrift_at(int unix seconds or null: the latest drift alarm on the main model's live errors for that asset and horizon; its evolution entry uses the copy keyevolution.drift_alarm).- For an asset and horizon whose 8h from-now ranges passed their history test, a card also has the optional
now_fields ofGET /v1/record(now_windows,now_held90,now_held80,now_history_held90,now_history_held80,now_history_windows) andnow_e(the running e-value of the live ranges),now_off(the UTC date the ranges were switched off because their live record missed, ornull) andnow_skipped(settled windows left out of the live record: no price, or the published band could not be reproduced exactly). The ranges switch off whennow_ereaches 20 and stay off. Without the history result, none of these fields is present. - For ETH, XRP and SOL at 24h, whose from-now chances (the Pro 24h endpoint) passed their history test, a card also has
the optional
now_bins,now_chance_windowsandnow_history_binsofGET /v1/record, plusnow_chances_e(the running e-value of the live chances),now_chances_off(the UTC date the chances were switched off because their live record missed, ornull),now_chances_skipped(settled windows left out of the live record: the tables that were served could not be reproduced exactly, or a price was missing),now_brier(the Brier score of the live touch chances,nullbefore the first one) andnow_stale_skill(the skill of the live touch chances over the chance set at the window start at the same level: 1 minus the ratio of their Brier scores, above 0 when the from-now chance scored better;nullwhile there is no check with both chances). The chances switch off whennow_chances_ereaches 20 and stay off. Every other asset and horizon is unchanged. challengers: one row per challenger model,running(with its scoresbyasset and horizon beside the main model's),waiting(withtext) orqueued(withnameandstarts).
Example response (285 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"card": {
"BTC": {
"24h": {
"n": 40,
"N": 330,
"window": {
"start": 1798761600,
"end": 1830297600
},
"held90": {
"count": 36,
"share": 0.9,
"range": [
31,
39
]
},
"held80": {
"count": 31,
"share": 0.775,
"range": [
27,
36
]
},
"misses": {
"90": {
"lo": 2,
"hi": 2
},
"80": {
"lo": 5,
"hi": 4
}
},
"thirds": {
"calm": {
"n": 13,
"held90": 0.92,
"held80": 0.77,
"misses": {
"90": {
"lo": 0,
"hi": 0
},
"80": {
"lo": 0,
"hi": 0
}
}
},
"medium": {
"n": 13,
"held90": 0.92,
"held80": 0.77,
"misses": {
"90": {
"lo": 0,
"hi": 0
},
"80": {
"lo": 0,
"hi": 0
}
}
},
"wild": {
"n": 13,
"held90": 0.92,
"held80": 0.77,
"misses": {
"90": {
"lo": 0,
"hi": 0
},
"80": {
"lo": 0,
"hi": 0
}
}
}
},
"T1": {
"text": "not enough checks yet (40 of 330)",
"n": 40,
"N": 330,
"pass": null
},
"T2": {
"text": "not enough checks yet (40 of 330)",
"n": 40,
"N": 330,
"pass": null
},
"T3": {
"text": "not enough checks yet (40 of 330)",
"n": 40,
"N": 330,
"pass": null
},
"T4": {
"text": "not enough checks yet (40 of 330)",
"n": 40,
"N": 330,
"pass": null
},
"T5": {
"text": "not enough checks yet (40 of 330)",
"n": 40,
"N": 330,
"pass": null
},
"T6": {
"text": "not enough checks yet (40 of 330)",
"n": 40,
"N": 330,
"pass": null
},
"touch_bins": [
{
"p_lo": 0.0,
"p_hi": 0.1,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.1,
"p_hi": 0.2,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.2,
"p_hi": 0.3,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.3,
"p_hi": 0.4,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.4,
"p_hi": 0.5,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.5,
"p_hi": 0.6,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.6,
"p_hi": 0.7,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.7,
"p_hi": 0.8,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.8,
"p_hi": 0.9,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.9,
"p_hi": 1.0,
"checks": 0,
"happened": 0
}
],
"winkler": {
"90": {
"main": null,
"ewma": null,
"ratio_ewma": null,
"naive": null,
"ratio_naive": null
},
"80": {
"main": null,
"ewma": null,
"ratio_ewma": null,
"naive": null,
"ratio_naive": null
}
},
"stale_share": 0.05,
"stale_hidden": 0,
"backtest": {
"90": {
"e": {
"lo": {
"e": 1.0,
"alarm": false
},
"hi": {
"e": 1.0,
"alarm": false
}
},
"kupiec_p": 0.41,
"dq_p": null
},
"80": {
"e": {
"lo": {
"e": 1.0,
"alarm": false
},
"hi": {
"e": 1.0,
"alarm": false
}
},
"kupiec_p": 0.41,
"dq_p": null
}
}
}
}
},
"challengers": [
{
"chain": "ewma",
"label": "shadow, not shown on the trader page",
"assets": [
"BTC",
"XAU"
],
"status": "running",
"by": {
"BTC": {
"24h": {
"n": 40,
"held90": 0.925,
"winkler90": 0.051,
"held80": 0.85,
"winkler80": 0.042,
"main": {
"held90": 0.9,
"winkler90": 0.049,
"held80": 0.775,
"winkler80": 0.041
}
}
}
}
},
{
"chain": "ttm",
"label": "shadow, not shown on the trader page",
"assets": [
"BTC"
],
"status": "waiting",
"text": "waiting: switched off for now, so it is not scored yet"
},
{
"chain": "learned_weights",
"status": "queued",
"label": "shadow, not shown on the trader page",
"name": "learned blend weights",
"starts": 1814486400
}
]
}
GET /v1/evolution
What changed in the models, how it was tested and what came of it, newest first. Updated nightly.
Cache: Cache-Control: public, max-age=3600.
Fields: the envelope, plus entries: [{date, change, test, result, plain}], date as YYYY-MM-DD, and
self_correction: [{asset, horizon, ratio, checks}], one row per asset and horizon with a nightly state.
plainis optional: one plain line about the entry, for a reader who does not read the log's own words. An entry from the research log has it. The nightly's own entries (a frozen hourly share, a nightly check, a drift alarm) are already in plain words and have none.change,testandresultare the record's own words and are never edited.ratiois the published 90% log-width divided by the 90% log-width the plain model quantiles would give, at the nightly fit: above 1 testing on past data widened the range, below 1 it narrowed it.checksis how many settled outcomes the shown chain's learners have seen (null when no chain is shown).ratiois null for gold and silver while they are warming up.
Example response (45 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"entries": [
{
"date": "2027-02-01",
"change": "XAU hourly view: the hourly share is frozen.",
"test": "Computed once from the first 20 trading days of the live gold-api poll. Later prices never change it.",
"result": "The hourly view for XAU uses this share from now on."
},
{
"date": "2026-11-07",
"change": "timing test crypto",
"test": "vqf timing --class crypto, six rules out of sample (prereg docs/research/2026-11-05-timing-test/prereg.md)",
"result": "no_edge",
"plain": "Tested six simple rules for when to buy or sell crypto, on data they had not seen. None showed an edge, so the page gives no buy or sell timing."
}
],
"self_correction": [
{
"asset": "BTC",
"horizon": "24h",
"ratio": 1.0734,
"checks": 412
},
{
"asset": "BTC",
"horizon": "8h",
"ratio": 0.9618,
"checks": 1236
},
{
"asset": "XAU",
"horizon": "24h",
"ratio": null,
"checks": 7
}
]
}
GET /v1/record
The tools' own record: per asset and horizon, checks, held90, held80 and the touch_bins of the touch
chances. Updated nightly. Cache: Cache-Control: public, max-age=3600.
Fields: the envelope, plus one key per asset that has a record, each keyed by horizon.
A cell of an asset whose 8h from-now ranges passed their history test also has the optional now_ fields:
now_windows (settled live 8h windows), now_held90 and now_held80 (the share of those windows' ranges that held,
null while now_windows is 0), and now_history_held90, now_history_held80 and now_history_windows (the same
shares and the window count on history). These are ranges measured from the latest price inside a running 8h window,
tested on history from May 2025 to April 2026. They are a record of past ranges, not a promise about the next one.
A 24h cell of ETH, XRP or SOL, whose from-now chances passed their history test, also has now_bins (10 bins of
{p_lo, p_hi, checks, happened}: the live touch chances from now, scored once each window ended), now_chance_windows
(settled live windows in that record) and now_history_bins (the same bins on the history test, four keys each). The
live record covers the chances a Pro request could be served, from 30 minutes into the window until 30 minutes before
its end; a window whose served tables cannot be reproduced exactly is left out and counted in the scorecard. These are
a record of past chances, not a promise about the next one. Forecast, not financial advice.
Example response (79 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"BTC": {
"24h": {
"checks": 40,
"held90": 0.9,
"held80": 0.775,
"touch_bins": [
{
"p_lo": 0.0,
"p_hi": 0.1,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.1,
"p_hi": 0.2,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.2,
"p_hi": 0.3,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.3,
"p_hi": 0.4,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.4,
"p_hi": 0.5,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.5,
"p_hi": 0.6,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.6,
"p_hi": 0.7,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.7,
"p_hi": 0.8,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.8,
"p_hi": 0.9,
"checks": 0,
"happened": 0
},
{
"p_lo": 0.9,
"p_hi": 1.0,
"checks": 0,
"happened": 0
}
]
}
}
}
GET /v1/facts
Today's short facts about the forecasts, each with its source: a scheduled event inside a forecast window, a
range that is unusually wide or calm against the past year, or a metal market that reopens within the hour. At most
3 per asset. A fact is a short plain statement about today's forecasts, with its source. It never gives a reason for a price move.
Also the scheduled events of the next 7 days. Updated when the facts change. Cache: Cache-Control: public, max-age=3600.
Fields: the envelope, plus:
facts:[{text, source, asset, at}], at most 3 per asset (24 in all).atis the unix second the fact refers to (an event, a reopen), ornull. Times intextare UTC; hide a fact whoseathas passed.upcoming:[{t_utc, name, source_url}], the scheduled events of the next 7 days in time order, at most 10.
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"facts": [
{
"text": "US CPI at 13:30 UTC falls inside today's forecast window.",
"source": "https://www.bls.gov/schedule/news_release/cpi.htm",
"asset": "BTC",
"at": 1830346200
}
],
"upcoming": [
{
"t_utc": "2028-01-05T13:30:00Z",
"name": "US CPI",
"source_url": "https://www.bls.gov/schedule/news_release/cpi.htm"
}
]
}
GET /v1/context
Facts about the past, with no forecast and no lean: where each price sat in its 52-week range, how it related to its
50- and 200-day averages, how its recent swing compared with the past year, and how pairs of assets moved together
over the last 90 days. Updated once a night. Cache: Cache-Control: public, max-age=3600. This endpoint carries its
own disclaimer, because it forecasts nothing: "Facts about the past. Not a forecast. Not financial advice."
Fields: the envelope, plus:
as_of: the last complete UTC day the facts read (YYYY-MM-DD).min_corr_n: a correlation with fewer return pairs than this isnull.assets: one entry per asset with a price history, in the order the page shows them. Each holds:basis:close_00z(crypto: the 00:00 UTC price of each day, from the 24h observations) ordaily_avg(gold, silver and the gold/silver ratio: gold-api's daily average price; a metal's highs and lows are gold-api's daily maximum and minimum where there is one, else the price; the ratio is gold's daily average over silver's, with high and low equal to it). Rows are used as gold-api gives them.source,as_ofanddays_used: where the prices came from, the last day, and how many days were read.ma50andma200:{rel_pct, side}, whererel_pctis 100 times (price over the 50- or 200-day average, minus 1) andsideisabove,below, orat(closer than 0.05 percent). Crypto counts calendar days, metals count trading days.range52w:{position, drawdown_pct, high, low, price}over the past 365 calendar days.positionruns from 0 (at the low) to 1 (at the high).drawdown_pctis 100 times (price over the high, minus 1), never above 0. For crypto the high and low come from the day's traded range, converted the way touch checks are settled.vol_pct: 0 to 100, rounded down. The share of the past 365 days on which the 30-day swing (the root mean square of the last 30 daily log returns) was smaller than on the as-of day.null_reasons: for each statistic that isnull,{have, need}in days. A statistic isnulluntil there is enough history.XAUXAG, the gold/silver ratio, comes last and is an asset like the others (every field above, from the daily ratio), and it also carriesplace: where today's ratio sits in its own daily history (gold-api daily averages, 1970 on). It is written whether or not the asset is shown.place.kind:ratio.share_below: the share of history days (0 to 1, 2 decimals) on which the ratio was below today's.since_year: the first year of the history.low_1yandhigh_1y: the lowest and highest daily ratio of the past 365 days.average: the mean of every daily ratio.as_of: the UTC day of today's ratio.history_as_of: the last day the history reaches.source: the credit line.- Without a usable history (no
GOLDAPI_KEYon the nightly job, a failed fetch, or no day in the last year)placeis{kind: "ratio", reason: "history_unavailable", history_as_of}, wherehistory_as_ofis the last day the cache reached ornull. Without a current ratio it is{kind: "ratio", reason: "ratio_unavailable", history_as_of}. - It publishes ratio figures, a share and a year. It never publishes a series of days.
correlations:[{a, b, window_days, basis, n, r, lo, hi, null_reason}], every pair once.ris the Pearson correlation of daily log returns over the lastwindow_days(90) calendar days,nthe number of return pairs, andlotohian approximate 95 percent interval (Fisher z).basisisclose_00zfor two crypto assets,daily_avgfor two of gold, silver and the ratio, andmid_high_lowfor a crypto with one of them (the crypto's day-midpoint against the metal's daily average, over the metal's rows). A return between two metal rows that are not adjacent days spans the gap. Whenrisnull,null_reasonsays why:too_few_days(fewer thanmin_corr_nreturn pairs) orno_movement(enough days, but one series did not move); it isnullwhen there is a figure. They moved together, or opposite, or showed no clear link. They never show a cause and never a forecast.corr_history: for each pair incorrelations, keyedA|B, rows[date, r, lo, hi], oldest first, a week apart, the last onas_of: the same 90-day correlation read on each of those days (2 decimals). A day with too few return pairs, or with no movement, is[date, null, null, null]. Past facts only; never a cause and never a forecast.weekly: for each asset, keyed by symbol, rows[date, price, ma50, ma200], oldest first, a week apart, the last on the asset's last day (4 decimals). An average isnullwhile its window is short; a day before the first row has anullprice.big_moves: for each asset, keyed by symbol: how many Friday-to-Friday weeks moved at or beyond each of its thresholds (thresholds, percent; the keys ofcounts), up and down apart, fromspan_from, the Friday that starts the first week counted (the first Friday on or after the later of two days: the market's own start, 1975-01-01 for a metal or the ratio and none for a crypto asset, and the first day its daily prices cover).top_upandtop_downare the five biggest weeks of each side, largest first, each with the Friday that ends the week (week) and its move in percent (pct).cluster_shareis the share of big weeks (at or beyond the smallest threshold) that had another big week within 8 weeks, 2 decimals,nullwith no big week. A market whose daily prices have not been checked yet is{"reason": "data_check_pending"}, and one with no full week is{"reason": "too_few_weeks"}. Past facts only; never a cause and never a forecast.
Illustrative figures, not real history.
Example response (254 lines)
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Facts about the past. Not a forecast. Not financial advice.",
"labels": [],
"as_of": "2027-12-31",
"min_corr_n": 30,
"assets": {
"BTC": {
"basis": "close_00z",
"source": "Bitstamp",
"as_of": "2027-12-31",
"days_used": 540,
"ma50": {
"rel_pct": 4.25,
"side": "above"
},
"ma200": {
"rel_pct": -2.5,
"side": "below"
},
"range52w": {
"position": 0.62,
"drawdown_pct": -15.8333,
"high": 120000,
"low": 70000,
"price": 101000
},
"vol_pct": 72,
"null_reasons": {}
},
"SOL": {
"basis": "close_00z",
"source": "Bitstamp",
"as_of": "2027-12-31",
"days_used": 140,
"ma50": {
"rel_pct": 0.02,
"side": "at"
},
"ma200": null,
"range52w": null,
"vol_pct": null,
"null_reasons": {
"ma200": {
"have": 140,
"need": 200
},
"range52w": {
"have": 140,
"need": 329
},
"vol_pct": {
"have": 110,
"need": 329
}
}
},
"XAU": {
"basis": "daily_avg",
"source": "gold-api.com",
"as_of": "2027-12-31",
"days_used": 250,
"ma50": {
"rel_pct": 1.5,
"side": "above"
},
"ma200": {
"rel_pct": 6,
"side": "above"
},
"range52w": {
"position": 0.9,
"drawdown_pct": -1.8519,
"high": 2700,
"low": 2200,
"price": 2650
},
"vol_pct": 15,
"null_reasons": {}
},
"XAUXAG": {
"basis": "daily_avg",
"source": "gold-api.com",
"as_of": "2027-12-31",
"days_used": 250,
"ma50": {
"rel_pct": -1.2,
"side": "below"
},
"ma200": {
"rel_pct": 3.4,
"side": "above"
},
"range52w": {
"position": 0.55,
"drawdown_pct": -9.1,
"high": 93.4,
"low": 71.2,
"price": 84.9
},
"vol_pct": 40,
"null_reasons": {},
"place": {
"kind": "ratio",
"share_below": 0.62,
"since_year": 1970,
"low_1y": 71.2,
"high_1y": 93.4,
"average": 64.8,
"as_of": "2027-12-31",
"history_as_of": "2027-12-31",
"source": "Metal prices: gold-api.com"
}
}
},
"correlations": [
{
"a": "BTC",
"b": "SOL",
"window_days": 90,
"basis": "close_00z",
"n": 90,
"r": 0.8,
"lo": 0.7,
"hi": 0.87,
"null_reason": null
},
{
"a": "BTC",
"b": "XAU",
"window_days": 90,
"basis": "mid_high_low",
"n": 61,
"r": -0.1,
"lo": -0.35,
"hi": 0.15,
"null_reason": null
},
{
"a": "SOL",
"b": "XAU",
"window_days": 90,
"basis": "mid_high_low",
"n": 20,
"r": null,
"lo": null,
"hi": null,
"null_reason": "too_few_days"
}
],
"corr_history": {
"BTC|SOL": [
["2027-12-10", null, null, null],
["2027-12-17", 0.62, 0.41, 0.76],
["2027-12-24", 0.71, 0.55, 0.82],
["2027-12-31", 0.8, 0.66, 0.89]
],
"BTC|XAU": [
["2027-12-10", -0.2, -0.41, 0.04],
["2027-12-17", -0.05, -0.27, 0.18],
["2027-12-24", 0.02, -0.2, 0.24],
["2027-12-31", -0.1, -0.32, 0.13]
],
"SOL|XAU": [
["2027-12-10", null, null, null],
["2027-12-17", null, null, null],
["2027-12-24", null, null, null],
["2027-12-31", null, null, null]
]
},
"weekly": {
"BTC": [
["2027-12-10", 41000.5, null, null],
["2027-12-17", 42250.25, 40100.1234, null],
["2027-12-24", 43010.0, 40800.5, 38900.25],
["2027-12-31", 44120.75, 41500.0, 39200.5]
],
"SOL": [
["2027-12-10", null, null, null],
["2027-12-17", null, null, null],
["2027-12-24", null, null, null],
["2027-12-31", null, null, null]
],
"XAU": [
["2027-12-10", 2310.4, null, null],
["2027-12-17", 2325.1, 2290.5, null],
["2027-12-24", 2331.9, 2298.2, 2180.7],
["2027-12-31", 2340.0, 2305.0, 2190.3]
],
"XAUXAG": [
["2027-12-10", 84.1, null, null],
["2027-12-17", 84.9, null, null],
["2027-12-24", 85.3, 83.2, null],
["2027-12-31", 86.0, 83.9, 80.5]
]
},
"big_moves": {
"BTC": {
"span_from": "2027-01-01",
"thresholds": [10, 20, 30],
"counts": {
"10": { "up": 6, "down": 6 },
"20": { "up": 3, "down": 2 },
"30": { "up": 1, "down": 1 }
},
"top_up": [
{ "week": "2027-02-05", "pct": 34.2 },
{ "week": "2027-05-14", "pct": 28.1 },
{ "week": "2027-08-20", "pct": 22.6 },
{ "week": "2027-03-12", "pct": 15.4 },
{ "week": "2027-10-08", "pct": 11.3 }
],
"top_down": [
{ "week": "2027-06-04", "pct": -31.5 },
{ "week": "2027-09-10", "pct": -24.8 },
{ "week": "2027-04-02", "pct": -18.2 },
{ "week": "2027-11-12", "pct": -12.7 },
{ "week": "2027-07-09", "pct": -10.4 }
],
"cluster_share": 0.58
},
"SOL": { "reason": "too_few_weeks" },
"XAU": {
"span_from": "2027-01-01",
"thresholds": [5, 10, 15],
"counts": {
"5": { "up": 9, "down": 7 },
"10": { "up": 0, "down": 0 },
"15": { "up": 0, "down": 0 }
},
"top_up": [
{ "week": "2027-03-05", "pct": 8.7 },
{ "week": "2027-06-18", "pct": 7.9 },
{ "week": "2027-09-24", "pct": 6.8 },
{ "week": "2027-02-12", "pct": 5.9 },
{ "week": "2027-11-05", "pct": 5.2 }
],
"top_down": [
{ "week": "2027-04-23", "pct": -9.4 },
{ "week": "2027-07-30", "pct": -7.2 },
{ "week": "2027-10-15", "pct": -6.1 },
{ "week": "2027-05-28", "pct": -5.5 },
{ "week": "2027-12-03", "pct": -5.1 }
],
"cluster_share": 0.5
},
"XAUXAG": { "reason": "data_check_pending" }
}
}
GET /v1/schedule
The gold and silver trading hours: open intervals from 2 days ago to 16 days ahead. Updated nightly.
Cache: Cache-Control: public, max-age=3600.
Fields: the envelope, plus intervals: [{open, close}], open at open and closed from close.
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"intervals": [
{
"open": 1830034800,
"close": 1830380400
}
]
}
GET /v1/health
Whether the forecasts you read are being kept up to date: status is ok or degraded. It is degraded only when a price
feed or the nightly run is late (a stale crypto candle, a stale gold or silver price, or a stale nightly state), and then
assets names the symbols that concerns. The nightly run touches every asset, so a late nightly names them all. Every other
thing the operator watches (the audit, the drift check, usage limits, the calendar, the terms dates) never changes this word.
The reply never says why. status describes whether the data flows now: it is ok again as soon as a late feed recovers, even while a page still shows an entry that was made out of date by the price, because that entry clears at the next forecast. Cache: Cache-Control: public, max-age=300.
Fields: the envelope, plus status, and assets: the symbols a degraded word concerns, in the order of /v1/latest; empty
when status is ok. An object served from before this field existed has none: read that as every asset.
{
"api": "v1",
"generated_at": 1830297900,
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"status": "ok",
"assets": []
}
GET /v1/seals
The newest seal of the record. About every hour the Worker seals the forecasts and outcomes written since the last seal (see
"How to check the record" below). Cache: Cache-Control: public, max-age=3600. Before the first seal it answers 503
not_ready.
Fields: the envelope, without generated_at (a seal carries its own sealed_at), plus:
Table: Field, Meaning (5 rows)
| Field | Meaning |
|---|---|
seq |
the number of the newest seal; the first seal is 1 |
format |
the format of the newest seal: which column list rebuilds its leaves from a row (see "The bytes"); 1 today |
head |
the chain head of that seal: 64 lower-case hex digits |
sealed_at |
the Worker's clock time when that seal was written, unix seconds UTC |
days |
the UTC days (YYYY-MM-DD) that have a day file, oldest first |
{
"api": "v1",
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"seq": 3,
"format": 1,
"head": "47f28f33e9f6fa6cda27884875526f1b09052c903dc486bce070f4d462e4a7a3",
"sealed_at": 1793589600,
"days": [
"2026-11-02"
]
}
GET /v1/seals/{day}
The seals written on one UTC day, in order. {day} is a UTC calendar day written YYYY-MM-DD; any other text answers
400 bad_day. A day with no seal answers 404 not_found, and before the first seal the answer is 503 not_ready.
Cache: Cache-Control: public, max-age=3600. Today's file grows as seals are added, so a copy of it can lag behind.
Fields: the envelope, without generated_at, plus day and seals. The example below is an excerpt: it leaves out the
first seal of the day. Each entry of seals is one seal:
Table: Field, Meaning (12 rows)
| Field | Meaning |
|---|---|
seq |
the number of the seal; the first seal is 1 and each seal is one more than the one before |
format |
the format of the seal: which column list rebuilds its leaves from a row (see "The bytes"); 1 today, and never lower than the seal before |
sealed_at |
the Worker's clock time when the seal was written, unix seconds UTC |
f_from, f_to |
the ids of the forecast rows the seal holds, first and last; f_to is f_from - 1 when it holds none |
o_from, o_to |
the same for outcome rows, by row number |
n |
how many leaves the seal holds: the forecast rows plus the outcome rows |
leaves_hex |
the leaves joined, 64 hex digits each: the forecasts first, then the outcomes |
rows_digest |
the SHA-256 of the leaves joined, as 64 hex digits |
prev_head |
the head of the seal before this one; 64 zeros for the first seal |
head |
the head of this seal |
stamped |
1 when FreeTSA's time-stamp of head is in tsr_b64; 0 when the time-stamp did not arrive |
tsr_b64 |
only when stamped is 1: FreeTSA's answer for head (a .tsr file) in base64 |
A seal holds hashes, counts, ids and times. It holds no row.
Example response (42 lines)
{
"api": "v1",
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [],
"day": "2026-11-02",
"seals": [
{
"seq": 2,
"format": 1,
"sealed_at": 1793586000,
"f_from": 3,
"f_to": 3,
"o_from": 2,
"o_to": 1,
"n": 1,
"leaves_hex": "d2a66ad00fc64cd399c5c2cfa24fea0042914a2773da88c4c9bf5ab9c7ce7c2d",
"rows_digest": "918591e15b651c899562546f343727502ce11fdf4f589005e6b17ae9e9c32634",
"prev_head": "a98435c861bb39fb03aff2a4b88207670de8539e31ba51a1de94da87839e804e",
"head": "0652aa77f509629a52d54eee38712b33856c6871ac53fd385bff0af37d03a89d",
"stamped": 0
},
{
"seq": 3,
"format": 1,
"sealed_at": 1793589600,
"f_from": 4,
"f_to": 3,
"o_from": 2,
"o_to": 2,
"n": 1,
"leaves_hex": "94df4e8f81790274923e6db7fb3d21f4a4e5fb2d1fb40ba05c861400e7b3725b",
"rows_digest": "038040506134ffe3d42130a9b7376dbebb1858d782776a041328736c1879b0a5",
"prev_head": "0652aa77f509629a52d54eee38712b33856c6871ac53fd385bff0af37d03a89d",
"head": "47f28f33e9f6fa6cda27884875526f1b09052c903dc486bce070f4d462e4a7a3",
"stamped": 0
}
]
}
Pro endpoints
Everything under /v1/pro/ is gated. It is never in a public endpoint, a public snapshot or the widget kit. Send a bearer
credential: Authorization: Bearer <token>. Without one, or with a credential that is wrong, expired or made for another
key, every request gets the same answer, so a response never says which part failed:
{
"error": "unauthorized"
}
The status is 401. A gated response is never cached (Cache-Control: private, no-store, Vary: Authorization, Origin)
and has no ETag. A browser may call it only from the desk's own site (CORS allows that origin alone, never *, and the
OPTIONS preflight is answered for it). Only GET and OPTIONS are accepted; any other method is 405. With a valid
credential, a path that does not exist under /v1/pro/ is 404 not_found.
whoami: /v1/pro/whoami
Says which entitlement the credential holds. tier is owner, pro or api; exp is the UTC second the credential
ends, or null when it does not end.
{
"api": "v1",
"tier": "pro",
"exp": 1830297600
}
from now: /v1/pro/fromnow/{asset}/24h
The table behind the 24h chances from now: the past windows' remaining moves, measured from the same point of the day as
now, in units of each window's own sigma, sorted ascending. t is the running window's start and k the seconds from it
to the latest 30-minute checkpoint; n is how many past windows the table holds. touch_up and touch_dn hold each past
window's largest remaining move up and down, end_up and end_dn where each past window ended, each as a plain list of
numbers. The tables are built once a night and are read only here.
{
"api": "v1",
"asset": "ETH",
"h": "24h",
"t": 1830211200,
"k": 5400,
"n": 3,
"touch_up": [0.1, 0.5, 1.5],
"touch_dn": [0.2, 0.7],
"end_up": [0.3, 0.9, 1.1, 2],
"end_dn": [0.4]
}
A request with no table to give is 404:
{"error": "not_available"}: the asset has no from-now chances, or they were switched off (thenoffcarries the UTC date, such as"2027-03-02").{"error": "not_ready"}: there is no table for the running window and checkpoint yet, which includes the first 30 minutes of a window and the time from when 30 minutes or less are left.{"error": "not_found"}: any other asset name or horizon.
The answer is never cached (Cache-Control: no-store).
Errors
Every error is JSON with error and the envelope (no generated_at), and Cache-Control: no-store.
The gated paths under /v1/pro/ and /v1/owner/ are the exception: their errors carry no envelope and use
Cache-Control: private, no-store, as "Pro endpoints" says.
Table: Status, error, When (8 rows)
| Status | error |
When |
|---|---|---|
| 400 | bad_path |
the path holds .., an encoded slash or backslash (%2F, %5C), or bad percent-encoding |
| 400 | bad_horizon |
{h} is not 24h or 8h |
| 400 | bad_day |
{day} is not a real UTC calendar day written YYYY-MM-DD |
| 404 | unknown_asset |
{asset} is not in the asset table |
| 404 | not_found |
no such route (there is no history route), or {day} is a day with no seal |
| 405 | method_not_allowed |
any method but GET |
| 500 | server_error |
the API could not read the route's object from storage; no ETag |
| 503 | not_ready |
the route's object has not been written yet (before the first forecast, nightly run or seal); no ETag |
{
"error": "unknown_asset",
"api": "v1",
"credits": [
"Price data: Bitstamp",
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": []
}
{
"error": "not_ready",
"api": "v1",
"credits": [
"Metal prices: gold-api.com"
],
"disclaimer": "Forecast, not financial advice.",
"labels": [
"in_testing",
"beta"
]
}
How to check the record
The Worker seals the forecasts and outcomes it wrote since the last seal, about every hour. It tries from 25 minutes past, for 15 minutes. If a job runs in a minute, or the health check, or an alert for a missed forecast, the seal waits for the next minute that has none. A seal can come later than that, or be skipped for an hour, while jobs are running or failing. The next hour's seal then covers the rows of both hours. If it wrote no row since the last seal, it makes no seal. A seal holds at most 100 leaves, one for each row it covers. When more rows are waiting, the rest go into the next seals, at most one an hour, in order. A seal is made of hashes, counts, ids and times. It holds no row.
Then the Worker asks FreeTSA, an outside time-stamp service (RFC 3161), to sign the seal's head together with FreeTSA's
own clock time. Only the head is sent: 32 bytes, never a row. When the answer arrives, the seal is
time-stamped by FreeTSA, an outside service, and it is published with stamped 1 and the answer in tsr_b64.
When it does not arrive, the seal is still written, with stamped 0. The next time-stamped seal covers it, because every head includes the head
before it.
The seals are at GET /v1/seals and GET /v1/seals/{day}.
What a seal shows
- By the time in a time-stamp, the seal's head existed. The head includes every head before it, so the seals before it
existed by then too, the ones with
stamped0 as well. - A seal fixes the rows in it. A row that is changed afterwards no longer gives the leaf that the seal holds.
- A seal that is changed, left out or moved no longer fits the seals around it. The script below names it.
- A row's seal time is the latest it could have been written: it was in the record by then. The seal does not show how long before. So a row added later carries a later seal.
What a seal does not show
- It does not show that a forecast was right. The record of that is
GET /v1/record. - It does not show what a row holds. The seal files have no row, so you can only check a row that you were given.
- It does not show that every row the model computed was written. Only a row written to the Worker's database is sealed.
- A row written after the newest seal is not in a seal yet. That is usually less than an hour, and longer while jobs are running or failing.
sealed_atis the Worker's own clock. Only the time in a FreeTSA time-stamp comes from an outside service.- The Worker that writes the seals also writes the rows. A time-stamp shows by when a head existed, not who wrote it.
- The script below cannot tell the real files from a chain that was rebuilt in full. A time-stamp that you saved earlier can: the rebuilt heads are different, so the saved time-stamp does not verify for them.
- FreeTSA is a free service that promises no uptime. In an hour when it does not answer,
stampedis 0.
The bytes
Each seal has a format. It says which column list rebuilds the leaves from a row. The columns below are the columns
of format 1. format is not part of the leaf or the head, so the number does not change a hash. A column added later
gets a new format with its own list, and the list of format 1 stays as it is. A seal never has a lower format than the
seal before it.
A leaf is
SHA-256(kind || 0x00 || canonical(row)).kindis one byte: the ASCII letterffor a forecast row,ofor an outcome row.canonical(row)is every stored column of the row, in the order below. Each value is a tag byte and a body:- INTEGER: 0x01, then 8 bytes, two's complement, big-endian.
- REAL: 0x02, then 8 bytes, an IEEE-754 binary64, big-endian. A negative zero is written as zero.
- TEXT: 0x03, then 4 bytes of length, big-endian, then the UTF-8 bytes.
- NULL: 0xFF alone.
The tag comes from the type the column has in the table, not from the value.
Forecast columns, in order:
id(INTEGER),asset(TEXT),horizon(TEXT),t(INTEGER),chain(TEXT),s2(REAL),q05(REAL),q10(REAL),q90(REAL),q95(REAL),off_90_lo(REAL),off_90_hi(REAL),off_80_lo(REAL),off_80_hi(REAL),lo90(REAL),hi90(REAL),lo80(REAL),hi80(REAL),thr_lo90(REAL),thr_hi90(REAL),thr_lo80(REAL),thr_hi80(REAL),p0(REAL),touch_json(TEXT),features_json(TEXT),member_s2_json(TEXT),fit_day(INTEGER),fit_stale(INTEGER),model_version(TEXT),setup_hash(TEXT),checks(INTEGER),why_json(TEXT),status(TEXT),shown(INTEGER),computed_by(TEXT),created_at(TEXT).Outcome columns, in order:
asset(TEXT),horizon(TEXT),t(INTEGER),ot(INTEGER),p1(REAL),r(REAL),z(REAL),miss90(INTEGER),miss80(INTEGER),chains_json(TEXT),computed_by(TEXT),created_at(TEXT). The outcome's row number is not a column of the leaf; it only places the row in a range.rows_digestisSHA-256(leaf_1 || ... || leaf_n): the forecasts first, then the outcomes, each in id order.headisSHA-256(prev_head || rows_digest || seq || sealed_at).prev_headis the 32 bytes of the head before.seqandsealed_atare unsigned 8-byte integers, big-endian. The first seal'sprev_headis 32 zero bytes.A seal holds the forecast rows with
f_from <= id <= f_toand the outcome rows with a row number fromo_fromtoo_to. A range with no row hastoequal tofrom - 1. The next seal starts right after: itsf_fromis the lastf_toplus 1, and the same foro_from.
Step 1: check the chain
Get GET /v1/seals, then get GET /v1/seals/{day} for every day in days, oldest first. Save each as
YYYY-MM-DD.json. Run this with Python 3, giving the files in that order. It uses only the standard library.
# python3 check_seals.py 2026-11-02.json 2026-11-03.json
import base64, hashlib, json, struct, sys
if len(sys.argv) < 2:
sys.exit("give the day files, oldest first")
prev_head, prev_seq, f_to, o_to, fmt, broken = bytes(32), 0, 0, 0, 1, False
for path in sys.argv[1:]:
for s in json.load(open(path))["seals"]:
leaves = bytes.fromhex(s["leaves_hex"])
digest = hashlib.sha256(leaves).digest()
head = hashlib.sha256(bytes.fromhex(s["prev_head"]) + digest + struct.pack(">QQ", s["seq"], s["sealed_at"])).hexdigest()
rows = (s["f_to"] - s["f_from"] + 1) + (s["o_to"] - s["o_from"] + 1)
ok = (
s["seq"] == prev_seq + 1
and s["format"] >= fmt
and s["prev_head"] == prev_head.hex()
and s["rows_digest"] == digest.hex()
and s["head"] == head
and s["f_from"] == f_to + 1 and s["o_from"] == o_to + 1
and s["f_to"] >= s["f_from"] - 1 and s["o_to"] >= s["o_from"] - 1
and s["n"] == rows and len(leaves) == 32 * rows
)
line = f'{s["seq"]} {"ok" if ok else "BROKEN"}'
if s["stamped"] == 1:
open(f'{s["seq"]}.tsr', "wb").write(base64.b64decode(s["tsr_b64"]))
line += f' head {s["head"]} time-stamp saved as {s["seq"]}.tsr'
print(line)
broken = broken or not ok
prev_seq, prev_head, f_to, o_to, fmt = s["seq"], bytes.fromhex(s["head"]), s["f_to"], s["o_to"], s["format"]
sys.exit(1 if broken else 0)
It prints one line per seal: ok, or BROKEN for a seal that does not fit the one before it. For each time-stamped
seal it saves FreeTSA's answer as <seq>.tsr and prints the head.
Step 2: check a time-stamp
Download FreeTSA's two certificates from FreeTSA's own website. These links were read on 2026-11-14:
https://freetsa.org/files/cacert.pemhttps://freetsa.org/files/tsa.crt
Then take a time-stamped seal, for example seal 3, and use the head the script printed for it:
openssl ts -verify -digest <head> -in 3.tsr -CAfile cacert.pem -untrusted tsa.crt
openssl ts -reply -in 3.tsr -text
The first command prints Verification: OK when the signature is FreeTSA's and the time-stamp is for that head. It may
also warn that tsa.crt is not a CA certificate; that is expected. The second prints the Time stamp: line: the time
FreeTSA signed, in GMT.
Step 3: check a row
If you hold a row's stored values, write its bytes as above, take the SHA-256, and look for the 64 hex digits in
leaves_hex of the seals. A forecast row's id names its seal: the one whose f_from to f_to holds it. A row whose
leaf is in no seal is not sealed.
For maintainers
- The stored objects follow the client package's v1 schemas. Whenever a v1 schema gains a required field,
bump
PUBLIC_SCHEMA_VERSIONinworkers/live/src/snapshots.tsand teach its upgrade step to fill that field. - The first scheduled tick that finds an older version in the status marks rewrites every stored object that lacks a required field, with honest values only: the engine's value stored in D1, the value the producer itself would write, or null where the schema allows it; never a made-up number. It then stores the new version with the marks. At the current version the step reads and writes nothing.
- Objects are served exactly as stored: the API never changes them on read. A cache may still hold an object from
before an upgrade until its
max-ageruns out.