# Spain Medicines Catalogue (CIMA / AEMPS) (`innovito/cima-medicamentos-aemps`) Actor

Official Spanish medicines from the CIMA / AEMPS Open Data API: name, registration number, active ingredient, laboratory, prescription status and official SmPC/PIL links. No package photos, no login.

- **URL**: https://apify.com/innovito/cima-medicamentos-aemps.md
- **Developed by:** [Asier Sanchez](https://apify.com/innovito) (community)
- **Categories:** Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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

## Spain Medicines Catalogue (CIMA / AEMPS)

Get official **Spanish medicines** from the CIMA / AEMPS Open Data catalogue as clean JSON or CSV rows.

The Actor calls the **official CIMA REST API**. No HTML scraping, no login and no API key. It returns registration data, active ingredients, laboratory, prescription status and official SmPC/PIL links. **Package photographs are never stored.**

Ideal for healthtech, online pharmacies, pharmacovigilance and AI/MCP agents that need the official CIMA page.

### What you get

| Field | Description |
|---|---|
| `registrationNumber` | Official CIMA `nregistro` |
| `name`, `activeIngredients`, `atc` | Product name, principio activo and ATC when present |
| `laboratory`, `marketingLaboratory` | Holder / marketing laboratory |
| `requiresPrescription`, `prescriptionStatus` | Prescription flag and official wording |
| `generic`, `commercialized` | Generic and commercialized flags |
| `pharmaceuticalForm`, `dose`, `route` | Form, strength and route |
| `cimaUrl` | Official CIMA detail page |
| `fichaTecnicaUrl`, `prospectoUrl` | Official SmPC and patient leaflet links |
| `sourceAttribution` | Required credit line for AEMPS / CIMA |

### Input example

```json
{
  "name": "ibuprofeno",
  "commercializedOnly": false,
  "enrichDetails": false,
  "maxItems": 15
}
```

You can also search by `activeIngredient`, `laboratory` (e.g. `Cinfa`) or `registrationNumber` (e.g. `67939`). At least one of those criteria is required.

### Output example

```json
{
  "registrationNumber": "67939",
  "name": "IBUPROFENO (ARGININA) CINFA 600 mg GRANULADO PARA SOLUCION ORAL EFG",
  "activeIngredients": "ibuprofeno",
  "atc": null,
  "laboratory": "Laboratorios Cinfa S.A.",
  "marketingLaboratory": "Laboratorios Cinfa S.A.",
  "prescriptionStatus": "Medicamento Sujeto A Prescripción Médica",
  "requiresPrescription": true,
  "generic": true,
  "commercialized": true,
  "pharmaceuticalForm": "SOLUCIÓN/SUSPENSIÓN ORAL",
  "dose": "600 MG IBUPROFENO/SOBRE MONODOSIS",
  "route": "VÍA ORAL",
  "authorizationDate": "2006-07-06",
  "orphan": false,
  "biosimilar": false,
  "cimaUrl": "https://cima.aemps.es/cima/publico/detalle.html?nregistro=67939",
  "fichaTecnicaUrl": "https://cima.aemps.es/cima/dochtml/ft/67939/FT_67939.html",
  "fichaTecnicaPdfUrl": "https://cima.aemps.es/cima/pdfs/ft/67939/FT_67939.pdf",
  "prospectoUrl": "https://cima.aemps.es/cima/dochtml/p/67939/P_67939.html",
  "prospectoPdfUrl": "https://cima.aemps.es/cima/pdfs/p/67939/P_67939.pdf",
  "sourceAttribution": "Fuente: CIMA, Agencia Española de Medicamentos y Productos Sanitarios (AEMPS). https://cima.aemps.es",
  "scrapedAt": "2026-11-23T21:00:00+00:00"
}
```

### Python example (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("innovito/cima-medicamentos-aemps").call(
    run_input={
        "name": "ibuprofeno",
        "enrichDetails": False,
        "maxItems": 15,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["registrationNumber"], item["name"], item.get("cimaUrl"))
```

### Pricing

Pay-per-event: $1.50 per 1,000 medicines written to the dataset, plus $0.00005 per Actor start. You are not charged for platform compute.

### Data source and terms

- API: `https://cima.aemps.es/cima/rest/medicamentos` ([CIMA REST documentation](https://cima.aemps.es/cima/resources/docs/CIMA_REST_API.pdf)). `robots.txt` does not disallow `/cima/rest/`.
- Credit the Agencia Española de Medicamentos y Productos Sanitarios (AEMPS / CIMA). Do not present this Actor as an official AEMPS product.
- Package photos are not stored (laboratory copyright). The Actor does not invent a retail price.

***

## Catálogo de medicamentos de España (CIMA / AEMPS)

Extrae los **medicamentos oficiales** del catálogo CIMA de la AEMPS en filas JSON o CSV.

Usa la **API REST oficial de CIMA**. Sin scraping HTML, sin inicio de sesión y sin clave. Devuelve número de registro, principio activo, laboratorio, receta y enlaces oficiales a ficha técnica y prospecto. **Nunca guarda fotos de envase.**

Ideal para healthtech, farmacias online, farmacovigilancia y agentes de IA o MCP que necesitan la ficha oficial de CIMA.

### Qué devuelve

| Campo | Descripción |
|---|---|
| `registrationNumber` | Número de registro CIMA (`nregistro`) |
| `name`, `activeIngredients`, `atc` | Nombre, principio activo y ATC, si consta |
| `laboratory`, `marketingLaboratory` | Titular / laboratorio comercializador |
| `requiresPrescription`, `prescriptionStatus` | Receta y texto oficial |
| `generic`, `commercialized` | Indicadores de genérico y comercialización |
| `pharmaceuticalForm`, `dose`, `route` | Forma, dosis y vía |
| `cimaUrl` | Ficha pública oficial en CIMA |
| `fichaTecnicaUrl`, `prospectoUrl` | Enlaces oficiales a FT y prospecto |
| `sourceAttribution` | Línea de atribución obligatoria (AEMPS / CIMA) |

### Ejemplo de entrada

```json
{
  "name": "ibuprofeno",
  "commercializedOnly": false,
  "enrichDetails": false,
  "maxItems": 15
}
```

También puedes buscar por `activeIngredient`, `laboratory` (p. ej. `Cinfa`) o `registrationNumber` (p. ej. `67939`). Hace falta al menos uno de esos criterios.

### Ejemplo de salida

```json
{
  "registrationNumber": "67939",
  "name": "IBUPROFENO (ARGININA) CINFA 600 mg GRANULADO PARA SOLUCION ORAL EFG",
  "activeIngredients": "ibuprofeno",
  "laboratory": "Laboratorios Cinfa S.A.",
  "requiresPrescription": true,
  "commercialized": true,
  "cimaUrl": "https://cima.aemps.es/cima/publico/detalle.html?nregistro=67939",
  "sourceAttribution": "Fuente: CIMA, Agencia Española de Medicamentos y Productos Sanitarios (AEMPS). https://cima.aemps.es"
}
```

### Ejemplo en Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("innovito/cima-medicamentos-aemps").call(
    run_input={"name": "ibuprofeno", "enrichDetails": False, "maxItems": 15}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["registrationNumber"], item["name"], item.get("cimaUrl"))
