# Brazil Investment Fund Returns (Fundos CVM) (`br_data_hub/br-cvm-fund-performance`) Actor

Ready-made performance metrics for Brazilian investment funds from CVM open data: period, YTD and 12-month return, volatility, max drawdown, net assets, net inflows, shareholders and % of CDI.

- **URL**: https://apify.com/br_data_hub/br-cvm-fund-performance.md
- **Developed by:** [br_data_hub](https://apify.com/br_data_hub) (community)
- **Categories:** Integrations, Developer tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 1,000 funds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Brazil Investment Fund Returns (Fundos CVM)

Ready-made **performance metrics for Brazilian investment funds**, calculated from the official open data of CVM (Comissão de Valores Mobiliários, Brazil's securities regulator). Give fund CNPJs, or a name or classification filter, and a period. For each fund you get the **return for the period, year to date and last 12 months**, **annualized volatility**, **maximum drawdown**, **current net assets**, **net inflows**, **number of shareholders** and, optionally, the return as **% of CDI** (Banco Central's SGS series 12).

Other tools hand you raw daily quotas and leave the math to you. This Actor downloads the monthly CVM files, keeps only the funds you asked for and returns the metrics ready to use in a spreadsheet, a dashboard or an AI agent.

### Input

| Field | Description |
|---|---|
| `cnpjs` | Fund or fund-class CNPJs, with or without punctuation. Numeric and the new alphanumeric CNPJ are accepted. A fund CNPJ that has classes under CVM Resolution 175 expands to all its classes. |
| `fundNameContains` | Find funds whose fund or class name contains this text (case and accents ignored). Largest funds by net assets first. |
| `classification` | Optional filter on the CVM or ANBIMA classification of the class, such as `Renda Fixa`, `Multimercado`, `Ações`, `Cambial`. |
| `fundTypes` | Optional filter on the CVM fund type (`FIF`, `FI`, `FIC`...) for the name or classification filters. |
| `maxFunds` | Maximum fund classes taken from the filters (default 3, up to 200). Explicit CNPJs are always included. |
| `startDate` / `endDate` | Analysis period (`YYYY-MM-DD`). Defaults: the last 12 months up to today. Up to 36 months per run. |
| `compareWithCdi` | Add the CDI accumulated over the same dates and the return as % of CDI (default `true`). |
| `includeSubclasses` | One result per share subclass when the class reports by subclass (default `true`). |
| `includeCancelled` | Let the filters match cancelled funds too (default `false`). |

The default input looks up the 3 largest funds with "TESOURO SELIC" in the name over the last 12 months.

### Output

One item per fund class (or subclass) with daily data in the period:

```json
{
  "cnpj": "11111111000191",
  "cnpjFormatted": "11.111.111/0001-91",
  "subclassId": null,
  "reportingLevel": "class",
  "name": "FUNDO EXEMPLO TESOURO SELIC FIF RF CLASSE UNICA",
  "fundCnpj": "11111111000191",
  "fundName": "FUNDO EXEMPLO TESOURO SELIC FIF RF",
  "fundType": "FIF",
  "classification": "Renda Fixa",
  "anbimaClassification": "Renda Fixa Duração Baixa Soberano",
  "benchmark": "CDI",
  "registryStatus": "Em Funcionamento Normal",
  "adaptedToRcvm175": true,
  "administrator": "ADMINISTRADORA EXEMPLO S.A.",
  "manager": "GESTORA EXEMPLO LTDA",
  "periodStart": "2025-10-29",
  "periodEnd": "2026-09-30",
  "lastQuota": 1.421530107885,
  "periodReturnPct": 12.4762,
  "ytdReturnPct": 10.0238,
  "return12mPct": 13.6392,
  "annualizedVolatilityPct": 0.0,
  "maxDrawdownPct": 0.0,
  "netAssetsBrl": 1717000000.0,
  "netAssetsDate": "2026-09-30",
  "inflowsBrl": 480000000.0,
  "redemptionsBrl": 240000000.0,
  "netInflowBrl": 240000000.0,
  "shareholders": 50717,
  "shareholdersChange": 239,
  "cdiPeriodReturnPct": 12.7463,
  "pctOfCdiPeriod": 97.88,
  "cdiYtdReturnPct": 10.2385,
  "pctOfCdiYtd": 97.9,
  "cdi12mReturnPct": 13.9361,
  "pctOfCdi12m": 97.87,
  "monthlyReturns": [{"month": "2025-11", "returnPct": 0.9846, "cdiReturnPct": 1.0048, "pctOfCdi": 97.99}],
  "dataPoints": 241,
  "status": "ok",
  "warnings": []
}
```

(Example values come from the test fixtures, not from a real fund.)

How the metrics are calculated:

- **Returns** compare the last published quota up to `endDate` with the last quota *before* the start date (period), on or before 31 December of the previous year (YTD) and on or before the same day one year earlier (12 months). They are gross of taxes, net of fees, as reported by the fund.
- **Annualized volatility**: sample standard deviation of daily log returns in the period × √252.
- **Maximum drawdown**: worst fall from a previous peak of the quota in the period, with the peak and trough dates.
- **Net inflows**: sum of daily subscriptions (`CAPTC_DIA`) minus redemptions (`RESG_DIA`) on days inside the period. **Net assets** and **shareholders** are the last values reported.
- **CDI**: daily CDI rates (SGS 12) compounded for the business days after the base date up to the last quota date; `% of CDI` = fund return ÷ CDI return × 100.

CNPJs without daily reports in the period come back with `status: "no_data"`, and invalid CNPJs with `status: "error"`; neither is charged. Funds found by the filters that do not file daily reports (for example FIDCs and FIIs) are skipped.

### CVM Resolution 175 (classes and subclasses)

Since CVM Resolution 175, a fund can have several **classes** (each with its own CNPJ, net assets and quota) and a class can have **subclasses** (share series with different fees or target investors). CVM changed its files accordingly, and this Actor handles both layouts:

- **Daily report (informe diário):** the columns `TP_FUNDO` and `CNPJ_FUNDO` became `TP_FUNDO_CLASSE` and `CNPJ_FUNDO_CLASSE`, and `ID_SUBCLASSE` was added. Columns are matched by name, so older files and new files are read the same way. `fileLayout` tells you which layout the latest row came from (`legacy` or `rcvm175`), and `reportType` keeps CVM's `TP_FUNDO_CLASSE` value.
- **Registry:** the old `cad_fi.csv` gave way to `registro_fundo_classe.zip` with `registro_fundo.csv`, `registro_classe.csv` and `registro_subclasse.csv`. The Actor reads these three files.
- **What you see in the output:** `cnpj` is the CNPJ that files the daily report (the class for adapted funds). `fundCnpj` and `fundName` identify the umbrella fund; `name` is the class name. If you pass a fund CNPJ that has classes with their own CNPJs, you get one item per class, with `requestedCnpj` showing what you asked for. When a class reports by subclass, each subclass is a separate item with `subclassId`, `subclassName` and `reportingLevel: "subclass"`. Funds not yet adapted report under their own CNPJ with `adaptedToRcvm175: false` and `reportingLevel: "fund"`.
- A fund that was adapted during your period may change the CNPJ it reports under (fund → class). In that case the history before the change is under the fund CNPJ; ask for both CNPJs to see the whole period.

### How much does it cost?

Pay per event, two events:

- **`apify-actor-start`**: Apify's standard start event, US$ 0.00005 per run (US$ 0.05 per 1,000 runs), charged by the platform.
- **`fund`**: charged once per fund class or subclass returned with metrics. Invalid CNPJs, CNPJs without data and errors are free.

Suggested price: **US$ 0.01 per fund (US$ 10 per 1,000)**. How it was set:

- Apify compute costs US$ 0.20 per compute unit (1 CU = 1 GB of memory for 1 hour). The Actor runs with 512 MB; the default input peaked at about 340 MB (measured on 30/10/2026), because the CVM files are read as a stream.
- The cost is mostly per run, not per fund: a 12-month analysis downloads and scans about 14 monthly ZIP files (~25 MB each) whether you ask for 1 fund or 50. Locally that took about 11 s of CPU; with the 1/8 vCPU that 512 MB gets on Apify we estimate 1.5 to 2.5 minutes, about 0.02 CU = **US$ 0.004 per run**.
- After Apify's 20% commission, US$ 0.01 leaves US$ 0.008 per fund, about twice the cost of a single-fund run, and much more when a run covers several funds. Periods are capped at 36 months so a long single-fund run stays close to break-even.
- The only similar Actor in the Store charges about US$ 0.0001 per event but returns raw registry and daily-report rows; here every result is a finished analysis.

**$0.01 per fund** (`fund` event, pay per event). Charged once per fund returned with metrics. Funds not found or without data are free.

- `apify-actor-start`: $0.00005 (Charged once when a run starts (Apify synthetic event).)

| You get | Free tier | Bronze tier (10% off) | Gold tier (30% off) |
|---|---|---|---|
| 100 funds | $1.00 | $0.90 | $0.70 |
| 1,000 funds | $10.00 | $9.00 | $7.00 |
| 10,000 funds | $100.00 | $90.00 | $70.00 |

Discounts follow your Apify subscription tier: Bronze 10%, Silver 20%, Gold and above 30%. No subscription to this Actor and no charge for platform usage: you pay only for results.
The Apify Free plan includes $5 of monthly credit, enough for about **500 funds** at the list price.
You can cap the cost of any run with **Maximum cost per run**; the Actor stops when it is reached.

### Data source

- **CVM Portal de Dados Abertos** (`dados.cvm.gov.br`): *Fundos de Investimento: Documentos: Informe Diário* (monthly ZIPs in `DADOS`, older years in `DADOS/HIST`) and *Fundos de Investimento: Informação Cadastral* (`registro_fundo_classe.zip`). Published under the **Open Data Commons Open Database License (ODbL)**. Source: CVM. Results of this Actor are a derived database and are offered under the same license.
- **Banco Central do Brasil, SGS series 12** (daily CDI rate, `api.bcb.gov.br`), from BCB's open data portal (ODbL).
- Personal data: when a fund's manager is a natural person, the registry lists a name and CPF; this Actor returns neither. The administrator's director name is never returned.
- **Availability:** both sources are Brazilian government servers, which sometimes refuse connections from outside Brazil or go down for maintenance. If CVM cannot be reached the run stops with a clear message and nothing is charged. If only BCB is down, the CDI comes from a reference copy bundled with the Actor at build time (the item says so in `warnings`), or the CDI fields stay empty.
- Data is as filed by the funds. CVM publishes the current month's file during the month and funds can resubmit past days, so very recent values may change. If CVM has not published a month yet, the metrics stop at the last quota available and the log says which months were missing.

This Actor is independent and is not affiliated with, endorsed by or sponsored by CVM or Banco Central do Brasil; their names are used only to describe where the data comes from.

### More questions

#### Are the returns net of fees and taxes?

Net of management and performance fees, gross of income tax. They are calculated from the quota value the fund reports to CVM every day, which already has fees deducted; taxes are charged on redemption and are not in the quota.

#### How recent is the data?

As recent as the funds' daily reports to CVM. CVM publishes the current month's file during the month and the Actor downloads it again on every run; `periodEnd` and `netAssetsDate` show the date of the last values used. Funds can resubmit past days, so the most recent values may change slightly.

#### Why do YTD and 12-month returns appear even when my period is short?

The Actor always reads the months it needs for them (the 12 months before the end date and the start of the year), whatever period you choose. `periodReturnPct` covers your `startDate`–`endDate`; `ytdReturnPct` and `return12mPct` always end at the last quota. A metric stays empty when the fund has no quota close enough to its base date, for example a fund created this year has no 12-month return.

#### How do I compare funds in a category, such as "Renda Fixa"?

Use `classification` (CVM or ANBIMA class, such as `Renda Fixa`, `Multimercado`, `Ações`, `Cambial`), optionally with `fundNameContains` and `fundTypes`. The largest funds by net assets come first, up to `maxFunds` (default 3, maximum 200). Leave `compareWithCdi` on to get `pctOfCdi12m` and the other % of CDI fields for a quick ranking.

#### Can I analyze more than 3 years?

No: a run covers up to 36 months, because each month is a separate CVM file of about 25 MB. For longer histories, run several periods and join the `monthlyReturns` arrays.

#### Why did my fund come back as several results?

Under CVM Resolution 175 a fund can have several classes, each with its own CNPJ and quota, and a class can report by subclass. A fund CNPJ with classes expands to one result per class (`requestedCnpj` shows what you asked for), and with `includeSubclasses` on each subclass is a separate result. Turn `includeSubclasses` off to keep only the class-level result; a class that reports only by subclass still returns its subclasses.

#### Does it cover FIIs, FIDCs and other funds?

Only funds that file the daily report (informe diário) with CVM, which includes fixed income, multimarket, equity and FX funds. Funds found by the filters that do not file daily reports, such as most FIIs and FIDCs, are skipped. A CNPJ you pass without daily reports in the period comes back with `status: "no_data"` and is not charged.

#### Where does the CDI come from?

From the Central Bank's SGS series 12 (daily CDI), compounded over the same business days as the fund. If the Central Bank API is down, the Actor uses a reference copy bundled with it and says so in `warnings`; without it, the CDI fields stay empty and the fund metrics are still returned.

### Use it via API

Run it from any language and get the results as JSON. Replace `<YOUR_API_TOKEN>` with your [Apify API token](https://console.apify.com/settings/integrations).

```bash
curl -X POST "https://api.apify.com/v2/acts/br_data_hub~br-cvm-fund-performance/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"fundNameContains": "TESOURO SELIC"}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("br_data_hub/br-cvm-fund-performance").call(run_input={'fundNameContains': 'TESOURO SELIC'})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

You can also schedule runs, send results to webhooks, or connect the Actor to Make, Zapier, n8n, Google Sheets and other [integrations](https://docs.apify.com/platform/integrations).

### Use it with AI agents (MCP)

This Actor is ready for AI agents: typed input and output schemas, pay-per-event pricing, limited permissions and short runs.

- **Apify MCP server:** add `https://mcp.apify.com/?tools=br_data_hub/br-cvm-fund-performance` to Claude, ChatGPT, Cursor, VS Code or any MCP client, and the agent can call this Actor as a tool.
- **Agent frameworks:** call it from LangChain, LlamaIndex, CrewAI or the OpenAI Agents SDK through the Apify integrations, or with the API call above.
- Results come as structured JSON with stable field names, documented in the **Output** tab.

### FAQ

#### Where does the data come from?

- **CVM Portal de Dados Abertos** (`dados.cvm.gov.br`): *Fundos de Investimento: Documentos: Informe Diário* (monthly ZIPs in `DADOS`, older years in `DADOS/HIST`) and *Fundos de Investimento: Informação Cadastral* (`registro_fundo_classe.zip`). Published under the **Open Data Commons Open Database License (ODbL)**. Source: CVM. Results of this Actor are a derived database and are offered under the same license. - **Banco Central do Brasil, SGS series 12** (daily CDI rate, `api.bcb.gov.br`), from BCB's open data portal (ODbL). - Personal data: when a fund's manager is a natural person, the registry lists a name and CPF; this Actor returns neither. The administrator's director name is never returned. - **Availability:** both sources are Brazilian government servers, which sometimes refuse connections from outside Brazil or go down for maintenance. If CVM cannot be reached the run stops with a clear message and nothing is charged. If only BCB is down, the CDI comes from a reference copy bundled with the Actor at build time (the item says so in `warnings`), or the CDI fields stay empty. - Data is as filed by the funds. CVM publishes the current month's file during the month and funds can resubmit past days, so very recent values may change. If CVM has not published a month yet, the metrics stop at the last quota available and the log says which months were missing.

#### How much does it cost?

$0.01 per fund. Discounts follow your Apify subscription tier: Bronze 10%, Silver 20%, Gold and above 30%. See **How much does it cost?** above for examples.

#### Do I pay for errors or empty results?

No. Charged once per fund returned with metrics. Funds not found or without data are free.

#### Can I run it on a schedule or connect it to other tools?

Yes. Use Apify schedules to run it daily or weekly, webhooks to get notified, and integrations such as Make, Zapier, n8n and Google Sheets. Everything also works through the API.

#### Can AI agents use it?

Yes. It works as a tool in the Apify MCP server and in agent frameworks, and AI agents can pay per event. See **Use it with AI agents (MCP)**.

#### Is it legal to use this data?

The Actor reads only public, official sources and keeps personal data masked as the source publishes it. You are responsible for how you use the data, including LGPD compliance.

#### I found a bug or need a feature. What should I do?

Open an issue in the **Issues** tab. We answer within 14 days, usually much sooner.

### More Actors from BR Data Hub

| Actor | What it does |
|---|---|
| [Brazil Exchange Rates API (Cotação PTAX)](https://apify.com/br_data_hub/br-exchange-rates) | Get official PTAX exchange rates from Banco Central do Brasil: buy and sell rates in BRL, parities and bulleti |
| [Brazil Treasury Bonds API (Tesouro Direto)](https://apify.com/br_data_hub/br-tesouro-direto) | Daily rates and unit prices of Brazilian Treasury bonds (Tesouro Direto: Selic, Prefixado, IPCA+, Renda+, Educ |
| [Brazil Inflation Calculator (IPCA, IGP-M, Selic)](https://apify.com/br_data_hub/br-monetary-correction) | Correct BRL amounts in bulk by IPCA, INPC, IGP-M, IGP-DI, IPC-Fipe, Selic, CDI, TR or savings (poupança) using |
| [Brazil Company Financials (CVM DFP/ITR, B3)](https://apify.com/br_data_hub/br-cvm-company-financials) | Standardized financial statements of Brazilian listed companies from CVM open data (DFP annual, ITR quarterly) |
| [Brazil Fuel Prices by City (ANP Combustíveis)](https://apify.com/br_data_hub/br-anp-fuel-prices) | Weekly fuel prices in Brazil from the ANP open data survey (not affiliated with the ANP): average, minimum, ma |

See all our Actors at [apify.com/br_data_hub](https://apify.com/br_data_hub).

### Usar em português

**Rentabilidade e métricas prontas de fundos de investimento brasileiros**, calculadas a partir dos dados abertos da CVM (informe diário e cadastro) e do CDI do Banco Central (SGS, série 12).

**Para que serve:** comparar fundos de uma categoria, acompanhar a carteira de fundos de um cliente, montar um ranking em % do CDI, alimentar um painel ou um agente de IA com rentabilidade, risco e patrimônio, sem baixar e tratar os arquivos diários da CVM.

**Como usar em 3 passos:**

1. Informe os fundos: CNPJs em `cnpjs` (com ou sem pontuação, inclusive o CNPJ alfanumérico), ou um trecho do nome em `fundNameContains`, ou uma classificação em `classification` (por exemplo `Renda Fixa`, `Multimercado`, `Ações`). Com filtros, `maxFunds` limita quantos fundos entram (padrão 3, máximo 200), dos maiores para os menores em patrimônio.
2. Escolha o período em `startDate` e `endDate` (AAAA-MM-DD, até 36 meses; sem datas, os últimos 12 meses).
3. Deixe `compareWithCdi` ligado para ter a comparação com o CDI e rode. Baixe em JSON, CSV ou Excel.

**Exemplo de entrada:**

```json
{"classification": "Multimercado", "maxFunds": 10, "startDate": "2025-11-01", "endDate": "2026-10-31", "compareWithCdi": true}
```

**Campos principais:** `cnpjFormatted`, `name` (nome da classe), `fundName`, `classification` e `anbimaClassification`, `periodReturnPct` (rentabilidade no período), `ytdReturnPct` (no ano), `return12mPct` (12 meses), `annualizedVolatilityPct`, `maxDrawdownPct`, `netAssetsBrl` (patrimônio líquido), `netInflowBrl` (captação líquida), `shareholders` (cotistas), `pctOfCdiPeriod`, `pctOfCdi12m`, `monthlyReturns` (mês a mês, com o CDI) e `status`.

**Bom saber:**

- A rentabilidade é líquida de taxas e bruta de imposto de renda, como na cota informada pelo fundo.
- Volatilidade: desvio-padrão dos retornos diários × √252. Drawdown: maior queda a partir de um pico no período.
- Resolução CVM 175: fundos com classes aparecem por classe (e por subclasse, se `includeSubclasses` estiver ligado). `requestedCnpj` mostra o CNPJ que você pediu.
- Fundos que não entregam informe diário (como a maioria dos FIIs e FIDCs) ficam de fora.
- Se a CVM estiver fora do ar ou recusar a conexão, a execução para com mensagem clara e sem cobrança.

**O que é grátis:** CNPJ inválido, fundo sem dados no período (`status: "no_data"`) e erros. Você paga por fundo (classe ou subclasse) devolvido com métricas, evento `fund`, mais o evento padrão de início de execução da Apify (`apify-actor-start`). Não é recomendação de investimento. Fontes: CVM – Portal Dados Abertos e Banco Central do Brasil (licença ODbL). Ferramenta independente, sem vínculo com a CVM ou o Banco Central.

**Quanto custa:** $0.01 por resultado (`fund`); 1.000 resultados saem por $10.00. Desconto pelo nível da assinatura Apify: Bronze 10%, Silver 20%, Gold ou acima 30%. Erros e consultas sem resultado não são cobrados. Use também pela API ou por agentes de IA no servidor MCP da Apify (`https://mcp.apify.com/?tools=br_data_hub/br-cvm-fund-performance`).

# Actor input Schema

## `fundNameContains` (type: `string`):

Type part of a fund or class name, e.g. TESOURO SELIC (case and accents ignored). The largest funds by net assets come first, up to 'Max funds from filters'.

## `cnpjs` (type: `array`):

Enter fund or class CNPJs, one per line, with or without punctuation (numeric or the new alphanumeric format). A fund with classes under CVM Resolution 175 returns one result per class (and per subclass).

## `startDate` (type: `string`):

Pick the first day of the analysis period (YYYY-MM-DD). Leave empty for 12 months before the period end.

## `endDate` (type: `string`):

Pick the last day of the analysis period (YYYY-MM-DD). Leave empty for today; metrics use the last quota CVM published up to this date.

## `compareWithCdi` (type: `boolean`):

Keep on to add the CDI accumulated over the same dates (Banco Central SGS series 12) and the fund return as % of CDI.

## `classification` (type: `string`):

Type a CVM or ANBIMA classification to filter the name search, e.g. Renda Fixa, Multimercado, Ações or Cambial. Leave empty for all.

## `fundTypes` (type: `array`):

Enter CVM fund types to filter the name or classification search, e.g. FIF, FI, FIC. Leave empty for all types.

## `maxFunds` (type: `integer`):

Set how many fund classes to take from the name or classification filters, largest first, e.g. 3. CNPJs you list are always included.

## `includeSubclasses` (type: `boolean`):

Keep on to return one result per share subclass (CVM Resolution 175) when the class reports by subclass. Turn off for class-level results only (classes that report only by subclass are still returned).

## `includeCancelled` (type: `boolean`):

Turn on to let the name and classification filters match cancelled funds and classes too, useful for historical periods.

## Actor input object example

```json
{
  "fundNameContains": "TESOURO SELIC",
  "cnpjs": [],
  "compareWithCdi": true,
  "maxFunds": 3,
  "includeSubclasses": true,
  "includeCancelled": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset with all results

## `files` (type: `string`):

Key-value store with the files and the OUTPUT summary of the run

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "fundNameContains": "TESOURO SELIC"
};

// Run the Actor and wait for it to finish
const run = await client.actor("br_data_hub/br-cvm-fund-performance").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "fundNameContains": "TESOURO SELIC" }

# Run the Actor and wait for it to finish
run = client.actor("br_data_hub/br-cvm-fund-performance").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fundNameContains": "TESOURO SELIC"
}' |
apify call br_data_hub/br-cvm-fund-performance --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,br_data_hub/br-cvm-fund-performance"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/h0qpGXLZvNmmZSEYE/builds/hfDS1Pwd3LV6yApVe/openapi.json
