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.jsonanddocs/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.
| Field | Type | Notes |
|---|---|---|
slug, symbol | string | The instrument's slug and its display label |
range | string | Echoes the requested 1D, 1W, 1M or 1Y (default 1M) |
granularity | string | daily or monthly; a 1D range still carries daily fixes and says so |
period | string or null | What the newest point describes: a day (2026-11-11) or a month (2026-10) |
change_basis | string | day or month: what one step of a change on this series spans |
session | string or null | open/closed on a daily series, null monthly |
points | array | {t: YYYY-MM-DD, c: number}, oldest first; a 1D range is the last two fixes |
stale, age_days | bool, int or null | Staleness of the newest observation; age_days is null only when the series is empty |
source, source_url, licence | string | Attribution the renderer must print beside the chart |
note | string, optional | Provenance wording in English; absent or empty when the source publishes none |
note_zh | string, optional | The same wording in Chinese; absent or empty means the English note stands |
detail | string or null | null on a series, otherwise why the series is empty |
404 {"error":"unknown_symbol","detail":"no instrument named '<symbol>'"}for a{symbol}that is not an instrument;400 {"error":"bad_range","detail":"range must be one of 1D, 1W, 1M, 1Y"}for an unknownrange; an empty series is a200withdetailset, because "the provider is down" is not a client error.- Carries no
ETagby design (§2.1) and answers503with adetailwhen the store is unreadable.
Description: docs/API.md §12
Parameters
| Name | In | Required | Type | Example | Notes |
|---|---|---|---|---|---|
symbol | path | yes | string | eurusd | |
range | query | no | string | 1D, 1W, 1M or 1Y |
Example request
curl -sS \
'https://vg.tempproject.online/v1/site/markets/eurusd/history'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])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
{
"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.