# UK HM Treasury Sanctions Scraper (`muhammadafzal/uk-hm-treasury-sanctions-scraper`) Actor

Extract official UK Sanctions List records for compliance research, screening, and due diligence. Search by name, identifier, regime, designation type, sanctions measure, or entity type, and receive structured names, aliases, reasons, addresses, dates, identifiers, and ship details.

- **URL**: https://apify.com/muhammadafzal/uk-hm-treasury-sanctions-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 sanctions records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 HM Treasury Sanctions Scraper

Download and filter the official UK Sanctions List CSV for sanctions compliance research, screening workflows, due diligence, and regulatory data pipelines. The list is published by the UK government and is now the current source for UK sanctions designations; the former HM Treasury/OFSI Consolidated List closed on 28 January 2026.

### What it extracts

Each dataset record contains the UK Unique ID, names and aliases, regime, designation type, sanctions imposed, source, statement of reasons, addresses, nationality, identifiers, dates, contact details, and ship details when supplied by the source. Repeated rows are retained when they represent different source details, and exact duplicate records are removed.

### Input

Use `searchTerm` for a case-insensitive search across names, IDs, addresses and related fields. Use exact-match arrays for `uniqueIds`, `regimes`, `designationTypes`, `sanctionsImposed`, or `entityTypes`. `maxResults` defaults to 100 and is capped at 5,000. An empty filter downloads and returns the first unique records from the current list.

### Output

Records are written to the default dataset. A `SUMMARY` key-value record reports the source report date, source row count, matched count, result count, filters, and warnings.

```json
{
  "searchTerm": "Russia",
  "designationTypes": ["Entity"],
  "maxResults": 25
}
```

### Pay per event

| Event | Price | Unit |
|---|---:|---|
| Actor start | $0.00005 | One run |
| Sanctions record | $0.0005 | One unique dataset record |

For example, a run returning 25 records costs up to $0.01255 in event charges, excluding any platform usage charged by Apify under the account’s current pricing configuration.

### Source, reliability, and limitations

The Actor makes one respectful request to the static government CSV and retries transient failures up to two times. It does not log in, bypass access controls, or use third-party sanctions data. A failed download is reported as `FAILED`; a successful download with no matches is reported as `EMPTY`. The data is informational and must not be treated as legal advice or as a substitute for applicable UK sanctions guidance and due diligence.

Source: https://sanctionslist.fcdo.gov.uk/docs/UK-Sanctions-List.csv

### License and compliance

The source is published under the UK Open Government Licence unless otherwise stated. Review the source terms, current UK sanctions guidance, and your own legal/compliance obligations before using the output for decisions.

### Use cases

- Schedule repeatable collection and export results to downstream workflows.
- Run a one-off research job and export the structured result as JSON, CSV, Excel, XML, or RSS from Apify.
- Schedule the same input to monitor changes over time and send completed datasets to a webhook or integration.
- Feed schema-shaped records into a database, spreadsheet, BI tool, or AI workflow with the source URL retained for verification.

### Run UK HM Treasury Sanctions Scraper with the Apify API

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/uk-hm-treasury-sanctions-scraper').call({
  "searchTerm": "",
  "uniqueIds": [],
  "regimes": [],
  "designationTypes": [],
  "sanctionsImposed": [],
  "entityTypes": [],
  "maxResults": 100,
  "requestDelayMs": 250
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

You can also run the Actor from Apify Console, schedules, webhooks, the REST API, Make, Zapier, n8n, or the hosted Apify MCP server.

### Support

When reporting a problem, include the **Actor run ID**, a redacted input, the expected result, and a small public example URL when applicable. Do not post API tokens, cookies, credentials, or personal data in an issue.

### Frequently asked questions

#### Can I schedule UK HM Treasury Sanctions Scraper?

Yes. Use an Apify schedule to run the same saved input at a chosen interval, then connect a webhook or integration to process the dataset when the run finishes.

#### How should I test a new input?

Begin with the prefilled example or a small limit. Confirm that the output fields, source coverage, runtime, and live charges match your workflow before increasing the scope.

#### How do I export the results?

Open the run's default dataset in Apify Console and export JSON, CSV, Excel, XML, or RSS. Applications can retrieve the same records through the Apify API client or REST dataset endpoint.

#### Can an AI agent call this Actor?

Yes. Add `muhammadafzal/uk-hm-treasury-sanctions-scraper` through the hosted Apify MCP server or call it through the API. The Actor's input and dataset schemas help agents construct valid requests and interpret returned records.

# Actor input Schema

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

Optional case-insensitive text search across names, identifiers, addresses and related fields. Example: Russia or Ivan Ivanov. Leave empty to scan the full list.

## `uniqueIds` (type: `array`):

Optional exact UK Sanctions List Unique ID values. Example: RUS0260. Use this for precise record retrieval.

## `regimes` (type: `array`):

Optional exact regime names from the source CSV, such as The Russia (Sanctions) (EU Exit) Regulations 2019. Leave empty for all regimes.

## `designationTypes` (type: `array`):

Optional exact designation types, for example Individual, Entity or Ship. Leave empty for all types.

## `sanctionsImposed` (type: `array`):

Optional exact measures, for example Asset freeze or Transport sanctions. Leave empty for all measures.

## `entityTypes` (type: `array`):

Optional exact source values for Type of entity. Leave empty for all entity types.

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

Maximum unique records to write to the default dataset. Example: 100. Allowed range: 1–5000.

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

Delay before the government CSV request. Example: 250. Allowed range: 0–5000; use the default for a respectful single-request run.

## Actor input object example

```json
{
  "searchTerm": "",
  "uniqueIds": [],
  "regimes": [],
  "designationTypes": [],
  "sanctionsImposed": [],
  "entityTypes": [],
  "maxResults": 100,
  "requestDelayMs": 250
}
```

# Actor output Schema

## `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("muhammadafzal/uk-hm-treasury-sanctions-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("muhammadafzal/uk-hm-treasury-sanctions-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 muhammadafzal/uk-hm-treasury-sanctions-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/uk-hm-treasury-sanctions-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/xNFGf4gJh4SqbMWff/builds/1PFLBx08pl1S7aN7C/openapi.json
