Cabinhub News API v1.0.0

Docs / Markets History

Markets History

Markets History

GET/v1/site/markets/{symbol}/history
Auth
none
Cache-Control
public, max-age=600, stale-while-revalidate=300, stale-if-error=3600 (200); no-store on 400/404
Source of truth
clients/openapi.json and docs/API.md §12

The series behind one instrument's chart. {symbol} is an instrument slug (site_markets.INSTRUMENTS), not a pair spelling: eurusd, not eur-usd.

Captured from the live route on 2026-11-12; points is the last five of the range for this page.

FieldTypeNotes
slug, symbolstringThe instrument's slug and its display label
rangestringEchoes the requested 1D, 1W, 1M or 1Y (default 1M)
granularitystringdaily or monthly; a 1D range still carries daily fixes and says so
periodstring or nullWhat the newest point describes: a day (2026-11-11) or a month (2026-10)
change_basisstringday or month: what one step of a change on this series spans
sessionstring or nullopen/closed on a daily series, null monthly
pointsarray{t: YYYY-MM-DD, c: number}, oldest first; a 1D range is the last two fixes
stale, age_daysbool, int or nullStaleness of the newest observation; age_days is null only when the series is empty
source, source_url, licencestringAttribution the renderer must print beside the chart
notestring, optionalProvenance wording in English; absent or empty when the source publishes none
note_zhstring, optionalThe same wording in Chinese; absent or empty means the English note stands
detailstring or nullnull on a series, otherwise why the series is empty

Description: docs/API.md §12

Parameters

NameInRequiredTypeExampleNotes
symbolpathyesstringeurusd
rangequerynostring1D, 1W, 1M or 1Y

Example request

curl
Shell
curl -sS \
  'https://vg.tempproject.online/v1/site/markets/eurusd/history'
Python, standard library only
Python
import json
import os
import urllib.request

URL = "https://vg.tempproject.online/v1/site/markets/eurusd/history"


def call() -> dict:
    req = urllib.request.Request(URL, headers={})
    with urllib.request.urlopen(req, timeout=15) as res:
        print(res.status, res.headers.get("ETag"))
        return json.loads(res.read().decode("utf-8"))


if __name__ == "__main__":
    body = call()
    print(json.dumps(body, indent=2, ensure_ascii=False)[:2000])
TypeScript, Node 18+, no dependencies
TypeScript
const res = await fetch(
  "https://vg.tempproject.online/v1/site/markets/eurusd/history",
  {
    method: "GET",
    headers: {},
  },
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());

The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.

Example response

Response body
JSON
{
  "slug": "usdjpy",
  "symbol": "USD/JPY",
  "range": "1M",
  "granularity": "daily",
  "delayed": true,
  "as_of": "2026-11-11T00:00:00Z",
  "period": "2026-11-11",
  "change_basis": "day",
  "session": "open",
  "points": [
    {"t": "2026-11-05", "c": 158.455096},
    {"t": "2026-11-06", "c": 158.325123},
    {"t": "2026-11-09", "c": 157.946931},
    {"t": "2026-11-10", "c": 158.177278},
    {"t": "2026-11-11", "c": 159.234295}
  ],
  "stale": false,
  "age_days": 1,
  "source": "ECB reference rate (cross)",
  "source_url": "https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html",
  "licence": "Derived from ECB reference rates; free to use with acknowledgement",
  "note": "Cross computed from the ECB's EUR legs on the same date.",
  "note_zh": "由欧洲央行同日欧元汇率换算的交叉盘。",
  "detail": null
}

Response example in docs/API.md §12 (GET /v1/site/markets/{symbol}/history)

Failures

This operation can answer 200, 400, 404, 422, 429, 503. The full envelope for each status, with its body, is on Errors.