Skip to content

Querying your archive in the cloud

Uploads also give you a cloud API over your own recordings, shaped like Databento's historical API (the same names and parameters). Your archive identity is the API key: there is no signup and no key to create, and briskapi.Historical() finds your identity the way uploads do (and makes one if you have none).

import briskapi

client = briskapi.Historical()
trades = client.timeseries.get_range("XTKS.BRISK", start="2026-10-13", end="2026-10-17",
                                     symbols=["7203"], schema="trades")
trades.to_df()      # a pandas DataFrame indexed by ts_recv; also to_ndarray(), to_csv(), to_json(), to_parquet(), replay()
client.timeseries.get_range("XTKS.BRISK", start="2026-10-13", symbols=["7203"],
                            schema="ohlcv-1m").to_df()     # 1-minute bars (see below)
client.timeseries.get_range("XTKS.BRISKDEMO", start="2021-09-27T08:59", end="2021-09-27T09:03",
                            symbols=["7203"], schema="imbalance")    # the demo, for any identity
client.metadata.get_dataset_condition("XTKS.BRISK", start_date="2026-10-01")   # each date and the clock windows you recorded

get_range(dataset, start, end=None, symbols='ALL_SYMBOLS', schema='trades', limit=None, path=None) returns a store; path also writes its Parquet file. client.metadata has list_datasets(), list_schemas(dataset), list_fields(schema), list_publishers(), get_dataset_range(dataset), get_dataset_condition(dataset, start_date, end_date) (each date available or missing, and the clock windows your recordings cover, in JST), get_record_count(...) and get_cost(...). get_cost is always 0: the cloud API is free, with quotas of 60 requests a minute and 2 GB a day per identity, and 120 requests a minute and 4 GB a day per IP address.

  • Datasets follow Databento's VENUE.FEED naming (XTKS is the Tokyo Stock Exchange). XTKS.BRISK is your own live recordings, whichever broker's BRiSK they came through. XTKS.BRISKDEMO is the public demo (2021-09-27), open to every identity.
  • Schemas: trades; mbp-10 (ten levels per side; BRiSK gives books, not order events, so action and side are N); definition; imbalance (opening and closing auction state: indicative price and volume, market-order imbalance); brisk-quotes (every BRiSK quote field); and the OHLCV bars ohlcv-1s, ohlcv-1m, ohlcv-1h and ohlcv-1d. list_fields(schema) lists a schema's columns.
  • Times: a date means that JST trading day, a time without a zone is JST and an integer is UTC nanoseconds. end is exclusive and defaults to the end of the start's trading day. A request covers at most 31 days and 2,000 symbols.
  • Symbols are JPX codes. instrument_id is fixed per code: digits-only codes are their number (7203), others are 100,000 plus the code's base-36 value (167A is 154694).

Historical's OHLCV bars come only from the cloud, never from files on your computer (Live builds them from the stream). The archive builds your bars for each trading day from your own current live recordings of that day, counting each trade once, whenever you upload, delete or restore one, so a query reads them ready-made. They hold the bars your recordings cover: the security, and the bar's whole span within the trading sessions (09:00 to 11:30 and 12:30 to 15:30 JST). A recording from 08:55 to 11:31, for example, gets the morning's 1-minute and 1-hour bars but not the day bar. So uploading is how you get bars. No one else's uploads enter yours, and yours enter no one else's. (XTKS.BRISKDEMO's bars are built from the demo's own trades.) See PRIVACY.md (policy version 8). Ticker.candles() is something else: BRiSK's own bars from your broker, which need a broker login.

On the command line, brisk query writes CSV to stdout. --encoding json or parquet changes that (Parquet needs --output FILE), --output FILE writes a file instead, and --end and --limit bound the request:

brisk query XTKS.BRISK --schema ohlcv-1m --symbols 7203 --start 2026-10-13 > toyota-1m.csv

The HTTP API behind both is described in docs/cloud-api.md. The same records stream live, from the feed on your computer, through briskapi.Live (above).