# OpenSanctions Sanctions, PEP & Watchlist Data Extractor (`nimbryxo-studio/opensanctions-sanctions-pep-and-watchlist-data`) Actor

Stream sanctions, PEP, crime and debarment entities from OpenSanctions' free bulk datasets. List every dataset (OFAC, EU, UN, INTERPOL, PEPs, 400+ more) or stream one dataset's entities with names, countries, topics and source links.

- **URL**: https://apify.com/nimbryxo-studio/opensanctions-sanctions-pep-and-watchlist-data.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Automation, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## OpenSanctions Sanctions, PEP & Watchlist Data Extractor

Stream entities from OpenSanctions, the open-data project that consolidates 400+ government and watchdog sources into one structured feed. Pull persons, companies, vessels and other entities from a specific list — OFAC SDN, UN Security Council, EU sanctions, politically exposed persons, debarment registers, wanted lists and more — or list every available dataset with its size, publisher and coverage. No API key required.

### What this actor does

- **Two modes:** `getDatasetEntities` streams the entities of one chosen dataset; `listDatasets` returns metadata for every dataset in the OpenSanctions index
- **400+ datasets** — pick a well-known source (OFAC SDN, UN sanctions, INTERPOL Red Notices, Wikidata PEPs) or a consolidated collection (all sanctions, all PEPs, all debarment lists), or type any dataset name to override the dropdown
- **Entity-type and topic filters** — narrow a stream to persons, organizations, companies or vessels, and to a topic like `sanction`, `role.pep`, or `crime.fraud` (topics are hierarchical, so `crime` also matches `crime.fin`, `crime.fraud`, etc.)
- **Dataset discovery** — `listDatasets` can be restricted to sources, collections, or external enrichment datasets, sorted by entity count
- **Empty fields are omitted** — a record only carries the attributes OpenSanctions published for that entity or dataset

### Output per entity (mode `getDatasetEntities`)

- `id` — OpenSanctions entity ID
- `schema` — FollowTheMoney type, e.g. `Person`, `Company`, `Vessel`
- `name`, `aliases[]`
- `countries[]`, `nationalities[]`
- `topics[]` — e.g. `sanction`, `role.pep`, `crime.fin`
- `datasets[]` — every OpenSanctions dataset this entity appears in
- `birthDate`, `gender`, `positions[]`
- `registrationNumber`, `addresses[]`, `website`
- `programs[]` — sanctions program IDs, when listed
- `referenceUrl` — the original source document, when OpenSanctions provides one
- `firstSeen`, `lastSeen` — when OpenSanctions first/last observed this entity
- `isTarget` — `true` when OpenSanctions flags this as a directly targeted entity (not just a related party)
- `sourceUrl` — the entity's OpenSanctions profile page
- `recordType: "entity"`, `scrapedAt`

### Output per dataset (mode `listDatasets`)

- `name` — dataset identifier, e.g. `us_ofac_sdn`
- `title`, `summary`, `datasetType` — `source`, `collection`, or `external`
- `entityCount`, `thingCount`, `targetCount` — when greater than zero
- `publisher`, `publisherCountry`
- `tags[]`, `updateFrequency`
- `sourceUrl` — the publisher's own source page
- `pageUrl` — the dataset's OpenSanctions page
- `updatedAt`, `entitiesUrl` — direct link to the dataset's bulk entities file
- `recordType: "dataset"`, `scrapedAt`

### Error records

When the dataset index can't be downloaded, a `dataset`/`datasetName` doesn't match a known dataset, a dataset has no downloadable bulk entities file, or streaming a dataset's entities fails, the actor pushes one record instead of entity/dataset records:

- `recordType: "error"`
- `error` — a short error code, e.g. `unknown_dataset`, `no_bulk_resource`, `download_failed`, `index_unavailable`
- `message` — a human-readable explanation
- `input` — the dataset name or value that triggered the error, when applicable
- `sourceUrl` — the OpenSanctions URL the actor was trying to reach

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `getDatasetEntities` | `getDatasetEntities` or `listDatasets` |
| `dataset` | string | `us_ofac_sdn` | Dataset to stream, from the curated dropdown (mode `getDatasetEntities`) |
| `datasetName` | string | – | Advanced override: any dataset name or OpenSanctions dataset URL, bypassing the dropdown |
| `schema` | string | `Any` | Entity type filter: `Any` / `Person` / `Organization` / `Company` / `LegalEntity` / `Vessel` / `Address` |
| `topic` | string | `any` | Topic filter, e.g. `sanction`, `role.pep`, `crime.fraud`, `debarment`, `wanted` |
| `datasetType` | string | `all` | Restrict `listDatasets` to `source` / `collection` / `external` |
| `maxItems` | int | `100` | Hard cap on emitted records (1–10000) |

#### Example: stream US OFAC SDN persons

```json
{
  "mode": "getDatasetEntities",
  "dataset": "us_ofac_sdn",
  "schema": "Person",
  "maxItems": 500
}
```

