# UK MHRA Pharma Licence & Suspension Signals (`starshaped_bullsnake/uk-mhra-pharma-licence-suspension-signals`) Actor

Monitor official MHRA licence data and return only meaningful licence, site, suspension, revocation, termination, and cancellation changes.

- **URL**: https://apify.com/starshaped\_bullsnake/uk-mhra-pharma-licence-suspension-signals.md
- **Developed by:** [Starshape Tools](https://apify.com/starshaped_bullsnake) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 mhra regulatory change signals

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## UK MHRA Pharma Licence & Suspension Signals

Monitor official regulatory data and return only meaningful changes. This Actor combines current MHRA licence/site registers with official new, terminated, cancelled, suspended, and revoked licence lists, stores a persistent full snapshot, and emits one Dataset record per detected change.

### Signals

- `NEW_LICENCE` and `NEW_SITE`
- `SITE_REMOVED`
- `LICENCE_TERMINATED` and `LICENCE_CANCELLED`
- `LICENCE_SUSPENDED` and `LICENCE_REVOKED`
- `SUSPENSION_CLEARED`

Suspension, cancellation, and revocation are high-impact regulatory changes. Revocation is classified critical. A cleared suspension is informational and does not guarantee that a company or site is otherwise suitable for a particular transaction.

### Official sources and identifiers

The live mode discovers the current CSV attachments through the GOV.UK Content API and reads:

- [Human medicines licensed wholesale distribution sites](https://www.gov.uk/government/publications/human-and-veterinary-medicines-register-of-licensed-wholesale-distribution-sites)
- [Licensed manufacturing sites: manufacturer specials, human](https://www.gov.uk/government/publications/human-and-veterinary-medicines-register-of-licensed-manufacturing-sites)
- [New manufacturing and wholesale dealer licences](https://www.gov.uk/government/publications/medicines-new-manufacturing-and-wholesale-dealer-licences)
- [Terminated and cancelled licences](https://www.gov.uk/government/publications/medicines-terminated-and-cancelled-manufacturing-and-wholesale-dealer-licences)
- [Suspended and revoked licences](https://www.gov.uk/government/publications/suspended-licences-for-manufacturers-and-wholesalers-of-medicines)

Licence numbers are the primary stable identifier. Official site IDs identify sites. Company or site names are never used as entity keys. The wholesale and manufacturing site registers are normally updated monthly. New and ended licence lists are normally updated monthly; suspension and revocation lists can be updated when regulatory action occurs. GOV.UK content is available under the Open Government Licence unless otherwise stated.

### Baseline and change processing

The first successful live run validates every source and stores a full baseline without emitting existing entities as new. Later runs build a merged current official state and compare it with the previous successful snapshot. Identical source state produces zero signals.

Processing order is fetch, validate, normalize and merge, read the previous snapshot, diff, write Dataset records, validate/write `SUMMARY`, then commit the snapshot. Fetch, parse, schema, count, Dataset, or summary failures leave the previous snapshot unchanged. `maxItems` and filters limit Dataset output only; they never truncate the full snapshot.

Use `mode=sample` for a fresh-account example with synthetic official-shaped states. It uses the production diff engine, does not fetch external data, and never reads or writes the production baseline.

### Input

- `mode`: `live` or `sample`
- `maxItems`: maximum emitted signals
- `signalTypes`: optional exact signal type filter
- `licenceTypes`: optional licence type-prefix filter
- `companyQuery`: optional company-name substring filter
- `baselineOnly`: replace the baseline only after a completely valid source acquisition

### Output and limitations

Each Dataset record contains the signal and severity, official licence and optional site identifiers, company/site details, previous/current status, official event date when supplied, source URL, and detection timestamp. `SUMMARY` records source row counts, normalized licence counts, signal counts, and snapshot status.

This Actor covers the official CSV sources listed above. The manufacturing site register used here is the human manufacturer-specials register; other manufacturing authorisation categories may appear only in the new, ended, suspended, or revoked lists. Source publication is periodic, not real time. The Actor reports published changes and does not provide guaranteed compliance, complete due diligence, prediction, or legal advice. Compute is used to download and normalize the full official files; persistent key-value storage retains the latest successful full snapshot.

# Actor input Schema

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

Use live for official MHRA sources or sample for a self-contained example through the same diff engine.

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

Maximum Dataset records. The persistent full snapshot is never truncated.

## `signalTypes` (type: `array`):

Optional signal type filter.

## `licenceTypes` (type: `array`):

Optional licence type prefixes such as WDA(H), MIA, or MS.

## `companyQuery` (type: `string`):

Optional case-insensitive company-name filter.

## `baselineOnly` (type: `boolean`):

Store a validated full source snapshot without producing change signals.

## Actor input object example

```json
{
  "mode": "live",
  "maxItems": 100,
  "baselineOnly": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# 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("starshaped_bullsnake/uk-mhra-pharma-licence-suspension-signals").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("starshaped_bullsnake/uk-mhra-pharma-licence-suspension-signals").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 starshaped_bullsnake/uk-mhra-pharma-licence-suspension-signals --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,starshaped_bullsnake/uk-mhra-pharma-licence-suspension-signals"
        }
    }
}
```

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/zFDOXdecmKyMQV8Xn/builds/AF8sQuBOlHS8nZQMj/openapi.json
