# Brazil ANVISA Medicines & CMED Prices Scraper (`cvillasanti/brazil-anvisa-medicines`) Actor

Search Brazil's official ANVISA medicine registry by name, active ingredient, company, registration number or EAN barcode, with CMED maximum prices per presentation.

- **URL**: https://apify.com/cvillasanti/brazil-anvisa-medicines.md
- **Developed by:** [Ciro Villasanti](https://apify.com/cvillasanti) (community)
- **Categories:** Business, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 medicines

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

## Brazil ANVISA Medicines & CMED Prices Scraper

Search **every medicine registered with ANVISA**, Brazil's health regulator, and get clean JSON with the **registration number, status, expiry, holder company (CNPJ), active ingredients, regulatory category** and, for each presentation, the **EAN barcodes and CMED maximum prices** (factory price PF and maximum consumer price PMC by ICMS rate).

The Actor reads ANVISA's official open-data files and joins two datasets that are published separately: the medicine registry (*Medicamentos registrados*) and the CMED price list (*Lista de preços de medicamentos*). You get one record per registration with all its presentations and prices nested inside.

- ✅ **Official source:** ANVISA open data. No login, no captcha, no browser, no scraping of fragile web pages.
- ✅ **Fast and reliable:** a search over the whole registry takes about 15 seconds.
- ✅ **Registry and prices together:** search by name, ingredient, company, registration number or EAN barcode.
- ✅ **Ready for AI agents and MCP:** flat English field names and a fully described output schema.

### What data does it extract?

| Field | Example |
|---|---|
| Product name and active ingredients | `EUTHYROX`, `levotiroxina sódica` |
| Registration number, process number | `100890202`, `250000069099013` |
| Status, approval date, expiry month | `active`, `1996-03-01`, `2036-03` |
| Regulatory category and therapeutic class | `Similar`, `HORMONIOS TIREOIDEANOS…` |
| Holder company and CNPJ | `MERCK S/A`, `33069212000184` |
| **Presentations** (optional) | 13-digit code, EAN barcodes, description, stripe (*tarja*), hospital-only flag |
| **CMED prices** (optional) | PF and PMC without taxes and for every ICMS rate (0%, 12%, 17%, 18%, …) |

### Use cases

- **Pharmacies and distributors:** check the legal maximum price (PMC) of every product you sell, by EAN.
- **Pharma market intelligence:** list every generic or similar registered for an active ingredient, with holders and prices.
- **Regulatory monitoring:** track registrations that are expiring or have become inactive for a company (CNPJ).
- **E-commerce and healthtech catalogs:** enrich products with ANVISA registration, ingredients and therapeutic class.

### Input examples

**Every active medicine containing dipirona, with prices:**

```json
{
    "searchTerms": ["dipirona"],
    "maxItems": 500
}
```

**Look up products by EAN barcode:**

```json
{
    "eans": ["7891721014635", "7894916501729"]
}
```

**Full registry of a laboratory (by CNPJ), active and inactive:**

```json
{
    "holderCnpjs": ["33.069.212/0001-84"],
    "status": "all",
    "maxItems": 5000
}
```

**Export the whole active registry without prices:**

```json
{
    "includePrices": false,
    "maxItems": 20000
}
```

#### Input fields

| Field | Description |
|---|---|
| `searchTerms` | Product names, active ingredients or company names. Accents and case are ignored. |
| `registrationNumbers` | 9-digit ANVISA registration numbers (13-digit presentation codes also work). |
| `eans` | EAN/GTIN barcodes, looked up in the CMED price list. |
| `holderCnpjs` | CNPJ of the registration holder. |
| `status` | `active` (default), `inactive` or `all`. |
| `includePrices` | Add presentations, EANs and CMED prices (default `true`). |
| `maxItems` | Maximum number of medicines to save. |

Filters combine with AND. With no filters, the Actor exports the registry from the start of the file up to `maxItems`.

### Output example

```json
{
    "registrationNumber": "100890202",
    "processNumber": "250000069099013",
    "productName": "EUTHYROX",
    "activeIngredients": ["levotiroxina sódica"],
    "regulatoryCategory": "Similar",
    "therapeuticClass": "HORMONIOS TIREOIDEANOS SIMPLES OU ASSOCIADOS ENTRE SI",
    "holderCnpj": "33069212000184",
    "holderName": "MERCK S/A",
    "status": "active",
    "approvalDate": "1996-03-01",
    "registrationExpiry": "2036-03",
    "presentations": [
        {
            "presentationCode": "1008902020601",
            "ggremCode": "525424090054103",
            "eans": ["7891721014635"],
            "description": "25 MCG COM CT BL AL AL X 30",
            "priceRegime": "Regulado",
            "stripe": "Tarja Vermelha",
            "hospitalOnly": false,
            "marketed": false,
            "factoryPriceNoTax": 11.03,
            "maxConsumerPriceNoTax": 15.24,
            "factoryPriceByIcms": { "0": 11.16, "12": 12.68, "17": 13.45, "18": 13.61 },
            "maxConsumerPriceByIcms": { "0": 15.38, "12": 17.48, "17": 18.54, "18": 18.76 }
        }
    ],
    "registryUpdatedAt": "2026-11-20T09:33:36.000Z",
    "pricesUpdatedAt": "2026-10-09T15:43:03.000Z"
}
```

The price maps include every ICMS rate published by CMED (0, 12, 17, 17.5, 18, 19, 19.5, 20, 20.5, 21, 22, 22.5 and 23%); the example is shortened. Prices are in BRL.

### Pricing

Pay per event: you pay only for medicines saved to the dataset.

| Event | When it is charged |
|---|---|
| `medicine` | Once for every medicine (registration) saved, with all its presentations and prices included. |

Set a **maximum cost per run** in the run options and the Actor stops cleanly when it reaches it.

### Tips and limits

- ANVISA updates the registry file regularly and CMED publishes a new price list monthly. Each record includes `registryUpdatedAt` and `pricesUpdatedAt` so you know how fresh the data is.
- Only medicines with regulated or monitored prices appear in the CMED list, so some products (for example low-risk notified products) have an empty `presentations` array.
- ANVISA's file repeats each registration many times; the Actor merges them into one record. A registration is `active` if any of its rows is active.

### Use it from the API

Run the Actor and get the results in one call. This endpoint waits up to 5 minutes, so use the Python client below for longer runs:

```bash
curl -X POST "https://api.apify.com/v2/acts/cvillasanti~brazil-anvisa-medicines/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["dipirona"], "maxItems": 500}'
```

Or with the Python client (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("cvillasanti/brazil-anvisa-medicines").call(run_input={
    "searchTerms": [
        "dipirona"
    ],
    "maxItems": 500
})
for item in client.dataset(run["default_dataset_id"]).iterate_items():
    print(item)
```

It also works from Make, Zapier, n8n, Google Sheets and any AI agent through the [Apify MCP server](https://mcp.apify.com).

### FAQ

**Is this legal?** Yes. The data comes from ANVISA's official open-data portal (dados.anvisa.gov.br), published for public reuse.

**How fresh is the data?** Each run downloads the latest files from ANVISA, so you always get the current version.

**Can I use it from an AI agent?** Yes. Call it through the Apify MCP server or the API. The input and output schemas are fully described, so agents can build queries on their own.

### Em português

**Medicamentos registrados na ANVISA com preços CMED**: nome do produto, princípio ativo, número de registro, situação, categoria regulatória, classe terapêutica, empresa detentora e CNPJ, apresentações com código EAN e preços PF e PMC por alíquota de ICMS. Busque por nome ou princípio ativo e exporte para JSON, CSV ou Excel. Útil para farmácias, distribuidoras, indústria farmacêutica e análise de preços.

# Actor input Schema

## `searchTerms` (type: `array`):

Product names, active ingredients or company names, e.g. "dipirona", "Euthyrox", "EMS". Accents and case are ignored. A medicine matches if it contains any term.

## `registrationNumbers` (type: `array`):

9-digit registration numbers (13-digit presentation codes also work), punctuation allowed.

## `eans` (type: `array`):

Product barcodes (EAN/GTIN). They are looked up in the CMED price list.

## `holderCnpjs` (type: `array`):

14-digit CNPJ of the company that holds the registration, punctuation allowed.

## `status` (type: `string`):

Filter by registration status.

## `includePrices` (type: `boolean`):

Add every presentation with its EAN barcodes and the CMED maximum factory (PF) and consumer (PMC) prices by ICMS rate.

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

Stop after saving this many medicines. Leave all filters empty and raise this to export the whole registry (about 12,000 active registrations).

## Actor input object example

```json
{
  "searchTerms": [
    "dipirona"
  ],
  "status": "active",
  "includePrices": true,
  "maxItems": 20
}
```

# Actor output Schema

## `medicines` (type: `string`):

Registrations with holder, active ingredients, status and expiry.

## `prices` (type: `string`):

One row per presentation with EAN and CMED prices.

# 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 = {
    "searchTerms": [
        "dipirona"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("cvillasanti/brazil-anvisa-medicines").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 = {
    "searchTerms": ["dipirona"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("cvillasanti/brazil-anvisa-medicines").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 '{
  "searchTerms": [
    "dipirona"
  ],
  "maxItems": 20
}' |
apify call cvillasanti/brazil-anvisa-medicines --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cvillasanti/brazil-anvisa-medicines"
        }
    }
}
```

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/tZhn5dX35eare4myD/builds/zVytNUvIcfAaJUNrE/openapi.json
