# SAHPRA South Africa Medicines Register: Lookup, Monitor, Export (`sa-registers/sahpra-medicines-register`) Actor

Search, export and monitor South Africa's SAHPRA drug register: about 21,000 registered medicines by name, registration number, applicant or active ingredient. Daily change alerts on new registrations, cancellations and status changes.

- **URL**: https://apify.com/sa-registers/sahpra-medicines-register.md
- **Developed by:** [SA Registers](https://apify.com/sa-registers) (community)
- **Categories:** Business, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / monitor run

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

## SAHPRA Medicines Register: Lookup, Change Monitor and Export

Clean, searchable data from the South African Health Products Regulatory Authority (SAHPRA) register of registered health products: about 21,000 medicines with their applicant, registration and licence numbers, status, dates and ingredients.

SAHPRA publishes the register as a web table you can only browse by hand. This actor turns it into structured data you can search, export, and watch for changes on a schedule.

**What you can do with it**

- **Watch a competitor.** Run the change monitor daily, filtered to their company name, and get an alert when they register, cancel or change a product.
- **Watch an ingredient.** Track every product containing an active ingredient, for example to spot new generic entrants.
- **Check a product in seconds.** Is it registered, who holds it, when does the registration expire?
- **Load the whole register into Excel or a database.** One export, about 21,000 clean rows.
- **Give an AI agent access.** Your assistant can answer questions about South African medicine registrations from live data.

**Who it is for**

- Pharmaceutical and generics companies tracking competitors' registrations, cancellations and new approvals.
- Regulatory affairs consultancies that report registration changes to their clients.
- Analysts, wholesalers and researchers who need the register as a spreadsheet or database.

### Three modes

#### 1. Lookup

Search the register and get matching rows back.

```json
{ "mode": "lookup", "searchTerm": "paracetamol", "searchField": "ingredient", "maxResults": 100 }
```

`searchField` can be `any` (SAHPRA's own search across every column, including status and dates), `productName`, `applicantName`, `ingredient`, `api` (active ingredient), `applicationNo` or `licenceNo`. Matching ignores case. `maxResults` caps the number of rows, and so the cost.

#### 2. Change monitor

Schedule this daily. Each run compares the register with the previous run and outputs only what changed: new registrations, removed ones, and changed ones (for example, a status moving from Registered to Canceled), with before and after values.

```json
{ "mode": "monitor", "applicantFilter": "Aspen", "storeName": "aspen-watch" }
```

- With no filters it watches the whole register. The optional filters narrow it to an applicant, an ingredient or active ingredient, a therapeutic area, or a set of statuses.
- A status filter watches only rows with those statuses, so a registration that moves out of them (for example Registered to Canceled with `statusFilter: ["Registered"]`) is reported as `removed`. To see it as a `changed` status, leave the status filter empty.
- The first run saves a baseline and outputs one summary row. Changes are reported from the second run on.
- The monitor remembers the previous run in a key-value store in your own Apify account, named by `storeName`. To keep several watch lists, give each one its own `storeName`. Use a name no other actor in your account uses, because Apify does not let one actor open another actor's store. Changing the filters on an existing `storeName` starts a new baseline.
- When nothing changed, the run outputs one `no-changes` row, so you can tell a quiet day from a failed run.

To get alerts, add an Apify integration to your schedule (email, Slack, a webhook, Zapier or Make), triggered when the run succeeds.

#### 3. Full export

```json
{ "mode": "export" }
```

The whole register, normalised, in one dataset you can download as CSV, Excel or JSON.

### Example output

One lookup row, as returned for `{"mode": "lookup", "searchTerm": "paracetamol", "maxResults": 1}`:

```json
{
  "applicantName": "A & E PHARMACEUTICALS (PTY) LTD",
  "productName": "NERVADIN",
  "applicationNo": "B0764",
  "licenceNo": "Old Medicine",
  "status": "Canceled",
  "rawStatus": "Canceled",
  "registrationDate": "1969-11-20",
  "expiryDate": "2024-02-19",
  "ingredient": "TABLET ASPIRIN A 240 MG CODEINE PHOSPHATE A 10 MG PARACETAMOL A 240 MG",
  "therapeuticArea": null,
  "api": null,
  "statusSpellingCorrected": false,
  "registrationNoDateSentinel": false,
  "expiryNoDateSentinel": false,
  "unparseableDate": false,
  "missingExpiryDate": false,
  "registeredButExpired": false,
  "individualApplicant": false,
  "duplicateGroupSize": 1,
  "sourceFetchedAt": "2026-11-06T16:58:29.789Z"
}
```

One change monitor row, when a registration's status changed (illustrative values):

```json
{
  "changeType": "changed",
  "groupKey": "app:000000",
  "applicationNo": "000000",
  "changedFields": [{ "field": "rawStatus", "before": "Registered", "after": "Canceled" }],
  "before": [{ "productName": "...", "status": "Registered" }],
  "after": [{ "productName": "...", "status": "Canceled" }],
  "sourceFetchedAt": "2026-11-07T06:00:12.000Z"
}
```

### Pricing

You pay per event, plus Apify's small standard per-run start fee. Platform compute is included:

| Event | Price |
|---|---|
| Lookup: each row returned | USD 0.02 |
| Change monitor: each run | USD 0.10 (about USD 3 a month on a daily schedule) |
| Full export | USD 5.00 |

A run that fails, or that sees the register change while it is reading it, charges no lookup, monitor or export fee (only Apify's standard start fee) and leaves the monitor's memory as it was. Fees are charged only after the data has been delivered. A lookup stops at your spending limit and its status message says how many matching rows were held back.

### Output fields

Every row has these fields. Dates are ISO `YYYY-MM-DD`. Empty, `None` and missing values are `null`.

| Field | Meaning |
|---|---|
| `applicantName`, `productName` | As published, with stray line breaks and extra spaces removed |
| `applicationNo`, `licenceNo` | Registration identifiers |
| `status` | `Registered`, `Canceled` or `Old Medicine` |
| `rawStatus` | The status exactly as SAHPRA published it |
| `registrationDate`, `expiryDate` | ISO dates |
| `ingredient`, `api`, `therapeuticArea` | Composition, active ingredient and therapeutic area |
| `sourceFetchedAt` | When the row was read from SAHPRA |

SAHPRA warns that its register has inconsistencies. This actor never silently changes what SAHPRA published. It adds flags instead:

| Flag | Meaning |
|---|---|
| `statusSpellingCorrected` | SAHPRA published the status as `Registrered`; `status` shows `Registered` and `rawStatus` keeps the original |
| `expiryNoDateSentinel`, `registrationNoDateSentinel` | SAHPRA used `1900/01/01` to mean "no date"; the date is output as `null` |
| `unparseableDate` | A date was not in SAHPRA's usual format and is passed through as published |
| `missingExpiryDate` | There is no expiry date |
| `registeredButExpired` | Status is Registered but the expiry date has passed |
| `individualApplicant` | The applicant is a named person rather than a company (a few old pharmacist registrations) |
| `duplicateGroupSize` | How many rows share this application number. SAHPRA sometimes lists one registration under two product names. In a lookup this counts within the lookup's results |

Change monitor rows have `changeType` (`added`, `removed`, `changed`, `baseline` or `no-changes`), `applicationNo`, `before` and `after` (the rows on each side), and `changedFields` (each changed field with its before and after value, when one row changed into one row). The monitor groups rows by application number. It reports only changes to what SAHPRA published, never changes to the flags, so `registeredButExpired` turning true as time passes is not reported as a change.

### FAQ

**How fresh is the data?** Every run reads SAHPRA's live register at that moment. Nothing is cached between runs.

**How long does a run take?** A lookup takes a few seconds. A change monitor or full export reads the whole register politely, one page at a time, and takes about three minutes.

**Why is the monitor's first run only a summary?** It has nothing to compare against yet. The first run saves a baseline; every run after that reports changes since the previous one.

**Can I watch several companies separately?** Yes. Create one schedule per company, each with its own `applicantFilter` and its own `storeName`.

**What if SAHPRA's site is down?** The run fails cleanly, charges no lookup, monitor or export fee, and leaves the monitor's memory as it was. The next scheduled run carries on normally.

**Are pending applications included?** No. SAHPRA does not publish them.

**Does it include medical devices or veterinary products?** Not yet. This actor covers the register of registered health products (medicines). Ask in the Issues tab if you need the others.

### For AI agents

Call this actor through Apify's MCP server or API with one of the three inputs above. For a quick question ("is product X registered, and who holds it?"), use `lookup` with a specific `searchField` and a small `maxResults`. Use `export` only when you need the whole register. Each lookup row costs USD 0.02.

### Data source and politeness

The data comes from SAHPRA's public register at medapps.sahpra.org.za. This actor is unofficial and is not affiliated with or endorsed by SAHPRA. It reads the register one page at a time with pauses between pages, retries gently on errors, and identifies itself honestly. SAHPRA's register is the authority. Check it before relying on any record for a regulatory decision.

Pending applications are not included, because SAHPRA does not publish them.

# Actor input Schema

## `mode` (type: `string`):

What the run does.

## `searchTerm` (type: `string`):

Lookup only. Text to search for, for example a product name, company or ingredient.

## `searchField` (type: `string`):

Lookup only. Which field the search term must appear in.

## `maxResults` (type: `integer`):

Lookup only. Each returned row is charged, so this caps the cost.

## `applicantFilter` (type: `string`):

Change monitor only. Watch only registrations whose applicant contains this text.

## `ingredientFilter` (type: `string`):

Change monitor only. Matches the ingredient or active ingredient (API) field.

## `therapeuticAreaFilter` (type: `string`):

Change monitor only.

## `statusFilter` (type: `array`):

Change monitor only. Leave empty to watch every status.

## `storeName` (type: `string`):

Change monitor only. Use a different name for each independent watch list. Changing filters on the same name starts a new baseline.

## Actor input object example

```json
{
  "mode": "lookup",
  "searchTerm": "paracetamol",
  "searchField": "any",
  "maxResults": 1,
  "storeName": "sahpra-monitor"
}
```

# Actor output Schema

## `results` (type: `string`):

Lookup and export: one normalised register row per item. Change monitor: one item per added, removed or changed registration, or a single baseline or no-changes item.

# 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 = {
    "mode": "lookup",
    "searchTerm": "paracetamol",
    "searchField": "any",
    "maxResults": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("sa-registers/sahpra-medicines-register").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 = {
    "mode": "lookup",
    "searchTerm": "paracetamol",
    "searchField": "any",
    "maxResults": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("sa-registers/sahpra-medicines-register").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 '{
  "mode": "lookup",
  "searchTerm": "paracetamol",
  "searchField": "any",
  "maxResults": 1
}' |
apify call sa-registers/sahpra-medicines-register --silent --output-dataset

```

## MCP server setup

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

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/kNCFdvLNdMuxFQvpX/builds/dLorAd3baLwLUfrRa/openapi.json