```

### Precio

Pago por uso: 1,50 $ por cada 1.000 medicamentos escritos en el dataset, más 0,00005 $ por arranque. No se cobra el cómputo de la plataforma.

### Origen y condiciones

- API: `https://cima.aemps.es/cima/rest/medicamentos` ([documentación CIMA REST](https://cima.aemps.es/cima/resources/docs/CIMA_REST_API.pdf)). `robots.txt` no prohíbe `/cima/rest/`.
- Hay que citar a la Agencia Española de Medicamentos y Productos Sanitarios (AEMPS / CIMA). Este Actor no es un producto oficial de la AEMPS.
- No se guardan fotos de envase (copyright de los laboratorios). El Actor no inventa un precio de venta.

# Actor input Schema

## `name` (type: `string`):

Search by medicinal product name, e.g. <code>ibuprofeno</code>, <code>paracetamol</code>. At least one of name, active ingredient, laboratory or registration number is required.

## `activeIngredient` (type: `string`):

Search by active substance (principio activo), e.g. <code>ibuprofeno</code>.

## `laboratory` (type: `string`):

Marketing or holder laboratory name, e.g. <code>Cinfa</code>.

## `registrationNumber` (type: `string`):

Official CIMA registration number (<code>nregistro</code>), e.g. <code>67939</code>.

## `commercializedOnly` (type: `boolean`):

If enabled, keep only medicines currently marked as commercialized.

## `keywords` (type: `array`):

Optional extra filter on name, ingredient or laboratory (case-insensitive). Spanish examples: <code>dolor</code>, <code>genérico</code>, <code>cinfa</code>.

## `enrichDetails` (type: `boolean`):

If enabled, call the official detail endpoint for each medicine (ATC, extra dates). Slower; one extra request per row. Default off.

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

Stop after this many medicines. 0 = no limit (still capped at 20 API pages).

## Actor input object example

```json
{
  "commercializedOnly": false,
  "enrichDetails": false,
  "maxItems": 50
}
```

# Actor output Schema

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

Dataset of official Spanish medicines from the CIMA / AEMPS Open Data API (one row per medicinal product). Package photos are never stored.

## `runStats` (type: `string`):

RUN_STATS record: pages fetched, medicines parsed and pushed, filters applied.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("innovito/cima-medicamentos-aemps").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("innovito/cima-medicamentos-aemps").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 '{}' |
apify call innovito/cima-medicamentos-aemps --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,innovito/cima-medicamentos-aemps"
        }
    }
}
```

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/k6MbsWvQGz5sKAVYk/builds/fQVOSLiMAIiVh4VS1/openapi.json
