# Brazil Health Insurance Data — Operadoras ANS (`matheus_dev_natal/brazil-health-insurance-ans`) Actor

Health insurance operators in Brazil from official ANS open data: registry search, complaint index (IGR) rankings, IDSS quality score, prudential class and monthly history since 2015. No scraping. | Operadoras de planos de saúde: cadastro, IGR, IDSS e histórico, direto da fonte oficial da ANS.

- **URL**: https://apify.com/matheus\_dev\_natal/brazil-health-insurance-ans.md
- **Developed by:** [Matheus Coelho](https://apify.com/matheus_dev_natal) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Brazil Health Insurance Data — Operadoras ANS

Get clean, structured data on **every health insurance operator in Brazil** — straight from ANS (Agência Nacional de Saúde Suplementar), the official regulator. No scraping, no proxies, no HTML parsing: this actor reads the regulator's official open-data files and returns normalized JSON/CSV.

**Three query modes:**

| Mode | What you get |
|---|---|
| `complaints` | Ranking of operators by the official **complaint index (IGR)** — complaints per 100,000 beneficiaries — for any month since 2015, filtered by coverage segment, operator size and modality |
| `operators` | Searchable **registry of all ~1,100 active operators**: corporate name, trade name, CNPJ, regulatory modality, headquarters city/state, registration date |
| `history` | **Monthly time series** of one operator: IGR, complaint count and beneficiary count, month by month |

**Every `complaints` and `operators` record comes enriched into a full operator dossier**, joined across four official ANS datasets by registry number:

- **IDSS** — the regulator's official quality score (0–1), latest published evaluation with its year, plus the four dimensions (care quality, access guarantee, market sustainability, process management);
- **Prudential segmentation (S1–S4)** — ANS's financial-supervision class, latest reference quarter;
- **Registry data** — CNPJ, modality, headquarters.

One row reads like: *"Unimed X — IGR 11.2, 116k beneficiaries, IDSS 0.80 (2025), class S2, Cooperativa Médica"*. No other Store actor provides this join.

### Who uses this data

- **Benefits brokers & HR teams** — compare operators by complaint index before recommending or contracting a plan; back your pitch with the regulator's own numbers.
- **Healthtechs & plan comparison sites** — a stable, official feed of operator registry + quality indicators, keyed by ANS registry number and CNPJ.
- **Market analysts & journalists** — beneficiary counts per operator per month since 2015; rankings that update monthly.
- **Compliance / due diligence** — verify an operator's registration, modality and complaint record from the primary source.

### Why this actor instead of the ANS website

The ANS publishes this data across an FTP server with latin-1 CSVs, semicolon separators, comma decimals and a TabNet interface that resists automation. This actor does the boring part for you:

- ✅ **Official source, verbatim** — reads `dadosabertos.ans.gov.br` directly; every record carries its `fonteUrl`.
- ✅ **Normalized** — UTF-8, ISO 8601 dates, numbers as numbers, CNPJ and registry numbers as zero-padded strings, stable camelCase field names.
- ✅ **Joined** — complaint-index rows come enriched with CNPJ, modality and state from the registry.
- ✅ **Honest rankings by default** — the default ranking compares only large operators (100k+ beneficiaries); the IGR of a 200-person operator is statistically meaningless next to a 3-million-person one. Include everyone with `size: "all"` if you want.
- ✅ **Deterministic & fair billing** — same input, same output; `maxItems` is strict (you never pay for one record more than you asked for); duplicates are removed before billing.

### Example output (`complaints` mode)

```json
{
  "mode": "complaints",
  "posicaoRanking": 1,
  "registroAns": "000701",
  "razaoSocial": "UNIMED SEGUROS SAÚDE S/A",
  "cnpj": "04487255000181",
  "modalidade": "Seguradora Especializada em Saúde",
  "uf": "SP",
  "cobertura": "medical",
  "igr": 66.12,
  "qtdReclamacoes": 664,
  "qtdBeneficiarios": 1004177,
  "porte": "large",
  "competencia": "2026-07",
  "competenciaBeneficiarios": "2026-06",
  "fonteUrl": "https://dadosabertos.ans.gov.br/FTP/PDA/IGR/IGR_versao_2023/pda-023-igr.csv",
  "capturadoEm": "2026-08-20T18:00:00+00:00"
}
```

### Input examples

**Top 10 large medical operators with the fewest complaints (default):**

```json
{ "mode": "complaints", "coverage": "medical", "size": "large", "order": "best", "maxItems": 10 }
```

**Broker ranking — only sellable cooperative plans (excludes self-managed "Autogestão"):**

```json
{ "mode": "complaints", "size": "large", "modality": "Cooperativa Médica", "maxItems": 10 }
```

**The 20 worst dental operators, any size, in July 2026:**

```json
{ "mode": "complaints", "coverage": "dental", "size": "all", "order": "worst", "competencia": "2026-07", "maxItems": 20 }
```

**Find an operator by name:**

```json
{ "mode": "operators", "search": "unimed", "uf": "SP", "maxItems": 25 }
```

**24-month history of one operator:**

```json
{ "mode": "history", "operatorRegistry": "005711", "coverage": "medical", "monthsBack": 24, "maxItems": 24 }
```

### Data source and update cadence

| Data | Official file | Updated |
|---|---|---|
| Operator registry | ANS PDA — `Relatorio_cadop.csv` | daily |
| Complaint index + beneficiaries | ANS PDA — IGR (2023 methodology), series since 2015-01 | monthly (~10th of the following month) |
| IDSS quality score | ANS PDA — Histórico IDSS 2016–2025 | yearly |
| Prudential segmentation | ANS PDA — Classificação prudencial | quarterly |

Notes worth knowing (all figures measured directly against the source, Aug/2026):

- The IGR follows the **2023 methodology** applied to the whole series (127k+ rows verified against the formula: complaints ÷ beneficiaries × 100,000). The beneficiary count refers to the month **before** the complaint month (`competenciaBeneficiarios`) — that is how ANS computes the index. Older months are published by ANS truncated to 1 decimal; recent months carry 2 decimals. Values are passed through exactly as published.
- **Coverage, measured:** `operators` mode reaches 100% of the 1,115 active operators. In the latest month, ~80% of active operators have complaint-index rows; the absences are structural — all 186 benefit administrators (*administradoras de benefícios*, which have no beneficiaries) plus ~40 operators without beneficiaries in the reference month. That is correct, not missing data.
- Historical complaint rows may reference operators that have since been cancelled (there are ~3,000 cancelled operators, out of scope of `operators` mode); their registry-join fields (`cnpj`, `modalidade`, `uf`) come back `null`.

Enrichment semantics worth knowing:

- `idss`/`idssAno` and `classificacaoPrudencial` always reflect the **latest published** evaluation for that operator — including on historical `complaints` rows. Operators never scored come back `null` (published as "ND" by ANS).
- The IDSS year varies by operator (an operator not evaluated in 2025 shows its 2024 or 2023 score, labeled by `idssAno`) — compare scores together with their year.

### What this actor does NOT do (v1)

- Beneficiary breakdowns by state/municipality (separate ANS dataset — planned).
- Accredited provider networks, plan prices, readjustment rates, financial statements (separate ANS datasets).
- Individual complaint content — only official aggregates.
- Accreditation status and complaint-resolution rate: ANS stopped updating those files (2020 and 2019 respectively) — including them would present stale data as current, so they are deliberately excluded.

### Privacy (LGPD)

The public registry includes personal data of each operator's legal representative — this actor **never returns it**. Institutional company contacts (phone, e-mail) are returned only when you explicitly enable `includeContacts`, and using them in compliance with LGPD is your responsibility.

### Pricing

Pay per result: you are charged only for records actually delivered to the dataset — no start fee, no charge for empty runs. `maxItems` is a hard cap.

***

### Resumo em português

Dados de **todas as operadoras de planos de saúde do Brasil**, direto dos dados abertos oficiais da ANS, em JSON/CSV limpo e normalizado:

- **`complaints`** — ranking pelo Índice Geral de Reclamações (IGR = reclamações por 100 mil beneficiários), por cobertura (médica/odontológica) e porte, para qualquer competência desde 2015. Por padrão compara só operadoras de grande porte — ranking honesto.
- **`operators`** — cadastro das ~1.100 operadoras ativas: razão social, nome fantasia, CNPJ, modalidade, cidade/UF da sede. Busca por nome sem se preocupar com acento ou maiúscula.
- **`history`** — série mensal de uma operadora: IGR, reclamações e beneficiários, mês a mês.

Casos de uso: corretoras de benefícios comparando operadoras para clientes, healthtechs e comparadores, análise de mercado, due diligence. Cobrança justa: paga só pelo que for entregue, `maxItems` é respeitado à risca, sem taxa de início. Dado pessoal de representante legal nunca é retornado; contatos institucionais só com `includeContacts` ligado.

Dúvidas ou sugestão de campo novo? Abra uma issue na aba **Issues** — respondo lá.

# Actor input Schema

## `mode` (type: `string`):

Complaint ranking: operators ordered by the official complaint index (IGR = complaints per 100,000 beneficiaries) in one month. Registry search: find operators by name, CNPJ, modality or state. Monthly history: the IGR/beneficiary series of ONE operator — requires the ANS registry number.

## `maxItems` (type: `integer`):

Maximum number of records returned in this run. The actor stops exactly at this limit — you never pay for a single item beyond it.

## `coverage` (type: `string`):

Coverage segment: medical assistance plans or dental-only plans.

## `size` (type: `string`):

Size band for the ranking. Default 'Large': the IGR of a 200-beneficiary operator against a 3-million-beneficiary one is statistically meaningless, so the default keeps the comparison honest.

## `order` (type: `string`):

Lowest complaint index first, or highest first.

## `modality` (type: `string`):

Regulatory modality, verbatim from the ANS registry. Useful to keep a broker ranking to sellable plans — picking 'Cooperativa Médica' or 'Medicina de Grupo' leaves out self-managed corporate plans (Autogestão). Also filters the registry search.

## `competencia` (type: `string`):

Format YYYY-MM (e.g. '2026-07'). Leave empty for the most recent month published by ANS. In monthly history mode this is the upper bound of the window. The series starts at 2015-01.

## `search` (type: `string`):

Free-text match against corporate and trade names, ignoring case and accents. Example: 'unimed'.

## `operatorRegistry` (type: `string`):

The operator's ANS registry number (up to 6 digits, e.g. '005711' or '5711' — leading zeros optional). Required for monthly history; optional filter in the registry search. Don't know it? Run the registry search by name first.

## `cnpj` (type: `string`):

Company CNPJ, 14 digits (punctuation accepted and ignored). Registry search only.

## `uf` (type: `string`):

State (UF) where the operator is headquartered. Registry search only.

## `includeContacts` (type: `boolean`):

Adds the company's institutional phone and e-mail, as published in the official ANS registry, to registry-search results. Off by default; using contact data in compliance with LGPD is your responsibility. Legal-representative personal data is never returned.

## `monthsBack` (type: `integer`):

How many months to return, counting back from the reference month (or from the most recent month published).

## `proxyConfiguration` (type: `object`):

Not needed in most cases — the ANS open-data server answers direct connections. Enable only if runs fail with connection or SSL errors from datacenter IPs.

## Actor input object example

```json
{
  "mode": "complaints",
  "maxItems": 10,
  "coverage": "medical",
  "size": "large",
  "order": "best",
  "includeContacts": false,
  "monthsBack": 12,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All records collected in this run, as JSON.

## `resultsCsv` (type: `string`):

The same records as CSV, ready for Excel or Google Sheets.

# 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 = {
    "mode": "complaints",
    "maxItems": 10,
    "coverage": "medical",
    "size": "large",
    "order": "best"
};

// Run the Actor and wait for it to finish
const run = await client.actor("matheus_dev_natal/brazil-health-insurance-ans").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 = {
    "mode": "complaints",
    "maxItems": 10,
    "coverage": "medical",
    "size": "large",
    "order": "best",
}

# Run the Actor and wait for it to finish
run = client.actor("matheus_dev_natal/brazil-health-insurance-ans").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 '{
  "mode": "complaints",
  "maxItems": 10,
  "coverage": "medical",
  "size": "large",
  "order": "best"
}' |
apify call matheus_dev_natal/brazil-health-insurance-ans --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,matheus_dev_natal/brazil-health-insurance-ans"
        }
    }
}

```

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/lcQNfEMyEULKRMkpO/builds/UWhY3hlPGjlMfyyOx/openapi.json
