curl --request POST \
--url https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/share_counts \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_id": "<string>",
"p_from": null,
"p_to": null
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/share_counts"
payload = {
"p_id": "<string>",
"p_from": None,
"p_to": 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_id: '<string>', p_from: null, p_to: null})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/share_counts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));[
{
"cd_cvm": "<string>",
"cnpj": "<string>",
"company": "<string>",
"reference_date": "2023-12-25",
"version": 123,
"shares_on": 123,
"shares_pn": 123,
"shares_total": 123,
"treasury_on": 123,
"treasury_pn": 123,
"treasury_total": 123,
"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>"
}share_counts
A listed company’s issued share count through time, as filed with CVM: ON, PN and total, plus treasury shares where the form has them. source = cvm_itr / cvm_dfp (composição do capital, quarterly, from 2020) or cvm_fre (FRE capital social, Capital Integralizado, yearly, from 2010; no treasury count, those columns NULL). The newest version of each period is served, which is not point-in-time. Nothing is derived or filled forward; an empty value stays NULL. Counts are per company, not per ticker. p_id is required and resolves as api.financials resolves it (ticker through CVM’s FCA map, 14-digit CNPJ or CVM code, never a name); an id that resolves to nothing returns no rows. p_from / p_to bound the reference date (NULL = no bound). Newest period first. More than 1000 rows RAISES 22023 (never trimmed).
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/share_counts \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"p_id": "<string>",
"p_from": null,
"p_to": null
}
'import requests
url = "https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/share_counts"
payload = {
"p_id": "<string>",
"p_from": None,
"p_to": 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_id: '<string>', p_from: null, p_to: null})
};
fetch('https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1/rpc/share_counts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));[
{
"cd_cvm": "<string>",
"cnpj": "<string>",
"company": "<string>",
"reference_date": "2023-12-25",
"version": 123,
"shares_on": 123,
"shares_pn": 123,
"shares_total": 123,
"treasury_on": 123,
"treasury_pn": 123,
"treasury_total": 123,
"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, newest reference_date first. An unknown id is an empty array, not a 404 and never a guessed value.
Was this page helpful?