Brazilian financial market API: stock quotes, fundamentals, FIIs, crypto, FX, and economic indicators from B3/CVM/BCB.
What it does
brapi.dev is a REST API providing comprehensive data for the Brazilian financial market. It covers B3-listed equities (ações), FIIs (real-estate investment trusts), BDRs, ETFs, and indexes with real-time quotes, OHLCV historical prices (up to 15+ years on Pro plan), dividends, and full fundamental data modules including balance sheets, income statements, cash flow statements, and key financial indicators sourced from CVM filings. The API also offers cryptocurrency quotes in multiple fiat currencies, foreign exchange rates (sourced from BCB/PTAX), and economic indicators such as IPCA inflation and SELIC interest rate history.
The specific x402 endpoint at `/api/x402/stock-quotes` is intended to provide stock quote data payable via the x402 protocol. However, during probing the endpoint returned HTTP 200 rather than the expected 402 payment challenge on both GET and POST, so the x402 payment gate could not be confirmed as active. The broader brapi.dev platform offers a full OpenAPI 3.1 specification with detailed schemas for all response types, official SDKs for TypeScript/JavaScript and Python, and tiered subscription plans (Startup at ~R$50/month for 150K requests, Pro at ~R$83/month for 500K requests). Data sources include B3, CVM, IBGE, and Banco Central do Brasil. Free test tickers (PETR4, VALE3, MGLU3, ITUB4) are available without authentication.
Capabilities
Use cases
- —Building fintech dashboards with real-time Brazilian stock quotes and fundamentals
- —Backtesting trading strategies with 15+ years of OHLCV historical data
- —Monitoring FII dividend yields and portfolio allocation via CVM reports
- —Automating financial journalism with structured market data feeds
- —Integrating Brazilian FX rates and inflation data into economic models
Fit
Best for
- —Developers building products around the Brazilian financial market (B3)
- —Fintech applications needing structured fundamentals (BP, DRE, DFC) from CVM
- —Data analysts requiring historical OHLCV and dividend data for backtesting
- —Applications that need FII indicators, reports, and dividend history
Not for
- —Real-time sub-second trading systems (data updates every 5–15 minutes depending on plan)
- —Non-Brazilian market data needs (coverage is focused on B3, Brazilian crypto/FX, and Brazilian economic indicators)
- —Free high-volume usage (free tier is limited to 4 test tickers)
Quick start
curl "https://brapi.dev/api/quote/PETR4"Example
Response
{
"took": 3,
"results": [
{
"symbol": "PETR4",
"logourl": "https://icons.brapi.dev/icons/PETR4.svg",
"currency": "BRL",
"longName": "Petroleo Brasileiro SA Pfd",
"marketCap": 483937892568,
"shortName": "PETR4",
"priceEarnings": 6.09,
"fiftyTwoWeekLow": 28.86,
"earningsPerShare": 6.01,
"fiftyTwoWeekHigh": 38.66,
"fiftyTwoWeekRange": "28.86 - 38.66",
"regularMarketOpen": 37.21,
"regularMarketTime": "2026-02-08T16:24:54.000Z",
"regularMarketPrice": 36.65,
"regularMarketChange": -0.35,
"regularMarketDayLow": 36.45,
"regularMarketVolume": 27681100,
"regularMarketDayHigh": 37.27,
"regularMarketChangePercent": -0.95,
"regularMarketPreviousClose": 36.7
}
],
"requestedAt": "2026-02-08T16:25:28.170Z"
}Endpoint
Quality
The broader brapi.dev API has excellent documentation with a full OpenAPI 3.1 spec, detailed schemas, examples, and clear pricing. However, the specific x402 endpoint at /api/x402/stock-quotes did not return a 402 payment challenge during probing (returned 200 on both GET and POST), so the x402 payment mechanism could not be verified as active. The endpoint's specific behavior and pricing via x402 are unclear.
Warnings
- —The x402 endpoint did not return a 402 payment challenge during probing — it returned HTTP 200 on both GET and POST, so the x402 payment gate may not be active or may require specific parameters.
- —No x402-specific pricing information (token, amount, network) was captured in the probe bundle.
- —The /api/x402/stock-quotes path is not documented in the OpenAPI spec; only /api/quote/{tickers} and related paths are documented.
Citations
- —brapi.dev provides data from B3, CVM, IBGE, and Banco Central do Brasilhttps://brapi.dev/docs
- —Free test tickers PETR4, MGLU3, VALE3, ITUB4 work without authenticationhttps://brapi.dev/docs
- —Startup plan: R$49.99/month (R$599.90/year), 150,000 requests/month, 10 tickers per request, 15-min updateshttps://brapi.dev/pricing
- —Pro plan: R$83.33/month (R$999.90/year), 500,000 requests/month, 20 tickers per request, 5-min updateshttps://brapi.dev/pricing
- —Pro plan includes 15+ years of historical data and full fundamental modules (BP, DRE, DFC, DVA) since 2009https://brapi.dev/pricing
- —Official SDKs available: npm install brapi (TypeScript) and pip install brapi (Python)https://brapi.dev/docs
- —OpenAPI 3.1.0 spec version 3.0.0 with comprehensive schema definitionshttps://brapi.dev
- —Over 20,000 developers already use brapihttps://brapi.dev