Brazil Macro Data: Selic, CDI, IPCA, USD/BRL

    1

    Selic, CDI, IPCA, IGP-M, dollar and Tesouro Direto from official Brazilian sources, with correct codes, units and limits.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Brazil Macro Data: Selic, CDI, IPCA, USD/BRL

    Example session with this skill installed

    What is the current Copom Selic target and the IPCA accumulated over the last 12 months? Give the values and their reference dates.

    • Read your context and instructions
    • Compiled the brazil macro data

    Selic target (Copom), SGS series 432: 13.75% per year. This is the target in force today (1 Nov 2026). The series is filled ahead to the next Copom meeting, so its last points are dated 02–04/11/2026, all at 13.75%. I didn't check when that target was set, so I can't tell you the meeting date.

    IPCA accumulated over 12 months, SGS series 13522: 4.58%, for

    September 2026. The series dates this point 01/09/2026, the first day of the month. The previous reading, for August 2026, was 4.22%. September's monthly IPCA (series 433) was 0.82%. October's figure isn't out yet and should come around 10 November.

    This is data, not investment advice.

    Real output from a Claude Code session with this skill installed.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Financial applications in Brazil require precise data from the Central Bank (BCB) and National Treasury, but these APIs are prone to transient failures, strict rate limits, and non-standard data types. This skill provides the logic to correctly fetch and process Brazilian macroeconomic indicators without common pitfalls like incorrect day-count conventions or failed TLS handshakes.

    What it does

    • Fetch Macro Indicators retrieves daily and monthly series for Selic, CDI, IPCA, IGP-M, and USD/BRL using official SGS codes.
    • Inflation Adjustment calculates accumulated price index changes between two dates using proper multiplicative factors.
    • Fixed Income Analysis accesses daily historical prices and rates for all Tesouro Direto bonds since 2002.
    • Rate Annualization converts daily rates (CDI/Selic) to annual equivalents using the Brazilian 252-business-day standard.
    • Automated Chunking splits long-range daily requests into 10-year segments to bypass API 406 errors.

    How it works

    1. Query Series by providing a specific SGS code and a date range or the number of recent data points.
    2. Handle Transient Errors through built-in retries and User-Agent spoofing to bypass frequent 400/406 status codes.
    3. Process CSV Data for Tesouro Direto by handling the semicolon separators and decimal commas common in Brazilian datasets.
    4. Generate Reports including the specific series code, units, and the date of the most recent observation.

    Frameworks & tools

    Python standard library, urllib, and certifi for TLS verification. Designed for backend services, financial reporting tools, and investment simulators.

    Why this beats prompting it yourself

    Prompting alone often fails to account for the specific 252-day business calendar used in Brazilian finance or the 10-year request limit on the BCB API. This skill ensures your agent doesn't hallucinate inflation by simply adding monthly percentages or fail when encountering the Treasury's large CSV files.

    Use cases

    • Calculate the current real interest rate by comparing Selic target against 12-month trailing IPCA.
    • Build a daily tracker for USD/BRL exchange rates with automated error recovery.
    • Simulate historical returns for Tesouro IPCA+ bonds using actual unit prices and rates.
    • Correct a contract value from 2015 to present using monthly IGP-M data.

    Known limitations

    Monthly series like IPCA typically have a 10-day lag into the following month. The BCB API requires a User-Agent header and may require retries for transient 400 errors.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Research & Analysis.

    IPCA/IGP-M have a ~10 day lag for new releases. Daily series requests must be chunked for ranges over 10 years. Tesouro Direto CSV requires specific TLS handling.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 16 days ago

    • Free with an Agensi account

    Accounts
    Bcb
    Software
    Python 3.8+

    Permissions

    Terminal / Shell
    Network Access

    Allowed Hosts

    api.bcb.gov.br
    Listed16 days ago

    What's inside

    Frequently Asked Questions

    This skill handles the specific complexities of Brazilian finance, such as the 252-business-day annualization standard and the multiplicative math required for compounding inflation indices like IPCA and IGP-M.

    The skill includes built-in logic to bypass common BCB API errors (400/406) by automatically chunking long-range requests into 10-year segments and implementing specialized retry logic.

    You can access a wide range of daily and monthly series including Selic, CDI, IPCA, IGP-M, and USD/BRL exchange rates, along with historical Tesouro Direto bond data dating back to 2002.

    Yes. The bundled script fetches any SGS series (with retries and 10-year chunking) and can compound percentage series; the SKILL.md documents the Tesouro Direto CSV format (semicolons, decimal commas, DD/MM/AAAA dates) so your agent parses it correctly in your own code.

    A SKILL.md with the SGS series codes, units, request limits and traps, the Tesouro Direto CSV source, and scripts/sgs.py, a standard-library Python script to fetch and compound any SGS series. It is free.

    While daily rates are updated frequently, monthly indices like IPCA generally have a 10-day reporting lag; the skill is programmed to always retrieve the most recent officially published observation.

    New in Research & Analysis

    Free