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));[
{
"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));[
{
"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
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?