Skip to content

Your broker's BRiSK

The same client serves SBI Securities' BRiSK (sbi.brisk.jp, the default site) and those of Tachibana e-shiten, Matsui, Monex and SMBC Nikko (subsections follow); you need a BRiSK subscription with the broker. For SBI, log in on sbi.brisk.jp in your browser, then pass its session cookies: copy them from DevTools, or use pycookiecheat's chrome_cookies("https://sbi.brisk.jp"). Or let briskapi sign in with your passkey (below).

briskapi.login(cookies={"session_bfaf77a2": "v2.local..."})   # remember=True saves them (owner-only file)
toyota = briskapi.Ticker("7203")
toyota.candles("5m").to_pandas()   # price bars: 5m (today), 1d, 1w or 1mo
toyota.margin(days=30)             # margin balances and stock-lending fees
market = briskapi.Market()
market.turnover()     # turnover and shares outstanding, all stocks
market.lists()        # NK225, recent IPOs, …
market.events()       # basket orders, limit up/down, volume surges
market.schedule()     # trading date, status and session times
market.watchlist()    # your saved codes

feed = briskapi.connect(site="sbi", codes=["7203"])   # live; each session uploaded unless you opt out
toyota.quote()                              # same calls as any feed
# upload_market_data=False uploads no market recordings, upload=False nothing; output="days" keeps each day

A broker feed records continuously and keeps running across days. It normally packages and uploads each day in two recordings, the morning session's once the lunch break begins and the afternoon's (starting from a snapshot of the book where the morning's ended) at the day's end; a busy session is split again at 80 million quote rows, at the next completed spool part. In the cloud API they read as one day. When the site's session is done or it starts serving the next trading date (checked every 10 minutes), or the server closes the stream after the market, the day ends: its last recording is packaged and uploaded, with the day's timing summary (unless you opt out), while the feed waits for the next session and records it from a fresh snapshot. Started when no session is running (after the close, on a holiday), the feed waits for the next trading day's: connect() returns once that day has begun (feed.status is "waiting" meanwhile). Brokers end their sessions at 05:00 each morning, so a feed that waits overnight keeps waiting once its session has expired (it says the session has expired; waiting for new cookies) and takes up the cookies of a brisk login you make after, with no restart. If a passkey is saved for that broker (brisk enroll), the feed signs in again itself, as brisk login does (Chrome opens): up to four tries over the next hour and forty minutes, then it leaves it to you. Each broker has a passkey of its own, so with two brokers' feeds each signs in with its own; a feed whose broker has none says how to sign in. output=DIR (briskapi.connect(output=...), brisk live --output DIR) also keeps each recording in DIR, in a folder named SITE_YYYYMMDD_FROM-TO (its broker's site and its first and last source clock, JST HHMMSS), such as sbi_20261013_085800-113000; every broker's recordings are the same source, brisk_live, as all carry BRiSK's same market data, and the folder names say which broker each came through, so two recording the same session (to compare them) never meet. feed.recordings lists them (trading_date, name, path, uploaded, timing_uploaded, the timing summary's on a day's last, repaired, and error: what failed, packaging or upload), and on_day=callback is called for each. Without output, a recording is kept only in your archive, and with uploads off, nowhere. Stopping the feed (feed.close(), Ctrl-C) ends the day there, so what is left of it is kept and uploaded like any recording; a lost connection reconnects by itself (Recording). SBI and e-shiten allow one BRiSK session per user (expect the same of the others): close BRiSK in your browser before you start the feed, or the two cut each other off within seconds.

Results use the conventions below. Errors are briskapi.brisk.SessionExpiredError (log in again), briskapi.NotFoundError, briskapi.brisk.RateLimitError and briskapi.brisk.APIError. Requests are limited to one per second.

The live feed runs BRiSK's own decoder under Node, downloaded with your session; no browser is involved. It follows the vendor client's connect sequence: it feeds the decoder from the first frame, catches the snapshot up to the stream, answers the server's pings through the decoder and watches the server heartbeat. It hasn't yet been validated against a live SBI session. The stream is expected to be a plain binary WebSocket, as in the Next client. Should the server open with Socket.IO instead, the host joins its /v2/user namespace with unverified parameters that briskapi.connect(site="sbi", profile={...}) can set. See what the server answers with trace_protocol=True (every token redacted); anything unexpected stops with an explicit error rather than a guess. Please report what you see. Live sessions now get through sign-in, the data endpoints, the decoder download, the stock master and the snapshot (loaded with the session schedule). The WebSocket upgrade to api.brisk.jp was then answered with HTTP 502; those sessions didn't ask for the flex subprotocol the vendor client asks for, which this version does, and whether that is enough is not known yet. Your SBI cookies go only to sbi.brisk.jp.

Tachibana e-shiten BRiSK Next

e-shiten's BRiSK Next (next.e-shiten.brisk.jp) is the same app, so the same client serves it. Log in there in your browser and pass its cookies with site="e-shiten", or let briskapi sign in with your e-shiten passkey (below): brisk enroll --site e-shiten once, then brisk login before brisk live --site e-shiten.

briskapi.login("e-shiten", cookies={...})   # or BRISK_ESHITEN_COOKIES; remember=True keeps them apart from SBI's
feed = briskapi.connect(site="e-shiten", codes=["7203"])   # live

Everything above applies, recordings and uploads included (the market recordings as they are made and each day's timing summary); its cookies go only to next.e-shiten.brisk.jp. e-shiten allows one BRiSK session at a time: opening it in a second tab or browser has stopped the first (message 10011), so the feed and BRiSK in your browser can end each other. Before you record or upload, read what Tachibana's BRiSK Next terms say about storing and reusing its data.

Matsui, Monex and SMBC Nikko

BRiSK for Matsui Securities (matsui.brisk.jp), Monex Securities (monex.brisk.jp) and SMBC Nikko Securities (smbcnikko.brisk.jp) is the same vendor's app on hosts of their own, so the same client serves them: site="matsui", "monex" or "smbcnikko", with cookies from your browser, the site's variable (BRISK_MATSUI_COOKIES, BRISK_MONEX_COOKIES, BRISK_SMBCNIKKO_COOKIES; JSON) or a passkey sign-in (brisk enroll --site matsui once, then brisk login).

briskapi.login("matsui", cookies={...})   # remember=True keeps them apart from the other brokers'
feed = briskapi.connect(site="matsui", codes=["7203"])   # live

Everything above applies, recordings and uploads included (source brisk_live, as every broker's, in folders named matsui_…, monex_…, smbcnikko_…), and each site's cookies go only to its own host. These three have not been tried with an account yet: should a site's app differ from SBI's, the feed stops with an error that says what it did not recognise (--trace-protocol shows the connection) rather than record anything doubtful. Expect one BRiSK session per user, as at SBI and e-shiten, and close BRiSK in your browser first. Before you record or upload, read what your broker's BRiSK terms say about storing and reusing its data.