# ANVISA Radar de Registros (`kman-br/anvisa-radar-registros`) Actor

Registros de medicamentos, mudanças, vencimentos e concorrência, com prioridade Alzheimer e proveniência oficial.

- **URL**: https://apify.com/kman-br/anvisa-radar-registros.md
- **Developed by:** [Kman](https://apify.com/kman-br) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 registro de medicamentos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## ANVISA Radar de Registros

### Português

Monitore registros públicos de medicamentos da ANVISA: fotografia atual, mudanças entre coletas, vencimentos e concorrência por princípio ativo. Os medicamentos da lista Alzheimer aparecem primeiro e recebem `prioridade: true`.

Clique em **Try for free**, mantenha o input padrão e inicie a execução. O padrão é `snapshot`, somente registros ativos, prioridade Alzheimer e até 100 itens. A prioridade ordena a lista; para restringir a busca, informe `principios_ativos`.

```json
{
  "modo": "snapshot",
  "prioridadeTerapeutica": "alzheimer",
  "principios_ativos": ["donepezila", "rivastigmina", "galantamina", "memantina"],
  "somente_ativos": true,
  "maxItems": 100
}
```

#### Modos e filtros

| Campo | Uso / padrão |
|---|---|
| `modo` | `snapshot`, `diff`, `vencendo` ou `concorrencia`; padrão `snapshot` |
| `prioridadeTerapeutica` | `alzheimer` (padrão) ou `nenhuma` |
| `principios_ativos` | Lista de trechos de princípios ativos; vazia por padrão |
| `cnpjs_detentores` | Lista de CNPJs exatos com 14 dígitos; vazia por padrão |
| `classes_terapeuticas`, `categorias` | Listas de trechos; vazias por padrão |
| `meses_vencimento` | Janela futura de vencimento; padrão 12 meses |
| `somente_ativos` | Padrão `true`; alertas de inativação continuam presentes no diff |
| `maxItems` | Limite de itens válidos; padrão 100 |
| `timeoutSecs` | Timeout por tentativa de download; padrão 120 segundos |

Os filtros de texto ignoram acentos e maiúsculas; alternativas dentro de uma lista usam OU e listas diferentes usam E. A prioridade inclui donepezila, rivastigmina, galantamina, memantina e combinações, além de lecanemabe e donanemabe quando presentes na fonte. Ela identifica princípios da lista, sem inferir indicação clínica para cada registro.

`snapshot` entrega registros únicos pelo número de registro. Linhas repetidas são consolidadas pela data de finalização mais recente; empate preserva a primeira linha. Linhas sem número válido são excluídas e contabilizadas no resumo.

`diff` compara a coleta com o estado anterior salvo em um Key-Value Store persistente. Emite `NOVO_REGISTRO`, `CANCELADO_OU_INATIVADO` e `VENCIMENTO_ALTERADO`. A primeira execução sem estado cria a referência; sem mudanças, retorna um diagnóstico gratuito. Um snapshot também cria a referência. Mantenha a mesma carteira de filtros e execute em sequência: execuções simultâneas no mesmo estado não são suportadas. Alertas não entregues por limite ficam pendentes. Desaparecimento da base não prova cancelamento; somente a transição explícita para Inativo gera esse alerta.

`vencendo` entrega registros ativos cujo vencimento está entre hoje e a janela configurada, inclusive. Dentro de cada grupo de prioridade, ordena pela data. Registros já vencidos ficam fora dessa janela futura.

`concorrencia` entrega uma linha por texto completo de princípio ativo normalizado, usando um registro representativo. Combinações e sais diferentes permanecem grupos distintos. A análise conta registros ativos, CNPJs distintos, genéricos e similares; traz o registro com data de finalização mais recente. O índice de saturação é registros ativos dividido por detentores conhecidos, com zero quando não há CNPJ disponível; é uma métrica descritiva, sem estimativa de participação de mercado.

#### Saída, fonte e privacidade

Cada item contém `numero_registro`, `produto`, `principio_ativo`, `categoria`, `classe`, `detentor_cnpj`, `detentor_razao`, `situacao`, `vencimento`, `data_registro`, `evento`, `prioridade`, `source_url`, `source_name`, `source_sha256`, `source_row`, `retrieved_at`, `warnings` e `status`. O resumo fica em **RUN_SUMMARY** no Key-Value Store padrão, com contagens, falhas, hash da fonte e eventos cobrados.

A fonte é o [CSV oficial de medicamentos da ANVISA](https://dados.anvisa.gov.br/dados/DADOS_ABERTOS_MEDICAMENTOS.csv), consultado uma vez por execução bem-sucedida. O hash identifica a resposta inteira, e `source_row` aponta a linha dessa resposta. `retrieved_at` usa ISO 8601 com `-03:00`. A fonte informa vencimento em mês/ano; o último dia do mês é uma convenção de saída. `data_registro` corresponde à data de finalização do processo na fonte.

Ausências e valores inválidos viram `null` com aviso. `status` diferencia `ok`, `sem_resultado`, `fonte_indisponivel` e `erro`; falhas não se passam por buscas vazias. A disponibilidade e atualização dependem da ANVISA. Valores de situação desconhecidos não são inferidos.

São usados apenas dados públicos de produto e empresa. Responsável técnico e campos de pessoas não fazem parte da saída. Nomes de detentores só ficam completos quando possuem marcador explícito de pessoa jurídica; os demais são mascarados com aviso. CPF e email encontrados em campos de texto são omitidos. O CSV não distingue fabricante físico de detentor: o Actor informa apenas o detentor.

A cobrança por evento se aplica somente a linhas válidas entregues. Diagnósticos e ausência de resultados não geram evento de valor; não há evento de início. A execução para ao alcançar o teto de cobrança. Consulte a aba **Pricing** para condições vigentes.

### English

Track ANVISA's public medicine registrations through snapshots, changes, upcoming expirations and competition by active ingredient. Click **Try for free**, keep the defaults and start. Default input requests up to 100 active registrations and places Alzheimer's ingredients first, with `prioridade: true`. Priority sorts results; `principios_ativos` restricts the search.

Available modes are `snapshot`, `diff`, `vencendo` and `concorrencia`. Text filters match substrings without case or accent sensitivity; CNPJ filters match exact 14-digit strings. Alternatives within a list use OR; different filter lists use AND. Default expiration window is 12 months, timeout 120 seconds, `somente_ativos: true` and `prioridadeTerapeutica: alzheimer`. Set priority to `nenhuma` to disable it.

Snapshots consolidate repeated registration numbers using the latest process completion date, retaining the first row on ties. Diff uses a persistent named Key-Value Store and emits new registrations, explicit active-to-inactive transitions and changed expiration dates. A first diff creates its baseline; a snapshot also establishes a baseline. Reuse the same filter portfolio and run sequentially. Concurrent runs sharing state are unsupported. Undelivered alerts remain pending after limits. Disappearance from the CSV does not establish cancellation.

Expiration mode includes active registrations from today through the configured future window, ordered by priority and then expiration. Competition mode groups by the complete normalized ingredient text: salts and combinations remain separate. It counts distinct registrations and holders, generic/similar registrations, and the latest process completion. Saturation equals active registrations divided by known holders, or zero when none are known; this is descriptive rather than a market-share estimate.

The [official ANVISA CSV](https://dados.anvisa.gov.br/dados/DADOS_ABERTOS_MEDICAMENTOS.csv) is downloaded once per successful run. Every item includes its source URL, name, response SHA-256, original row number, retrieval timestamp with `-03:00`, warnings and status. Expiration is supplied as month/year; output uses that month's last day by convention. Missing or invalid fields become `null` with warnings. RUN_SUMMARY in the default Key-Value Store reports counts, source failures, hashes and charged events. Status distinguishes valid results, no matches, unavailable source and processing errors.

Only public product and company fields are returned. Technical representatives and person fields are omitted. Holder names require an explicit legal-entity marker to remain visible; other names are masked. CPF identifiers and emails in text are removed. The source identifies registration holders rather than physical manufacturers. Priority recognizes ingredients from the Alzheimer's list without inferring a clinical indication for each product.

Only valid delivered rows request a billing event. Diagnostics and no matches are free of value events, with no start event; delivery stops at the spending limit. See **Pricing** for current terms. Source availability and freshness depend on ANVISA.

### Limite conhecido

Se o run travar perto do fim e o watchdog de último recurso (a 15 s do `ACTOR_TIMEOUT_AT`) encerrar o processo, no máximo **1 item em voo** pode ser cobrado de novo no run seguinte (no máximo US$ 0,02). No caminho normal o runner para no prazo e salva os pendentes, sem cobrança dupla.

# Actor input Schema

## `modo` (type: `string`):

snapshot = lista registros; diff = mudanças desde o último run; vencendo = registros perto do vencimento; concorrencia = detentores por princípio ativo.

## `prioridadeTerapeutica` (type: `string`):

Alzheimer aparece primeiro. Não restringe a busca; use principios_ativos para restringir.

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

Limite de linhas entregues (e cobradas) neste run.

## `meses_vencimento` (type: `integer`):

Usado no modo vencendo: registros que vencem nos próximos N meses.

## `somente_ativos` (type: `boolean`):

No diff, transições para Inativo são preservadas mesmo com este filtro.

## `timeoutSecs` (type: `integer`):

Segundos por tentativa de download da fonte ANVISA (limitado também pelo prazo do run).

## `principios_ativos` (type: `array`):

Filtra por princípio ativo (ex.: donepezila). Vazio = todos.

## `cnpjs_detentores` (type: `array`):

Filtra por CNPJ do detentor do registro, 14 dígitos sem pontuação. Vazio = todos.

## `classes_terapeuticas` (type: `array`):

Filtra por classe terapêutica (texto da ANVISA). Vazio = todas.

## `categorias` (type: `array`):

Filtra por categoria regulatória (ex.: Genérico, Similar). Vazio = todas.

## Actor input object example

```json
{
  "modo": "snapshot",
  "prioridadeTerapeutica": "alzheimer",
  "maxItems": 100,
  "meses_vencimento": 12,
  "somente_ativos": true,
  "timeoutSecs": 120,
  "principios_ativos": [],
  "cnpjs_detentores": [],
  "classes_terapeuticas": [],
  "categorias": []
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "modo": "snapshot",
    "prioridadeTerapeutica": "alzheimer",
    "maxItems": 100,
    "meses_vencimento": 12,
    "somente_ativos": true,
    "timeoutSecs": 120,
    "principios_ativos": [],
    "cnpjs_detentores": [],
    "classes_terapeuticas": [],
    "categorias": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/anvisa-radar-registros").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 = {
    "modo": "snapshot",
    "prioridadeTerapeutica": "alzheimer",
    "maxItems": 100,
    "meses_vencimento": 12,
    "somente_ativos": True,
    "timeoutSecs": 120,
    "principios_ativos": [],
    "cnpjs_detentores": [],
    "classes_terapeuticas": [],
    "categorias": [],
}

# Run the Actor and wait for it to finish
run = client.actor("kman-br/anvisa-radar-registros").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 '{
  "modo": "snapshot",
  "prioridadeTerapeutica": "alzheimer",
  "maxItems": 100,
  "meses_vencimento": 12,
  "somente_ativos": true,
  "timeoutSecs": 120,
  "principios_ativos": [],
  "cnpjs_detentores": [],
  "classes_terapeuticas": [],
  "categorias": []
}' |
apify call kman-br/anvisa-radar-registros --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kman-br/anvisa-radar-registros"
        }
    }
}
```

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/xavZ1EvDNQpujlQTm/builds/K2WrH7C4deznfnjgU/openapi.json
