Skip to content

Historical.metadata.get_record_count

POST/v0/metadata.get_record_countPython · HTTP

How many records a get_range request would return, to size it before running it.

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 = "trades"

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

int

The number of records.

API method
Historical.metadata.get_record_count(
    dataset: str,
    start: str | int | date,
    end: str | int | date | None = None,
    symbols: Iterable[str] | str = "ALL_SYMBOLS",
    schema: str = "trades",
    limit: int | None = None,
) -> int
Example usage
1
2
3
4
5
6
7
8
9
import briskapi

client = briskapi.Historical()
print(client.metadata.get_record_count(
    dataset="XTKS.BRISKDEMO",
    symbols=["7203"],
    schema="trades",
    start="2021-09-27",
))
1
2
3
4
5
6
7
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/metadata.get_record_count' \
  -u "$BRISK_KEY:" \
  -d dataset=XTKS.BRISKDEMO \
  -d symbols=7203 \
  -d schema=trades \
  -d start=2021-09-27
Example responseCaptured from the demo
312
312