> A bolsix.io page, as Markdown. Index of every page: https://bolsix.io/llms.txt
> Connecting Bolsix to an agent? Follow https://bolsix.io/agent-quickstart.md
> Source: https://bolsix.io/docs/rest-api

Integrations

# REST API

A versioned JSON API for backend applications. Requests outside the keyless demo require an API key.

Base URL`https://api.bolsix.io`

## Keyless 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"
```

[Open the quote response (JSON) →](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_loading` on 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_choice` `any` or `tool`; use `auto` with 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.

System prompt

```
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.
```

Python (Anthropic SDK)

```
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`, or `HGLG11`.
* **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](https://bolsix.io/docs/webhooks) and receive each event, signed, within minutes of ingestion.
* **Timing:** every HTTP response includes `X-Took-Ms`; JSON responses also expose `meta.took_ms`.
* **Sources:** inspect `meta.data_source` and per-record provenance before presenting results. Quote records include `quote_source`, `session_date`, `is_delayed`, and `updated_at`.
* **Official files:** prices, `/v1/macro/rates`, `/v1/macro/currency`, `/v1/macro/series`, Tesouro, the FII portfolio and dividends carry `meta.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_only` names the file without a hash. SGS citations open: the latest value on `/v1/macro/rates` and `/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, so `sources: []` with events served means the events are uncited, not withheld. Each citation also names its source's licence in `license` and `license_url`: `ODbL-1.0` for BCB, Tesouro Nacional and CVM, null where no open licence is confirmed (B3, FundosNet, IBGE). See [Sources and licences](https://bolsix.io/docs/methodology#sources-and-licences).
* **Freshness:** `meta.freshness` gives `status` (`fresh`, `stale` or `not_applicable`), `data_as_of`, `age_days` and `max_age_days`. It is `not_applicable` for 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/rates` and `/v1/macro/currency` it also lists each response item (`selic`, `usd_brl` and so on), while `data_quality.withheld` lists warehouse series ids. Dividends do not carry it.
* **Data quality:** `meta.data_quality` and the `X-Bolsix-Data-Quality` header say `unverified` when no open quality hold applies, `degraded` when one does, or `withheld` when Bolsix removed values covered by a quarantined data-quality hold. A `degraded` response still serves the values, so tell your user. When every value is withheld, `sources` is `[]` and `freshness` is `null`. `holds` names the check, never a free-text reason. Holds are reported once Bolsix switches them on; until then every response says `unverified`.
[Browse every endpoint →](https://bolsix.io/docs/api-reference)
