# shortages_by_atc

Lists shortage records for an ATC code across EU registers, in one record shape. Call it to see which products a register reports short for a substance or class. For a per-country count, call cross_country_summary; for one product, shortages_by_national_code; to get a code from a name, find_medicine. Each record carries its source status text, start and expected end, sourceListDate for the list as a whole, source URL and content hash. Defaults to shortage, supply_tension and announced, where announced starts after the snapshot; counts gives shortNow and announced apart. Check substancesUnderCode; a code with no records gets nearCodes, never their answer. Strength and form are not normalised. Records with no ATC code are counted in notJoinable, and absence from a register does not mean a product is available.

## Input

- `atc` (required): ATC code at any level, for example N, J01, J01C or J01CA04. Matches by prefix, so N covers every nervous system record. To get a code from a medicine name, call find_medicine first.
- `countries`: ISO country codes, or EU for the EMA catalogue. Served: EU, CZ, ES, FR, IT. Defaults to every served source.
- `statuses`: Defaults to shortage, supply_tension and announced.
- `as_of`: Read the data version on or before this date instead of the latest. A pinned read reports source health as it was then.
- `limit`: Default 25.
- `offset`: integer

## Example

```
curl -X POST https://neap.bulkhead.solutions/v1/tools/shortages_by_atc -H 'content-type: application/json' -d '{"atc":"N05AH04","countries":["ES","FR"],"limit":2}'
```

```json
{
  "atc": "N05AH04",
  "total": 33,
  "returned": 2,
  "nextOffset": 2,
  "byCountry": {
    "ES": 32,
    "FR": 1
  },
  "counts": {
    "total": 33,
    "shortNow": 33,
    "announced": 0,
    "byCountryAndStatus": {
      "ES": {
        "shortage": 32
      },
      "FR": {
        "supply_tension": 1
      }
    },
    "byStatusAllMatched": {
      "shortage": 32,
      "supply_tension": 1
    },
    "hiddenByStatusFilter": 0,
    "note": "total counts the statuses asked for (shortage, supply_tension, announced). shortNow is shortage plus supply_tension; announced is a listed shortage whose start date is after the snapshot. byStatusAllM..."
  },
  "substancesUnderCode": {
    "names": [
      {
        "name": "quetiapina",
        "countries": [
          "ES"
        ],
        "records": 32
      },
      {
        "name": " quétiapine (fumarate de)",
        "countries": [
          "FR"
        ],
        "records": 1
      }
    ],
    "note": "Substance names on the matched records, as each register writes them. Check this is the substance you meant: a mistyped code returns another substance's records."
  },
  "viaCandidateCode": {
    "count": 0,
    "note": "How many of total have no single ATC code and matched through one of their atcCandidates. They may be another substance or route; each lists its atcCandidates."
  },
  "records": [
    {
      "id": "ES:715375",
      "source": "cima",
      "country": "ES",
      "nationalCode": "715375",
      "product": "QUETIAPINA NORMON 150 MG COMPRIMIDOS DE LIBERACION PROLONGADA EFG, 60 comprimidos",
      "pack": null,
      "substance": "quetiapina",
      "atc": "N05AH04",
      "atcBasis": "cima_medicamento",
      "status": "shortage",
      "sourceStatus": "tipoProblemaSuministro 5, activo true",
      "start": "2026-10-23",
      "expectedEnd": "2026-12-23",
      "expectedEndText": null,
      "lastUpdated": null,
      "sourceListDate": "2026-11-09",
      "sourceListDateBasis": "retrieved",
      "provenance": {
        "sourceUrl": "https://cima.aemps.es/cima/rest/psuministro",
        "recordUrl": "https://cima.aemps.es/cima/rest/psuministro/715375",
        "fetchedAt": "2026-11-09T21:48:49.043Z",
        "contentHash": "013f87561bd8ed07aa86051b53748efd26a2c022b5db977de7f31d6789021fcf",
        "recordHash": "6d628d1c5dfb1bbe"
      }
    },
    {
      "id": "ES:672655",
      "source": "cima",
      "country": "ES",
      "nationalCode": "672655",
      "product": "QUETIAPINA VIATRIS 25 MG COMPRIMIDOS RECUBIERTOS CON PELICULA EFG, 60 comprimidos",
      "pack": null,
      "substance": "quetiapina",
      "atc": "N05AH04",
      "atcBasis": "cima_medicamento",
      "status": "shortage",
      "sourceStatus": "tipoProblemaSuministro 5, activo true",
      "start": "2026-10-20",
      "expectedEnd": "2026-11-27",
      "expectedEndText": null,
      "lastUpdated": null,
      "sourceListDate": "2026-11-09",
      "sourceListDateBasis": "retrieved",
      "provenance": {
        "sourceUrl": "https://cima.aemps.es/cima/rest/psuministro",
        "recordUrl": "https://cima.aemps.es/cima/rest/psuministro/672655",
        "fetchedAt": "2026-11-09T21:48:49.043Z",
        "contentHash": "013f87561bd8ed07aa86051b53748efd26a2c022b5db977de7f31d6789021fcf",
        "recordHash": "fe9cd9b16e9d5a59"
      }
    }
  ],
  "codedMoreBroadly": {
    "count": 2,
    "codes": [
      "N05AH"
    ],
    "note": "Records the register coded only at a higher ATC level. They may or may not be this substance, so they are not in records."
  },
  "notJoinable": {
    "byCountry": {
      "FR": 55
    },
    "note": "Active records in these registers with no ATC code at all, not even a candidate. No ATC query can reach them; shortages_by_national_code can."
  },
  "absence": "No record does not mean available. It means this register lists nothing for that query.",
  "coverage": {
    "heldBack": [
      {
        "country": "DE",
        "why": "BfArM's imprint forbids copying or distributing its texts and tables without prior consent (found 7 November 2026). Not fetched at all until BfArM consents in writing; the one snapshot already taken i..."
      },
      {
        "country": "HU",
        "why": "Reuse terms unread. Not fetched until OGYEI answers in writing (paused 10 November 2026; earlier private copies are kept unused)."
      },
      {
        "country": "SI",
        "why": "Reuse terms unconfirmed. Not fetched until JAZMP answers in writing (paused 10 November 2026; earlier raw copies are kept unused)."
      }
    ],
    "excluded": [
      {
        "country": "FI",
        "why": "Fimea's terms forbid selling the information or using it commercially, so Neap does not fetch it."
      },
      {
        "country": "IE",
        "why": "The shortage path is disallowed in robots.txt, so Neap does not fetch it."
      }
    ],
    "otherCountries": "Other EU and EEA registers are not integrated, so they are unknown here, not clear."
  },
  "dataVersion": "2026-11-09",
  "sources": "2 entries, see the full response",
  "attribution": "2 entries, see the full response",
  "warnings": [],
  "complete": true,
  "scope": "...",
  "notAdvice": "Supply facts from public registers. Not clinical advice, not substitution advice."
}
```

---

Automated and unreviewed. Neap reads official sources automatically and no person checks each answer. Data can be incomplete, late or wrong. Always verify against the official source linked with every answer before you act. Not legal, tax or customs advice. Not medical advice. Ask a pharmacist or doctor. A supply status is not a clinical recommendation.

Data version 9 November 2026.
