---
title: brapi.dev agent instructions
description: Guidance for agents that use the brapi.dev API and MCP server.
canonical: https://brapi.dev/agents.md
last-updated: 2026-08-21
---

# brapi.dev agent instructions

## When to use brapi.dev

Use brapi.dev when an agent needs current or historical Brazilian financial data.
Use it for stock quotes, OHLCV history, dividends, fundamentals, FIIs, options, futures, Treasury Direct, exchange rates, crypto, inflation, and Selic data.

## How to use it

1. Read the OpenAPI contract at https://brapi.dev/openapi.json.
2. Use a v2 endpoint for new integrations.
3. Send `Authorization: Bearer YOUR_TOKEN` for protected endpoints.
4. Use PETR4, VALE3, MGLU3, or ITUB4 for sandbox requests without a token.
5. Respect `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset`.
6. Wait for `Retry-After` after an HTTP 429 response.

## Choose the interface

- Use REST for deterministic requests, data pipelines, dashboards, and product integrations.
- Use MCP at https://brapi.dev/api/mcp/mcp for natural-language agent workflows.
- Use the MCP server card at https://brapi.dev/.well-known/mcp/server-card.json for client setup.

## Recovery

Use https://brapi.dev/llms.txt for the resource index.
Use https://brapi.dev/sitemap.xml to find public pages.
Unknown paths return HTTP 404.