#### Example: politically exposed persons, worldwide collection

```json
{
  "mode": "getDatasetEntities",
  "dataset": "peps",
  "topic": "role.pep",
  "maxItems": 1000
}
```

#### Example: look up a dataset by name override

```json
{
  "mode": "getDatasetEntities",
  "datasetName": "gb_hmt_sanctions",
  "maxItems": 200
}
```

#### Example: list every PEP and sanctions collection

```json
{
  "mode": "listDatasets",
  "datasetType": "collection",
  "maxItems": 50
}
```

### Use cases

- **AML/KYC screening** — pull a sanctions or PEP list to check against your own customer or counterparty data
- **Vendor and third-party due diligence** — screen suppliers against debarment and wanted lists
- **Compliance monitoring** — stream a specific list on a schedule to catch newly added entities
- **Research and journalism** — explore a government watchlist's full entity set with names, aliases, and source links
- **Dataset discovery** — use `listDatasets` to find which of OpenSanctions' 400+ lists covers a country or topic you care about

### FAQ

**Do I need an API key?**
No. OpenSanctions publishes its bulk data for free; this actor streams it directly.

**What's the difference between a "source" and a "collection"?**
A source is one government or watchdog's own list (e.g. `us_ofac_sdn`). A collection groups multiple sources together (e.g. `peps` combines every PEP source OpenSanctions tracks). Use `datasetType` in `listDatasets` to tell them apart.

**How do I find a dataset I don't see in the dropdown?**
Run `mode=listDatasets` first to browse all 400+ names, then pass the one you want in `datasetName` (which also accepts a pasted OpenSanctions dataset page URL).

**Why are some entities missing fields like `birthDate` or `registrationNumber`?**
Those fields are specific to persons or companies respectively, and only appear when the source document actually included them. Fields are omitted rather than returned as `null`.

**What does `isTarget` mean?**
OpenSanctions distinguishes entities that are directly named by a sanctions program or watchlist (`isTarget: true`) from related entities it links in for context, like an associate or a shared address, which don't carry that flag.

**How fresh is the data?**
As fresh as OpenSanctions' own bulk export for that dataset — `updatedAt` on a dataset record (from `listDatasets`) tells you when it was last refreshed upstream.

**Is this affiliated with OpenSanctions?**
No. This is an independent third-party actor built on OpenSanctions' public bulk data; it is not affiliated with or endorsed by OpenSanctions.

**Is this a substitute for a licensed compliance screening tool?**
No. This actor streams OpenSanctions' free, open data as-is. For regulated compliance workflows, review OpenSanctions' own licensing terms and consider whether a paid, SLA-backed data source better fits your legal obligations.

# Actor input Schema

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

What to scrape: stream the entities of one dataset, or list all available datasets.

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

Which dataset to stream entities from (used in `getDatasetEntities` mode). Pick a well-known sanctions/PEP list or a consolidated collection. Run `listDatasets` to discover all 400+ dataset names.

## `datasetName` (type: `string`):

Optional: type any dataset name from the index to override the dropdown above (e.g. "gb_hmt_sanctions", "il_mod_terror"). Also accepts an OpenSanctions dataset page URL. Leave empty to use the dropdown. Run `listDatasets` to discover valid names.

## `schema` (type: `string`):

Filter entities by FollowTheMoney type. `Organization` includes companies and public bodies; `Legal entity` includes persons and organizations. Applies to `getDatasetEntities` mode.

## `topic` (type: `string`):

Filter entities by OpenSanctions topic. Topics are hierarchical: choosing `crime` also matches `crime.fin`, `crime.fraud`, etc. Applies to `getDatasetEntities` mode.

## `datasetType` (type: `string`):

When listing datasets (`listDatasets` mode), restrict to sources, collections, or external datasets.

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

Maximum number of records to return (entities or datasets).

## Actor input object example

```json
{
  "mode": "getDatasetEntities",
  "dataset": "us_ofac_sdn",
  "schema": "Person",
  "topic": "any",
  "datasetType": "all",
  "maxItems": 100
}
```

# Actor output Schema

## `entities` (type: `string`):

Dataset containing all scraped entities (or dataset metadata records).

# 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": "getDatasetEntities",
    "dataset": "us_ofac_sdn",
    "schema": "Person",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/opensanctions-sanctions-pep-and-watchlist-data").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": "getDatasetEntities",
    "dataset": "us_ofac_sdn",
    "schema": "Person",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/opensanctions-sanctions-pep-and-watchlist-data").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": "getDatasetEntities",
  "dataset": "us_ofac_sdn",
  "schema": "Person",
  "maxItems": 100
}' |
apify call nimbryxo-studio/opensanctions-sanctions-pep-and-watchlist-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/opensanctions-sanctions-pep-and-watchlist-data"
        }
    }
}
```

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/dpPeVys5EHxmnhByV/builds/TvCM1eTMxZ9H1YeLy/openapi.json
