curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_ticker": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_board": null,
"p_after": null,
"p_fields": null
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history"
payload = {
"p_ticker": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_board": None,
"p_after": None,
"p_fields": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
p_ticker: '<string>',
p_from: '2023-12-25',
p_to: '2023-12-25',
p_board: null,
p_after: null,
p_fields: null
})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'p_ticker' => '<string>',
'p_from' => '2023-12-25',
'p_to' => '2023-12-25',
'p_board' => null,
'p_after' => null,
'p_fields' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history"
payload := strings.NewReader("{\n \"p_ticker\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_board\": null,\n \"p_after\": null,\n \"p_fields\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"p_ticker\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_board\": null,\n \"p_after\": null,\n \"p_fields\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"p_ticker\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_board\": null,\n \"p_after\": null,\n \"p_fields\": null\n}"
response = http.request(request)
puts response.read_body[
{
"ticker": "<string>",
"trade_date": "2023-12-25",
"close_adj": 123,
"close": 123,
"open": 123,
"high": 123,
"low": 123,
"average": 123,
"bid": 123,
"ask": 123,
"close_unit": 123,
"trades": 123,
"quantity": 123,
"volume": 123,
"quotation_factor": 123,
"board": "<string>",
"isin": "<string>",
"short_name": "<string>",
"spec": "<string>",
"currency": "<string>",
"asset_class": "<string>",
"source": "<string>",
"coverage_start": "2023-12-25",
"coverage_end": "2023-12-25",
"prior_no_trade_sessions": 123,
"events_proven_at": "<string>",
"data_revision": "<string>",
"close_total_return": 123,
"close_total_return_null_reason": "<string>",
"market": "<string>",
"term_days": "<string>",
"contract_price": 123,
"contract_expiry": "2023-12-25",
"contract_correction": "<string>",
"contract_points": 123,
"contract_points_raw": "<string>",
"distribution_number": "<string>",
"fetched_at": "<string>"
}
]{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}quote_history
curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_ticker": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_board": null,
"p_after": null,
"p_fields": null
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history"
payload = {
"p_ticker": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_board": None,
"p_after": None,
"p_fields": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
p_ticker: '<string>',
p_from: '2023-12-25',
p_to: '2023-12-25',
p_board: null,
p_after: null,
p_fields: null
})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'p_ticker' => '<string>',
'p_from' => '2023-12-25',
'p_to' => '2023-12-25',
'p_board' => null,
'p_after' => null,
'p_fields' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history"
payload := strings.NewReader("{\n \"p_ticker\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_board\": null,\n \"p_after\": null,\n \"p_fields\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"p_ticker\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_board\": null,\n \"p_after\": null,\n \"p_fields\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/quote_history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"p_ticker\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_board\": null,\n \"p_after\": null,\n \"p_fields\": null\n}"
response = http.request(request)
puts response.read_body[
{
"ticker": "<string>",
"trade_date": "2023-12-25",
"close_adj": 123,
"close": 123,
"open": 123,
"high": 123,
"low": 123,
"average": 123,
"bid": 123,
"ask": 123,
"close_unit": 123,
"trades": 123,
"quantity": 123,
"volume": 123,
"quotation_factor": 123,
"board": "<string>",
"isin": "<string>",
"short_name": "<string>",
"spec": "<string>",
"currency": "<string>",
"asset_class": "<string>",
"source": "<string>",
"coverage_start": "2023-12-25",
"coverage_end": "2023-12-25",
"prior_no_trade_sessions": 123,
"events_proven_at": "<string>",
"data_revision": "<string>",
"close_total_return": 123,
"close_total_return_null_reason": "<string>",
"market": "<string>",
"term_days": "<string>",
"contract_price": 123,
"contract_expiry": "2023-12-25",
"contract_correction": "<string>",
"contract_points": 123,
"contract_points_raw": "<string>",
"distribution_number": "<string>",
"fetched_at": "<string>"
}
]{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}{
"code": "22023",
"message": "<string>",
"details": "<string>",
"hint": "<string>"
}Authorizations
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
Defaults to (CURRENT_DATE - 365).
Defaults to CURRENT_DATE.
Defaults to NULL::text.
Defaults to NULL::text.
Fields to return; null or omitted = ticker, trade_date, close_adj. ticker and trade_date are in every row.
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.
B3 trading code (CODNEG), as asked, upper-cased. In every row.
Session date. In every row.
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.
RAW close as traded, per quotation unit (see quotation_factor). Never adjusted.
Raw opening price.
Raw high.
Raw low.
Raw average traded price.
Best bid at the close.
Best ask at the close.
Raw close divided by quotation_factor: the price of one share, not adjusted for corporate events.
Number of trades.
Quantity traded.
Financial volume in currency.
FATCOT: how many shares the quoted prices refer to (1 or 1000).
BDI board code (CODBDI) the session printed on; 02 is the standard lot.
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.
Issuer short name as printed.
Share specification (ESPECI) as printed.
Price currency.
Instrument class from published TPMERC/ESPECI.
Source file of the row.
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).
Last session of the series on the tape (the current instrument's last print).
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.
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.
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_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.
Why close_total_return is NULL on the session; null when it has a value.
Original TPMERC code, preserved as text. Cash history is 010 only.
PRAZOT as published; blank for spot. Part of the source natural key.
PREEXE as published; exercise price or secondary-forward contract value, not a yield.
DATVEN; source sentinel 99991231 is null.
Original INDOPC code; consult the dated COTAHIST reference in catalog.
PTOEXE decoded with six implied decimals; zero filler or unreadable points become null.
Original PTOEXE text, retaining zero filler and leading zeros.
DISMES source sequence code, not a dividend amount.
Warehouse timestamp, not original publication time or an as-known source vintage.
Was this page helpful?