# Algeria Medicines Register Scraper (`hamza325/algeria-medicines-register-scraper`) Actor

Collect Algeria's national medicines register (MIPH): every registered product with its INN, brand, form, dosage, packaging, laboratory, registration dates and status, plus the non-renewed and withdrawn lists. One mode lists the Ministry's Excel files, the other reads the medicines inside them.

- **URL**: https://apify.com/hamza325/algeria-medicines-register-scraper.md
- **Developed by:** [Hamza Abbad](https://apify.com/hamza325) (community)
- **Categories:** Business, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.47 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Algeria Medicines Register Scraper

Collect Algeria's **national register of medicines** — the nomenclature of pharmaceutical products for human medicine published by the Ministry of Pharmaceutical Industry at [miph.gov.dz](https://www.miph.gov.dz/fr/nomenclature-nationale-des-produits-pharmaceutiques/). Every registered product comes out with its international non-proprietary name, brand, pharmaceutical form, dosage, packaging, laboratory, registration dates and status, together with the lists of products whose registration was not renewed and the products withdrawn from the register. Results land in a dataset ready to export as CSV, Excel or JSON.

The Ministry publishes the register as Excel workbooks rather than as pages: one per monthly edition, one per year of newly registered products, and two standing annexes. This Actor does both halves of that job — it can list the workbooks published, or open them and return the medicines inside.

### What you can scrape

- **The register** — every product on the nomenclature as of the edition you select: one row per product, with its registration number, INN, brand name, form, dosage, packaging, classification, laboratory and country, first and latest registration date, generic/reference type, status and shelf life.
- **Products whose registration was not renewed** — the Ministry's own annex, one row per product, flagged as `sheetKind: "nonRenewed"`.
- **Withdrawn products** — each withdrawal with the date the Ministry records and the reason it states (`retrait par le détenteur pour motif commercial`, `retrait par le MSPRH pour interdiction du laboratoire`, …).
- **Products registered during a given year** — the Ministry's per-year workbooks of newly registered products, one row per product, flagged as `sheetKind: "registeredInYear"`.
- **Older editions of the register** — the Ministry keeps its past monthly workbooks, so two runs can be compared and a product's entry into, or exit from, the register dated.
- **The workbooks themselves** — with the `files` mode you get the catalogue of published files instead of their contents: label, kind, version, year, month and link.

### Why this Actor

- **One row per medicine, not per file.** The Ministry's answer to "what is registered?" is a spreadsheet whose layout moves between editions. This Actor returns the products themselves in a consistent shape, so two editions can be diffed or joined without opening a workbook.
- **The annexes come with it.** Every monthly workbook carries the register plus the non-renewed and withdrawn lists, and all of them are read in one run — each row marked with the list it came from.
- **Dates are real dates.** The workbooks store registration and withdrawal dates as serial numbers; each one is returned as `YYYY-MM-DD`, with the form the sheet prints beside it.
- **Nothing is lost to a layout change.** Columns are read by their headings, not their position, so an edition that adds, drops or renames a column still reads correctly, and a sheet that does not carry a column returns it empty instead of shifting its neighbours into it.
- **Provenance on every row.** `source` says which workbook, which edition, which sheet and which row a product came from, so any row can be traced back and cited.
- **Reaches the site from anywhere.** The Ministry publishes to Algerian addresses only, so the Actor routes itself through an Algerian residential address by default — you do not have to discover that the hard way.
- **Results appear as they are read.** Each workbook's products land in the dataset as soon as that workbook is open, so a run over several editions fills one after another instead of all at the end. (A single-edition run has nothing to show until its one file is downloaded and opened — about half a minute.)
- **Quick and cheap.** A run is a handful of workbook downloads, and no account is needed.

### Quick start

1. Click **Try actor**.
2. Leave **What to collect** on `medicines` and **Version** on `latest`.
3. Click **Start**.
4. Open the **Dataset** tab and pick the **Medicines** view.
5. Export as CSV, Excel or JSON, or pull the dataset over the API.

```json
{ "startMode": "medicines", "version": "latest" }
```

That returns every product on every sheet of the newest monthly edition: the register itself, plus its non-renewed and withdrawn annexes.

To see the workbooks instead of the medicines:

```json
{ "startMode": "files" }
```

### Tutorial: a real workflow

Say you need the Algerian register of medicines as it stands, and you want to know which products have left it.

#### 1. Collect the newest edition

```json
{ "startMode": "medicines", "version": "latest" }
```

Each row is one product. Filter the dataset on `sheetKind = "current"` for the register itself. The columns that identify a product are `registrationNumber`, `inn`, `brandName`, `form`, `dosage` and `packaging`; `laboratory` and `laboratoryCountry` say who holds the registration.

#### 2. Read the two annexes from the same run

The run also returns `sheetKind = "nonRenewed"` and `sheetKind = "withdrawn"`. Withdrawn rows carry `withdrawalDate` and `withdrawalReason`; non-renewed rows carry neither, because the Ministry records no date for those.

A quick look at why products leave the register:

| `withdrawalReason` | Meaning |
| --- | --- |
| RETRAIT PAR LE DETENTEUR POUR MOTIF COMMERCIAL | withdrawn by the holder, for commercial reasons |
| RETRAIT PAR LE MSPRH POUR INTERDICTION DU LABORATOIRE | withdrawn by the Ministry after the laboratory was banned |

#### 3. Track change over time

The register is republished every month. Run the Actor on `latest`, keep the dataset, and run it again after the next edition.

Both datasets key on `registrationNumber` + `brandName` + `dosage` + `packaging` — the finest identity the Ministry publishes, since a registration number on its own can cover several lines. Diff the two on that key to see what entered the register and what left it; a product that moved to `sheetKind = "withdrawn"` between the two is a withdrawal you can date.

To reach further back, list the workbooks first and pass the code one carries (`YYYY-MM`) as **Version**:

```json
{ "startMode": "medicines", "version": "<YYYY-MM from a files run>" }
```

#### 4. Collect everything the Ministry publishes

```json
{ "startMode": "medicines", "version": "all" }
```

That reads every workbook the page carries — all monthly editions, the two standing annexes and the per-year registered lists — in one run. It is the largest run the Actor offers; set **Maximum rows** if you only need a slice of it.

#### 5. Or just take the links

```json
{ "startMode": "files" }
```

One row per workbook: `label`, `kind`, `version`, `year`, `month`, `fileName` and `url`. Run this first when you want to know which editions are available, then a `medicines` run reads the one you pick.

### Input

#### Main input

| Label (`key`) | Description | Default |
| --- | --- | --- |
| **What to collect** (`startMode`) | `medicines` reads the products out of the workbooks; `files` lists the workbooks themselves without opening them. | `medicines` |
| **Version** (`version`) | Which workbook(s) a medicines run reads: `latest`, `all`, `registered`, a year (`2025`) or one monthly edition (`YYYY-MM`). | `latest` |
| **Workbook URLs** (`fileUrls`) | Optional. Read these workbooks instead of discovering them — paste links from a `files` run, or any workbook of the Ministry. When set, **Version** is ignored. | — |

A version the site does not publish fails the run and names what is available, rather than finishing on an empty dataset.

#### Limits & performance

| Label (`key`) | Description | Default |
| --- | --- | --- |
| **Maximum rows** (`maxItems`) | Maximum rows for the whole run. `0` = no cap. Use it to bound a run that reads several editions. | `0` |
| **Workbooks at a time** (`maxConcurrency`) | How many workbooks are read in parallel. | `3` |
| **Delay between downloads** (`requestDelayMs`) | Pause before each workbook, in milliseconds. | `300` |
| **Retries per request** (`maxRequestRetries`) | Retries before a request is given up on. | `4` |

#### Proxy

| Label (`key`) | Description | Default |
| --- | --- | --- |
| **Proxy configuration** (`proxyConfiguration`) | Where the requests go out from. The Ministry's site answers Algerian addresses only, so every run goes through an Algerian residential address; a run costs a few megabytes of proxy traffic. Change this only if you want to supply your own Algerian proxy. | Algerian residential |

If a run cannot reach the site at all, it stops within about a minute and says so, instead of retrying until the timeout.

### Output

One dataset per run. Every row carries a `recordType` — `"medicine"` for a product, `"file"` for a workbook. Switch between the **Medicines** and **Workbooks** views in the **Dataset** tab.

#### Modes at a glance

| Mode (`startMode`) | What you get | Key fields |
| --- | --- | --- |
| **Medicines** (`medicines`) | Every product on every sheet of the selected workbook(s) | `sheetKind`, `registrationNumber`, `inn`, `brandName`, `form`, `dosage`, `laboratory`, `registrationDateInitial` |
| **Files** (`files`) | One row per workbook the Ministry publishes | `kind`, `label`, `version`, `year`, `month`, `url` |

#### Medicine row (`recordType: "medicine"`)

| Column | What it holds |
| --- | --- |
| `sheetKind` | Which list the row came from: `current`, `nonRenewed`, `withdrawn` or `registeredInYear`. |
| `sheetName` | The sheet's own name as the Ministry wrote it, e.g. `Nomenclature Aout 2026`, `Retraits`, `2024`. |
| `position` | The row's number inside the sheet. It restarts on every sheet and is not a stable product id. |
| `registrationNumber` | The Algerian marketing-authorisation number, e.g. `352/01 A 003/06/22`. |
| `code` | The nomenclature code the Ministry files the product under, e.g. `01 A 003`. |
| `inn` | International non-proprietary name — the active ingredient(s). |
| `brandName` | The trade name the product is sold under. |
| `form` | Pharmaceutical form, as printed (`COMPRIME PELLICULE SECABLE`, `SOL.INJ.`, `SIROP`…). |
| `dosage` | Strength, e.g. `10MG`, `0,5MG/5ML`. |
| `packaging` | Presentation, e.g. `B/10`, `FL/125ML`. |
| `listName` | Classification as printed — `LISTE I`, `LISTE II`, sometimes a number. Empty on many annex rows. |
| `p1` / `p2` | Dispensing channels as printed: `HOP` (hospital) and `OFF` (pharmacy). |
| `obs` | The Ministry's observation column. Numbers on most rows, empty on many; the annex sheets do not carry it. |
| `laboratory` | Holder of the registration decision. |
| `laboratoryCountry` | Country of that laboratory, as printed. |
| `registrationDateInitial` / `registrationDateInitialText` | First registration date as `YYYY-MM-DD`, and as the sheet prints it (`dd/mm/yyyy`). |
| `registrationDateFinal` / `registrationDateFinalText` | Latest registration date, same two forms. Absent on the withdrawal sheet. |
| `type` | `GE` for a generic, `RE` for a reference product. |
| `status` | The Ministry's status code as printed (`F`, `I`). |
| `stability` | Shelf life as printed, e.g. `60 MOIS`. Not on the annex sheets. |
| `withdrawalDate` / `withdrawalDateText` | Withdrawal date, `YYYY-MM-DD` and as printed. Withdrawn rows only. |
| `withdrawalReason` | Why the product was withdrawn, as the Ministry states it. |
| `source` | Provenance: `{kind, label, url, fileName, version, year, month, dataAsOf, rowNumber}`. |
| `scrapedAt` | When the row was collected. |

#### File row (`recordType: "file"`)

| Column | What it holds |
| --- | --- |
| `kind` | `nomenclatureVersion`, `registeredYear`, `nonRenewedList`, `withdrawnList`, or `custom` for a workbook given by URL. |
| `label` | The link text the Ministry publishes, e.g. `Version Août 2026`. |
| `version` | `YYYY-MM` for a monthly edition, `YYYY` for a per-year list. |
| `year` / `month` | Year of the edition, and its month when it is a monthly one. |
| `fileName` / `extension` | The published file name, and its extension. |
| `url` | The workbook's link. |
| `pageUrl` | The nomenclature page it was listed on. |
| `scrapedAt` | When the row was collected. |

#### Example rows

The values below come from one edition and are shown for shape only: a run carries the edition you selected.

```json
{
  "recordType": "medicine",
  "sheetKind": "current",
  "sheetName": "Nomenclature Aout 2026",
  "position": 1,
  "registrationNumber": "352/01 A 003/06/22",
  "code": "01 A 003",
  "inn": "CETIRIZINE DICHLORHYDRATE",
  "brandName": "ARTIZ",
  "form": "COMPRIME PELLICULE SECABLE",
  "dosage": "10MG",
  "packaging": "B/10",
  "listName": "LISTE II",
  "p1": "HOP",
  "p2": "OFF",
  "obs": null,
  "laboratory": "EL KENDI INDUSTRIE DU MEDICAMENT",
  "laboratoryCountry": "ALGERIE",
  "registrationDateInitial": "2006-07-31",
  "registrationDateInitialText": "31/07/2006",
  "registrationDateFinal": "2025-08-10",
  "registrationDateFinalText": "10/08/2025",
  "type": "GE",
  "status": "F",
  "stability": "60 MOIS",
  "withdrawalDate": null,
  "withdrawalDateText": null,
  "withdrawalReason": null,
  "source": {
    "kind": "nomenclatureVersion",
    "label": "Version Août 2026",
    "url": "https://www.miph.gov.dz/fr/wp-content/uploads/2026/09/clean_NOMENCLATURE.VERSION.AOUT_.2026-.xlsx",
    "fileName": "clean_NOMENCLATURE.VERSION.AOUT_.2026-.xlsx",
    "version": "2026-08",
    "year": 2026,
    "month": 8,
    "dataAsOf": "2026-08-31",
    "rowNumber": 1
  },
  "scrapedAt": "2026-11-08T19:00:00.000Z"
}
```

```json
{
  "recordType": "file",
  "kind": "nomenclatureVersion",
  "label": "Version Août 2026",
  "url": "https://www.miph.gov.dz/fr/wp-content/uploads/2026/09/clean_NOMENCLATURE.VERSION.AOUT_.2026-.xlsx",
  "fileName": "clean_NOMENCLATURE.VERSION.AOUT_.2026-.xlsx",
  "extension": "xlsx",
  "version": "2026-08",
  "year": 2026,
  "month": 8,
  "pageUrl": "https://www.miph.gov.dz/fr/nomenclature-nationale-des-produits-pharmaceutiques/",
  "scrapedAt": "2026-11-08T19:00:00.000Z"
}
```

### Notes and limits

- **A registration number is not a unique key.** The Ministry reuses the same number across several lines (different packaging, different dosage), so key on `registrationNumber` + `brandName` + `dosage` + `packaging`.
- **The Ministry's own labels are kept verbatim.** Forms, dosages and reasons are abbreviated exactly as published; no normalisation is attempted, because a normalised form is no longer a citation.
- **A few editions disagree with themselves.** In some versions the row count printed in the sheet's title is a handful short of the rows the sheet actually holds. The Actor reads every row and reports the difference in the run log instead of dropping rows to match the title.
- **Some cells repeat a column heading instead of a value.** A handful of rows carry `FORME`, `OBS` or `RETRAIT` where a value belongs. The Actor returns what the file says, so a few cells look like a heading; they are the Ministry's data, not a parsing artefact.
- **A version is occasionally published as an article, not a workbook.** `files` mode reports that entry as unavailable instead of inventing a file for it.
- **The per-year lists are yearly, not monthly.** Each holds the products registered during its year; `version: registered` collects them all.
- **The standing annexes are undated.** The non-renewed and withdrawn files carry no edition of their own; their rows say which cut-off they belong to through `source.dataAsOf` when the sheet states a date.
- **The cut-off date comes from the sheet's own title.** Where the Ministry states only a month, `source.dataAsOf` is `null` rather than an invented day.
- **Fields a row kind does not carry are `null`**, never absent: a withdrawn row has no `stability`, and a non-renewed row has no `withdrawalDate`.
- **No workbook is stored.** The files are read and discarded; the dataset carries the products and the link they came from.
- **The site is reachable from Algeria only.** It resolves anywhere, but connections from outside Algeria are refused before any page is served. The Actor's default proxy is an Algerian residential address, which is why a run works without any setup.

### FAQ

**How much data does one run return?**
One row per product on every sheet of the edition you selected: the register plus its non-renewed and withdrawn annexes, several thousand rows. A `files` run returns one row per published workbook.

**Can I get the register without the annexes?**
Run `medicines` and filter the dataset on `sheetKind = "current"`. The annexes come from the same workbook, so they cost nothing extra to collect and can be dropped in one filter.

**Why is the same product in both the register and the withdrawn list?**
Because the Ministry's sheets overlap: a product can still appear on the nomenclature while its withdrawal is pending or recorded. `sheetKind` and `withdrawalDate` say which statement a row carries; the Actor does not reconcile them.

**How do I know which edition a row comes from?**
`source.version` is the month the edition covers (`YYYY-MM`), `source.label` is the Ministry's own title for it, and `source.dataAsOf` is the cut-off date the sheet states.

**Does the Actor need an account?**
No. The register is public.

**Do I need a proxy?**
You do not have to configure one: the site answers Algerian addresses only, so the Actor already routes every run through an Algerian residential address.

**What happens if the site blocks me?**
The run stops within about a minute and its status message says the site answers Algerian addresses only, rather than retrying until it times out.

**Can I read a workbook the Actor did not discover?**
Yes — paste its URL into **Workbook URLs**. Any `.xlsx` of the Ministry works; the Actor still recognises which kind of list each sheet holds.

### Contact

Bug reports, feature requests, or a custom scraper for a site not yet covered? Open an issue on the Actor's Apify Console page or message the maintainer directly there.

# Changelog

This Actor's version history is a separate document: https://apify.com/hamza325/algeria-medicines-register-scraper/changelog.md

# Actor input Schema

## `startMode` (type: `string`):

Medicines downloads the workbook(s) and reads every product on every sheet. Files lists the workbooks themselves — labels, versions and links — without downloading them.

## `version` (type: `string`):

Which workbook(s) a medicines run reads. `latest` is the newest monthly edition. `all` is every workbook the page publishes: all monthly editions, the two standing annexes and the per-year registered lists. `registered` is the per-year lists only. A year (`2025`) is every edition of that year, a month (`YYYY-MM`) is exactly one. An unknown value fails the run and names what exists.

## `fileUrls` (type: `array`):

Optional. Read these workbooks instead of discovering them — paste the links from a `files` run, or any .xlsx the Ministry publishes. When set, Version is ignored.

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

Maximum rows for the whole run. 0 = no cap. One monthly edition is several thousand product rows across its three sheets; use this to bound a run that reads many editions.

## `maxConcurrency` (type: `integer`):

How many workbooks are downloaded and read in parallel.

## `requestDelayMs` (type: `integer`):

Pause before each workbook download. The files are 0.1–2 MB each; a short pause keeps a wide run polite.

## `maxRequestRetries` (type: `integer`):

How many times a failed request is retried before it is given up on.

## `proxyConfiguration` (type: `object`):

Where the requests go out from. The Ministry's site answers Algerian addresses only, so every run goes through an Algerian residential address; a run costs a few megabytes of proxy traffic. Change this only if you want to supply your own Algerian proxy.

## Actor input object example

```json
{
  "startMode": "medicines",
  "version": "latest",
  "maxItems": 0,
  "maxConcurrency": 3,
  "requestDelayMs": 300,
  "maxRequestRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "DZ"
  }
}
```

# Actor output Schema

## `rows` (type: `string`):

Default dataset containing every row the run pushed. Filter on `recordType` to separate products from files, and on `sheetKind` to separate the current nomenclature from the non-renewed and withdrawn annexes and the per-year registered lists.

# 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("hamza325/algeria-medicines-register-scraper").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("hamza325/algeria-medicines-register-scraper").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 hamza325/algeria-medicines-register-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hamza325/algeria-medicines-register-scraper"
        }
    }
}
```

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/w1b3dToPKfzeZEMxq/builds/YIKdSwg2QHAgBLUYT/openapi.json
