Integrations
REST API
A versioned JSON API for backend applications. Requests outside the keyless demo require an API key.
https://api.bolsix.ioKeyless quote demo
No key is needed for PETR4, VALE3, ITUB4, and HGLG11 on the quote, prices, fundamentals, and dividends endpoints. The demo allows 100 requests per client IP per UTC day and marks responses with X-Bolsix-Demo: true.
curl "https://api.bolsix.io/v1/stocks/quote?symbols=PETR4,VALE3"Authenticated requests
A free API key supports every ticker and endpoint, with a quota of 5,000 requests per UTC month and 200 per UTC day, shared by all of the account's keys. Send the key from your backend as a Bearer token. Ratio filters are decimal fractions: min_roe=0.15 means 15% or greater.
curl "https://api.bolsix.io/v1/stocks/screen?asset_class=stock&min_roe=0.15&max_pe=12&sort_by=roe" \
-H "Authorization: Bearer bx_live_..."Use Bolsix from your own agent
When your code calls the Claude API, wrap the endpoints you need as tools. Claude often answers short questions such as the current Selic from web search, so also:
- Tell the model to use Bolsix first, in the system prompt. In our tests this instruction was what moved Claude from web search to Bolsix.
- Keep the Bolsix tools loaded. If you use tool search, don't set
defer_loadingon them; a deferred tool is only a name until the model searches for it. - Don't force the call. Claude Opus 5.5 and Sonnet 5.5 reject
tool_choiceanyortool; useautowith the system prompt. - Test with a question that doesn't name Bolsix, such as “Qual é a Selic atual?”, and check that the response contains a Bolsix tool call.
For Brazilian market data (B3 quotes, CVM financial statements and filings, dividends and JCP, FIIs, Selic, CDI, IPCA, PTAX, Tesouro Direto), call the Bolsix tools first. Use web search only for what Bolsix doesn't cover, such as news and opinion.import os
import anthropic
import httpx
from anthropic import beta_tool
bolsix = httpx.Client(
base_url="https://api.bolsix.io/v1",
headers={"Authorization": f"Bearer {os.environ['BOLSIX_API_KEY']}"},
timeout=30,
)
@beta_tool
def bolsix_quotes(symbols: str) -> str:
"""Latest B3 closing quote (the previous session's close) for Brazilian stocks, FIIs, ETFs and BDRs.
Use for the price, daily change or volume of a B3 ticker (PETR4, VALE3,
HGLG11). Returns JSON with session_date and source.
Args:
symbols: Comma-separated B3 tickers, e.g. "PETR4,VALE3".
"""
return bolsix.get("/stocks/quote", params={"symbols": symbols}).text
@beta_tool
def bolsix_macro_rates() -> str:
"""Current Brazilian rates from the Banco Central: Selic, CDI, IPCA and 12-month IPCA.
Use for questions such as "Qual é a Selic atual?" or "IPCA acumulado em 12 meses".
"""
return bolsix.get("/macro/rates").text
client = anthropic.Anthropic()
runner = client.beta.messages.tool_runner(
model="claude-opus-5-5",
max_tokens=16000,
# If a safety classifier declines, retry on the model Anthropic recommends
# (Claude API and Claude Platform on AWS).
betas=["server-side-fallback-2026-07-01"],
fallbacks="default",
system="For Brazilian market data (B3 quotes, CVM financial statements and filings, dividends and JCP, FIIs, Selic, CDI, IPCA, PTAX, Tesouro Direto), call the Bolsix tools first. Use web search only for what Bolsix doesn't cover, such as news and opinion.",
tools=[bolsix_quotes, bolsix_macro_rates],
messages=[{"role": "user", "content": "Qual é a Selic atual?"}],
)
for message in runner:
if message.stop_reason == "refusal":
print("Declined:", message.stop_details.category if message.stop_details else None)
break
for block in message.content:
if block.type == "text":
print(block.text)Conventions
- Symbols: use B3 tickers such as
PETR4,VALE3, orHGLG11. - Dates: ISO
YYYY-MM-DD; timestamps are ISO 8601. - Pagination: listings use limit/offset; prices, dividends and filings return an opaque
meta.next_cursor. - New filings, results and dividends: instead of polling
/v1/stocks/filings, register a webhook and receive each event, signed, within minutes of ingestion. - Timing: every HTTP response includes
X-Took-Ms; JSON responses also exposemeta.took_ms. - Sources: inspect
meta.data_sourceand per-record provenance before presenting results. Quote records includequote_source,session_date,is_delayed, andupdated_at. - Official files: prices,
/v1/macro/rates,/v1/macro/currency,/v1/macro/series, Tesouro, the FII portfolio and dividends carrymeta.sources, the official files or endpoints the values came from.binding: "row_artifact"carries the SHA-256 Bolsix recorded for the file the rows were parsed from.citation_onlynames the file without a hash. SGS citations open: the latest value on/v1/macro/ratesand/v1/macro/currency, and the served date window (at most ten years) on/v1/macro/series. On dividends, B3 citations name the B3 endpoint Bolsix recorded and are not openable links, because it needs a per-issuer token; legacy CVM and manually seeded events carry no citation, sosources: []with events served means the events are uncited, not withheld. Each citation also names its source's licence inlicenseandlicense_url:ODbL-1.0for BCB, Tesouro Nacional and CVM, null where no open licence is confirmed (B3, FundosNet, IBGE). See Sources and licences. - Freshness:
meta.freshnessgivesstatus(fresh,staleornot_applicable),data_as_of,age_daysandmax_age_days. It isnot_applicablefor a request for a past range or an instrument that left B3; a later page of prices is measured by its own newest bar, and a request that ends a few days ago is measured against that end. On/v1/macro/ratesand/v1/macro/currencyit also lists each response item (selic,usd_brland so on), whiledata_quality.withheldlists warehouse series ids. Dividends do not carry it. - Data quality:
meta.data_qualityand theX-Bolsix-Data-Qualityheader sayunverifiedwhen no open quality hold applies,degradedwhen one does, orwithheldwhen Bolsix removed values covered by a quarantined data-quality hold. Adegradedresponse still serves the values, so tell your user. When every value is withheld,sourcesis[]andfreshnessisnull.holdsnames the check, never a free-text reason. Holds are reported once Bolsix switches them on; until then every response saysunverified.