Quickstart
Get an API key, search a medicine and read the result. It takes about five minutes.
1. Get an API key
Create a key on the signup page. It starts with mf_live_ and works immediately for every country. Get your API key.
Store it in an environment variable on your server:
export MEDIFONTIS_API_KEY="mf_live_…"
2. Search a medicine
Call GET /v1/drugs with a country code and a query:
curl -G https://api.medifontis.com/v1/drugs \
-H "Authorization: Bearer $MEDIFONTIS_API_KEY" \
--data-urlencode "country=es" \
--data-urlencode "q=enantyum"const params = new URLSearchParams({ country: 'es', q: 'enantyum' })
const response = await fetch(`https://api.medifontis.com/v1/drugs?${params}`, {
headers: { Authorization: `Bearer ${process.env.MEDIFONTIS_API_KEY}` },
})
if (!response.ok) throw new Error(`Medifontis ${response.status}`)
const { results, nextOffset } = await response.json()import os
import requests
response = requests.get(
"https://api.medifontis.com/v1/drugs",
params={"country": "es", "q": "enantyum"},
headers={"Authorization": f"Bearer {os.environ['MEDIFONTIS_API_KEY']}"},
timeout=10,
)
response.raise_for_status()
results = response.json()["results"]
3. Read the response
Each result is one record of one source. The fields you will use most are name, identifiers, sourceId and kind, data and licence.
{
"country": "es",
"sourceId": "es.aemps.cima",
"id": "es:cima:medicines:60927",
"kind": "medicines",
"name": "ENANTYUM 12,5 mg COMPRIMIDOS",
"data": {
"form": "COMPRIMIDO RECUBIERTO",
"name": "ENANTYUM 12,5 mg COMPRIMIDOS",
"holder": "Laboratorios Menarini S.A.",
"smpcUrl": "https://cima.aemps.es/cima/pdfs/ft/60927/FT_60927.pdf",
"doseText": "12,5 mg",
"marketed": true,
"documents": [
{
"url": "https://cima.aemps.es/cima/pdfs/ft/60927/FT_60927.pdf",
"type": 1,
"htmlUrl": "https://cima.aemps.es/cima/dochtml/ft/60927/FT_60927.html",
"modifiedAtEpochMs": 1761781853000
},
{
"url": "https://cima.aemps.es/cima/pdfs/p/60927/P_60927.pdf",
"type": 2,
"htmlUrl": "https://cima.aemps.es/cima/dochtml/p/60927/P_60927.html",
"modifiedAtEpochMs": 1761781866000
}
],
"useDomain": "human",
"leafletUrl": "https://cima.aemps.es/cima/pdfs/p/60927/P_60927.pdf",
"nationalCode": null,
"supplyRegime": "Medicamento Sujeto A Prescripción Médica",
"regionalRules": "not-collected",
"supplyProblem": false,
"targetSpecies": [],
"nonSubstitutable": {
"id": 0,
"nombre": "N/A"
},
"activeIngredients": null,
"useDomainEvidence": {
"basis": "publisher-dataset-scope",
"field": "sourceId",
"value": "es.aemps.cima",
"version": 1,
"sourceId": "es.aemps.cima"
},
"patientEligibility": "not-assessed",
"registrationNumber": "60927",
"targetSpeciesStatus": "not-applicable",
"administrationRoutes": [
{
"id": 48,
"nombre": "VÍA ORAL"
}
],
"administrativeStatus": "authorised",
"prescriptionCategory": "prescription-or-restricted",
"prescriptionRequired": true,
"activeIngredientsText": null,
"administrativeStatusScope": "medicine",
"administrativeDatesEpochMs": {
"aut": 828309600000
}
},
"region": null,
"retrievedAt": "2026-10-20T04:47:41.074Z",
"sourceUrl": "https://cima.aemps.es/cima/rest",
"licence": {
"id": "LicenseRef-AEMPS-CIMA-REST",
"url": "https://sede.aemps.gob.es/datos-abiertos/",
"scope": "CIMA REST metadata; not the separately restricted Nomenclátor bulk database",
"termsUrl": "https://www.aemps.gob.es/aviso-legal/",
"reviewedAt": "2026-09-24",
"attribution": "Fuente de la información: Agencia Española de Medicamentos y Productos Sanitarios www.aemps.gob.es",
"documentsIncluded": false
},
"limitations": [
"Complete unfiltered human-medicine registrations and presentations currently exposed by CIMA, not a historical archive of all Spanish authorisations.",
"Two identical full passes detect observed drift but CIMA supplies no point-in-time snapshot guarantee.",
"Authorisation, marketing, prescription requirement and patient/prescriber eligibility are separate facts.",
"Autonomous-community reimbursement, dispensing pathways, treatment plans and patient eligibility are not collected.",
"Official document URLs and their supplied modification dates only; no document content or images are redistributed.",
"REST reuse relies on the AEMPS open-data listing and website notice, not a Creative Commons licence or the Nomenclátor bulk terms."
],
"names": [
"ENANTYUM 12,5 mg COMPRIMIDOS"
],
"identifiers": [
{
"value": "60927",
"scheme": "registration"
}
]
}
4. Page through results
nextOffset is the offset of the next page, or null on the last one. Pass it as offset to read the next page:
async function* searchAll(country, q) {
let offset = 0
while (offset !== null) {
const params = new URLSearchParams({ country, q, limit: '50', offset: String(offset) })
const response = await fetch(`https://api.medifontis.com/v1/drugs?${params}`, {
headers: { Authorization: `Bearer ${process.env.MEDIFONTIS_API_KEY}` },
})
if (!response.ok) throw new Error(`Medifontis ${response.status}`)
const page = await response.json()
yield* page.results
offset = page.nextOffset
}
}