curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_history \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_code": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_as_of": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_history"
payload = {
"p_code": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_as_of": "2023-11-07T05:31:56Z"
}
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_code: '<string>',
p_from: '2023-12-25',
p_to: '2023-12-25',
p_as_of: '2023-11-07T05:31:56Z'
})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_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/credit_market_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_code' => '<string>',
'p_from' => '2023-12-25',
'p_to' => '2023-12-25',
'p_as_of' => '2023-11-07T05:31:56Z'
]),
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/credit_market_history"
payload := strings.NewReader("{\n \"p_code\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_as_of\": \"2023-11-07T05:31:56Z\"\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/credit_market_history")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"p_code\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_as_of\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_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_code\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_as_of\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body[
{
"instrument_code": "<string>",
"trade_date": "2023-12-25",
"settlement_date": "2023-12-25",
"trade_classification": "<string>",
"isin": "<string>",
"issuer_name": "<string>",
"quantity": 123,
"min_price": 123,
"avg_price": 123,
"max_price": 123,
"last_price": 123,
"reference_price": 123,
"trade_count": 123,
"volume_brl": 123,
"oscillation_pct": 123,
"units": {},
"capture_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload_sha256": "<string>",
"row_sha256": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"available_at": "2023-11-07T05:31:56Z",
"source": "<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>"
}credit_market_history
Debenture market observations for one instrument code, oldest first, one row per trade_date, settlement_date and trade_classification. Select the latest complete successfully audited capture PER TRADE DATE before instrument filtering; a newer snapshot removing a code does not resurrect an older row. p_as_of defaults to current knowledge and requires both observed_at and available_at (successful audit completion) no later than that cutoff; backfilled trade dates never become original publication-time PIT. Unknown code at the cutoff raises 22023; a known code with no observations in the window returns an empty set, never a zero or filled price. Nine nullable metrics with explicit units and capture/raw/row hashes, ISIN and source-reported issuer name; no inferred issuer CNPJ or stock ticker. min/avg/max prices, quantity, trade_count and volume_brl belong to the full group. last_price and reference_price are instrument-wide and repeat across groups: never sum or average their repeated copies. reference_price may be modeled, is not a trade and never substitutes for last_price. Prices are BRL/unit, quantity units, trade_count trades, volume_brl BRL and oscillation_pct percent. volume_brl is transaction volume, not outstanding. No yield, spread, coupon/amortization-adjusted total return or cash-flow engine. NULL stays unpublished. Row cap: more than 1000 rows RAISES 22023, never trimmed; narrow p_from/p_to. No date-only cursor because several groups share a date. Capture completeness covers requested sessions, not every session across the warehouse history; inspect api.coverage for known span, and absence is never filled.
Row cap. A window producing more than 1000 rows raises SQLSTATE 22023 naming this function. Nothing is trimmed to fit — PostgREST would silently cut the response at 1000 and a cut-short series is indistinguishable from one that simply ends. This function does not page — narrow the window instead.
curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_history \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_code": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_as_of": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_history"
payload = {
"p_code": "<string>",
"p_from": "2023-12-25",
"p_to": "2023-12-25",
"p_as_of": "2023-11-07T05:31:56Z"
}
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_code: '<string>',
p_from: '2023-12-25',
p_to: '2023-12-25',
p_as_of: '2023-11-07T05:31:56Z'
})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_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/credit_market_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_code' => '<string>',
'p_from' => '2023-12-25',
'p_to' => '2023-12-25',
'p_as_of' => '2023-11-07T05:31:56Z'
]),
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/credit_market_history"
payload := strings.NewReader("{\n \"p_code\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_as_of\": \"2023-11-07T05:31:56Z\"\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/credit_market_history")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"p_code\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_as_of\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/credit_market_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_code\": \"<string>\",\n \"p_from\": \"2023-12-25\",\n \"p_to\": \"2023-12-25\",\n \"p_as_of\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body[
{
"instrument_code": "<string>",
"trade_date": "2023-12-25",
"settlement_date": "2023-12-25",
"trade_classification": "<string>",
"isin": "<string>",
"issuer_name": "<string>",
"quantity": 123,
"min_price": 123,
"avg_price": 123,
"max_price": 123,
"last_price": 123,
"reference_price": 123,
"trade_count": 123,
"volume_brl": 123,
"oscillation_pct": 123,
"units": {},
"capture_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payload_sha256": "<string>",
"row_sha256": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"available_at": "2023-11-07T05:31:56Z",
"source": "<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
Response
The result set, oldest first. An unknown id is an empty array, not a 404 and never a guessed value.
Was this page helpful?