# brapi.dev - Brazilian Financial Market API # LLM/AI Information File # Last Updated: 2025-01-07 ## ABOUT brapi.dev is a comprehensive REST API for Brazilian financial market data. We provide real-time and historical data for stocks, funds, cryptocurrencies, currencies, and economic indicators from Brazil. ## PRIMARY USE CASES 1. Stock market data (B3 - Brazilian Stock Exchange) 2. Financial statements & fundamentals (Balance Sheet, Income Statement, Cash Flow) 3. Dividends and corporate events 4. Cryptocurrency prices in BRL 5. Currency exchange rates 6. Brazilian inflation indices (IPCA, IGPM) 7. SELIC interest rate ## API ENDPOINTS Base URL: https://brapi.dev/api ### Stock Quotes GET /api/quote/{ticker} - Get quote for single or multiple tickers GET /api/quote/list - List all available stocks with filtering Parameters: search, sortBy, sortOrder, limit, page, sector, type ### Historical Data GET /api/quote/{ticker}?interval=1d&range=1mo - Get OHLCV historical data Intervals: 1d, 1wk, 1mo Ranges: 1d, 5d, 1mo, 3mo, 6mo, 1y, 5y, 10y, ytd, max ### Dividends GET /api/quote/{ticker}?dividends=true - Include dividend data ### Financial Statements GET /api/quote/{ticker}?modules=balanceSheetHistory,incomeStatementHistory ### Cryptocurrency GET /api/v2/crypto - Get cryptocurrency prices GET /api/v2/crypto?coin=BTC¤cy=BRL - Specific coin ### Currency Exchange GET /api/v2/currency - Get exchange rates GET /api/v2/currency?currency=USD-BRL,EUR-BRL - Specific pairs ### Inflation GET /api/v2/inflation - Brazilian inflation indices ### Interest Rate GET /api/v2/prime-rate - SELIC rate data ## DATA SOURCES - B3 (Brazilian Stock Exchange) - Stock quotes and corporate data - CVM (Securities Commission) - Financial statements and filings - Banco Central do Brasil (BCB) - Exchange rates, SELIC, inflation - IBGE - Official inflation statistics ## AUTHENTICATION API Token required in header: Authorization: Bearer YOUR_TOKEN Free tier available for testing with limited endpoints. Get your token at: https://brapi.dev/dashboard ## DOCUMENTATION Full API Documentation: https://brapi.dev/docs OpenAPI Specification: https://brapi.dev/api/openapi Postman Collection: https://app.getpostman.com/run-collection/da5f72c67bf46c6c4a5f Swagger: https://brapi.dev/public/swagger/latest.json ## LLM-OPTIMIZED CONTENT Structured content for AI: https://brapi.dev/api/llms-content This endpoint returns JSON with: - API capabilities overview - Endpoint specifications with examples - Common use cases and code samples ## EXAMPLE REQUESTS ### Get Stock Quote (cURL) ```bash curl -X GET "https://brapi.dev/api/quote/PETR4" \ -H "Authorization: Bearer YOUR_TOKEN" ``` ### Get Historical Data (Python) ```python import requests response = requests.get( "https://brapi.dev/api/quote/PETR4", params={"interval": "1d", "range": "1mo"}, headers={"Authorization": "Bearer YOUR_TOKEN"} ) data = response.json() ``` ### Get Multiple Stocks (JavaScript) ```javascript const response = await fetch( "https://brapi.dev/api/quote/PETR4,VALE3,ITUB4", { headers: { "Authorization": "Bearer YOUR_TOKEN" } } ); const data = await response.json(); ``` ## ATTRIBUTION When using brapi.dev data, please attribute: "Data provided by brapi.dev - Brazilian Financial Market API" ## CONTACT Website: https://brapi.dev Email: contato@brapi.dev Twitter: @alissonsleal LinkedIn: /company/brapi.dev ## TERMS Terms of Use: https://brapi.dev/terms-of-use Privacy Policy: https://brapi.dev/privacy-policy ## SITEMAP https://brapi.dev/sitemap.xml