Skip to main content
POST
quote_history

Authorizations

apikey
string
header
required

The publishable key (sb_publishable_…), on every request. It is NOT a JWT — sending it as Authorization: Bearer is rejected as an invalid JWT. It identifies the project, not you, and maps to the Postgres anon role.

Body

application/json
p_ticker
string | null
required
p_from
string<date> | null

Defaults to (CURRENT_DATE - 365).

p_to
string<date> | null

Defaults to CURRENT_DATE.

p_board
string | null

Defaults to NULL::text.

p_after
string | null

Defaults to NULL::text.

p_fields
enum<string>[] | null

Fields to return; null or omitted = ticker, trade_date, close_adj. ticker and trade_date are in every row.

Available options:
ticker,
trade_date,
close_adj,
close,
open,
high,
low,
average,
bid,
ask,
close_unit,
trades,
quantity,
volume,
quotation_factor,
board,
isin,
short_name,
spec,
currency,
asset_class,
source,
coverage_start,
coverage_end,
prior_no_trade_sessions,
events_proven_at,
data_revision,
close_total_return,
close_total_return_null_reason,
market,
term_days,
contract_price,
contract_expiry,
contract_correction,
contract_points,
contract_points_raw,
distribution_number,
fetched_at

Response

The result set, oldest first. An unknown ticker, or a window outside its coverage, is refused (22023), never an empty or guessed series.

ticker
string | null

B3 trading code (CODNEG), as asked, upper-cased. In every row.

trade_date
string<date> | null

Session date. In every row.

close_adj
number | null

Close per single share, backward-adjusted for splits (DESDOBRAMENTO), groupings (GRUPAMENTO) and bonus shares (BONIFICACAO) and anchored to the instrument's latest session; rounded to 6 decimal places. No dividend, JCP or subscription-right adjustment. Shares and units only. Null only when the session has no close; a window it cannot adjust is refused, never filled with the raw close.

close
number | null

RAW close as traded, per quotation unit (see quotation_factor). Never adjusted.

open
number | null

Raw opening price.

high
number | null

Raw high.

low
number | null

Raw low.

average
number | null

Raw average traded price.

bid
number | null

Best bid at the close.

ask
number | null

Best ask at the close.

close_unit
number | null

Raw close divided by quotation_factor: the price of one share, not adjusted for corporate events.

trades
integer<int32> | null

Number of trades.

quantity
number | null

Quantity traded.

volume
number | null

Financial volume in currency.

quotation_factor
integer<int32> | null

FATCOT: how many shares the quoted prices refer to (1 or 1000).

board
string | null

BDI board code (CODBDI) the session printed on; 02 is the standard lot.

isin
string | null

ISIN of the instrument this row printed under. One ISIN per series, except across an ISIN change the ticker's lineage splices (api.ticker_lineage), where each row keeps its own.

short_name
string | null

Issuer short name as printed.

spec
string | null

Share specification (ESPECI) as printed.

currency
string | null

Price currency.

asset_class
string | null

Instrument class from published TPMERC/ESPECI.

source
string | null

Source file of the row.

coverage_start
string<date> | null

First session of the series on the tape: this ticker under this ISIN, or the oldest instrument of its spliced lineage when the window reaches back to it (the tape starts 2019-01-02).

coverage_end
string<date> | null

Last session of the series on the tape (the current instrument's last print).

prior_no_trade_sessions
integer<int32> | null

Market sessions (days the B3 cash tape printed) since this ticker's previous row in which it printed nothing. COTAHIST lists only papers that traded, so a missing session is a session with no trade; holidays are not sessions.

events_proven_at
string | null

When the issuer's corporate-event history was last proven complete (b3_corporate_event_sweep), ISO 8601 UTC. Null outside shares and units or when not proven.

data_revision
string | null

Revision of the data behind this response: the latest successful load of the B3 cash tape, the corporate events or their proof, ISO 8601 UTC. It changes when adjusted levels can change; pages with different revisions must not be combined.

close_total_return
number | null

close_adj with cash distributions reinvested at the ex-date close (#418): divided by the product of (1 + cash / ex-session close) over later distributions (DIVIDENDO, JRS CAP PROPRIO gross of tax, RENDIMENTO, REST CAP DIN from B3's full history, ISIN proven against the tape). 6 decimal places. NULL, with close_total_return_null_reason, where it cannot be valued.

close_total_return_null_reason
string | null

Why close_total_return is NULL on the session; null when it has a value.

market
string | null

Original TPMERC code, preserved as text. Cash history is 010 only.

term_days
string | null

PRAZOT as published; blank for spot. Part of the source natural key.

contract_price
number | null

PREEXE as published; exercise price or secondary-forward contract value, not a yield.

contract_expiry
string<date> | null

DATVEN; source sentinel 99991231 is null.

contract_correction
string | null

Original INDOPC code; consult the dated COTAHIST reference in catalog.

contract_points
number | null

PTOEXE decoded with six implied decimals; zero filler or unreadable points become null.

contract_points_raw
string | null

Original PTOEXE text, retaining zero filler and leading zeros.

distribution_number
string | null

DISMES source sequence code, not a dividend amount.

fetched_at
string | null

Warehouse timestamp, not original publication time or an as-known source vintage.