Get Recent Trades
get_recent_tradesRetrieves anonymized recent trades (time, side, price, quantity, volume) for an instrument, fetching newest trades hour-by-hour backwards within the current UTC day. Optionally outputs to file.
Instructions
Anonymized recent trades feed for one instrument: time, side, price, quantity, volume. Returns the newest limit trades, fetched hour-by-hour backwards from to (the BCS backend caps one request at a 1-hour period and ~4 MB response). Optional from/to select an explicit window. IMPORTANT: the API serves trades of the CURRENT UTC DAY only (from 00:00 UTC = 03:00 MSK) — earlier window starts are clamped, yesterday is unavailable. Records carry no trade id: identical rows within the same second are genuine distinct trades, not duplicates. Pass outputPath to dump a period (default: the whole current UTC day) to a file via hour-by-hour windows. Bond prices are quoted in % of face value, not currency.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of period, ISO 8601 (default: now) | |
| from | No | Start of period, ISO 8601 (default: auto-widening recent window inline / start of the current UTC day with outputPath); clamped to 00:00 UTC of the current day — the API keeps no older trades | |
| limit | No | Max trades returned inline, newest first (ignored with outputPath — the whole period is written) | |
| ticker | Yes | Ticker, e.g. SBER | |
| classCode | No | Board class code (resolved via find_instrument when omitted) | |
| outputPath | No | Write the full result to this file (path relative to the output root: BCS_OUTPUT_DIR or server cwd) instead of returning it inline. The response becomes a short summary {savedTo, records, bytes, sample}. Use for bulk data to keep the context clean. For get_candles this also enables full-history fetching (chunking beyond the 1000-bar API limit). | |
| outputFormat | No | File format; default json (or csv if outputPath ends with .csv). csv writes the main flat array of the response. |