Cabinhub News API v1.0.0

Docs / Markets

Markets

Markets

GET/v1/site/markets
Auth
none
Cache-Control
public, max-age=120, stale-while-revalidate=300, stale-if-error=1200
Source of truth
clients/openapi.json and docs/API.md §12

The instrument strip behind the newsroom's markets module: one row per instrument with its last price, its change and the facts a renderer prints beside them (period, change_basis, session, cadence, stale, age_days), plus the attribution list the page must show.

Captured from the live route on 2026-11-12. The second row's spark is cut to ten points for this page; the wire carries the full series. sources lists every attribution the strip can draw from; the excerpt above shows one.

Description: docs/API.md §12

Parameters

None. This route takes no path or query parameters.

Example request

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

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


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",
  {
    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
{
  "status": "ok",
  "as_of": "2026-11-12T00:00:00Z",
  "delayed": true,
  "detail": null,
  "items": [
    {
      "slug": "eurusd",
      "symbol": "EUR/USD",
      "kind": "fx",
      "price": 1.1127,
      "change": -0.0087,
      "change_pct": -0.7758,
      "as_of": "2026-11-11T00:00:00Z",
      "cadence": "daily",
      "period": "2026-11-11",
      "change_basis": "day",
      "change_from": "2026-11-10T00:00:00Z",
      "session": "open",
      "delayed": true,
      "stale": false,
      "age_days": 1,
      "decimals": 4,
      "unit": "",
      "spark": [1.1298, 1.1225, 1.1204, 1.1269, 1.1177, 1.1186, 1.1206, 1.1181,
                1.1188, 1.1195, 1.1208, 1.1253, 1.1225, 1.1215, 1.1234, 1.1205,
                1.1193, 1.1188, 1.115, 1.1133, 1.113, 1.1172, 1.1216, 1.1179,
                1.1267, 1.1224, 1.1165, 1.1193, 1.1214, 1.1127],
      "source": "ECB reference rate",
      "source_url": "https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html",
      "licence": "ECB reference rates, free to use with acknowledgement",
      "note": "",
      "note_zh": ""
    },
    {
      "slug": "usdjpy",
      "symbol": "USD/JPY",
      "kind": "fx",
      "price": 159.23429495820977,
      "change": 1.057017,
      "change_pct": 0.6682,
      "as_of": "2026-11-11T00:00:00Z",
      "cadence": "daily",
      "period": "2026-11-11",
      "change_basis": "day",
      "change_from": "2026-11-10T00:00:00Z",
      "session": "open",
      "delayed": true,
      "stale": false,
      "age_days": 1,
      "decimals": 2,
      "unit": "",
      "spark": [157.983714, 157.674833, 158.229204, 158.088562, 158.226716,
                158.278205, 158.254507, 158.59941, 158.124777, 158.454667],
      "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": "由欧洲央行同日欧元汇率换算的交叉盘。"
    }
  ],
  "sources": [
    {
      "name": "ECB reference rate",
      "url": "https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html",
      "licence": "ECB reference rates, free to use with acknowledgement"
    }
  ]
}

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

Failures

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