Skip to content

Historical.timeseries.get_range (bars)

POST/v0/timeseries.get_rangePython · HTTP · CLI

OHLCV bars: one row per security and interval with trades, open to close. For XTKS.BRISK they are built ahead from your own live recordings, and you receive a bar only when your recordings cover that security and the bar's whole span within the trading sessions (09:00–11:30, 12:30–15:30 JST). The demo's are open to everyone.

Parameters

dataset str required

XTKS.BRISK (your own live recordings) or XTKS.BRISKDEMO (the public demo, open to every identity).

start str | int | date required

The inclusive start. An ISO 8601 time (JST unless it names a zone), a date (that trading day, from JST midnight) or UTC nanoseconds.

end str | int | date | None optional

The exclusive end, in the same forms. Default: the end of the start's trading day. At most 31 days after start; both between 2000 and 2100.

symbols Iterable[str] | str optional = "ALL_SYMBOLS"

Up to 2,000 JPX codes ("7203", "167A"), as a list or comma-separated. Default "ALL_SYMBOLS".

schema str optional = "ohlcv-1m"

trades (default), mbp-10, definition, imbalance, brisk-quotes or ohlcv-1s, ohlcv-1m, ohlcv-1h, ohlcv-1d. See Data format.

limit int | None optional

The most records to return, after time-ordering.

Returns

DataStore

A DataStore of bars: ts_event (the bar's start), open, high, low, close (yen), volume (shares).

API method
Historical.timeseries.get_range(
    dataset: str,
    start: str | int | date,
    end: str | int | date | None = None,
    symbols: Iterable[str] | str = "ALL_SYMBOLS",
    schema: str = "ohlcv-1m",   # ohlcv-1s, ohlcv-1h, ohlcv-1d
    limit: int | None = None,
) -> DataStore
Example usage
import briskapi

client = briskapi.Historical()
bars = client.timeseries.get_range(
    dataset="XTKS.BRISKDEMO",
    symbols=["7203", "6758"],
    schema="ohlcv-1m",
    start="2021-09-27",
)
print(bars.to_df(tz="Asia/Tokyo"))
1
2
3
4
5
6
7
8
export BRISK_KEY=$(brisk identity --export)   # your archive identity is the API key
curl -X POST 'https://h2dxahfcj6436nlf3y255exu6e0omhrk.lambda-url.ap-northeast-1.on.aws/v0/timeseries.get_range' \
  -u "$BRISK_KEY:" \
  -d dataset=XTKS.BRISKDEMO \
  -d symbols=7203,6758 \
  -d schema=ohlcv-1m \
  -d start=2021-09-27 \
  -d encoding=csv
brisk query XTKS.BRISKDEMO --schema ohlcv-1m --symbols 7203,6758 --start 2021-09-27
Example responseCaptured from the demo
                           publisher_id  instrument_id     open     high      low    close  volume symbol
ts_event
2021-09-27 09:00:00+09:00             2           6758  13190.0  13200.0  13070.0  13115.0  297600   6758
2021-09-27 09:00:00+09:00             2           7203  10155.0  10175.0  10150.0  10175.0  342300   7203
2021-09-27 09:01:00+09:00             2           6758  13105.0  13110.0  13050.0  13080.0   73400   6758
2021-09-27 09:01:00+09:00             2           7203  10175.0  10230.0  10175.0  10220.0  177700   7203
2021-09-27 09:02:00+09:00             2           6758  13085.0  13110.0  13075.0  13080.0   92200   6758
2021-09-27 09:02:00+09:00             2           7203  10230.0  10245.0  10225.0  10240.0   49100   7203
"ts_event","publisher_id","instrument_id","open","high","low","close","volume","symbol"
"2021-09-27T00:00:00.000000000Z",2,6758,13190,13200,13070,13115,297600,"6758"
"2021-09-27T00:00:00.000000000Z",2,7203,10155,10175,10150,10175,342300,"7203"
"2021-09-27T00:01:00.000000000Z",2,6758,13105,13110,13050,13080,73400,"6758"
"2021-09-27T00:01:00.000000000Z",2,7203,10175,10230,10175,10220,177700,"7203"
"2021-09-27T00:02:00.000000000Z",2,6758,13085,13110,13075,13080,92200,"6758"
"2021-09-27T00:02:00.000000000Z",2,7203,10230,10245,10225,10240,49100,"7203"
"ts_event","publisher_id","instrument_id","open","high","low","close","volume","symbol"
"2021-09-27T00:00:00.000000000Z",2,6758,13190,13200,13070,13115,297600,"6758"
"2021-09-27T00:00:00.000000000Z",2,7203,10155,10175,10150,10175,342300,"7203"
"2021-09-27T00:01:00.000000000Z",2,6758,13105,13110,13050,13080,73400,"6758"
"2021-09-27T00:01:00.000000000Z",2,7203,10175,10230,10175,10220,177700,"7203"
"2021-09-27T00:02:00.000000000Z",2,6758,13085,13110,13075,13080,92200,"6758"
"2021-09-27T00:02:00.000000000Z",2,7203,10230,10245,10225,10240,49100,"7203"