Screen names against OFAC and UK sanctions lists in 10 lines
Screen names against OFAC and UK sanctions lists in 10 lines Name screening against official sanctions lists can start with a single HTTP request. This post shows a 10-line Python caller for the Wryborg Sanctions Watch
Screen names against OFAC and UK sanctions lists in 10 lines
Name screening against official sanctions lists can start with a single HTTP request. This post shows a 10-line Python caller for the Wryborg Sanctions Watch API that searches the U.S. Treasury OFAC lists and, when you opt in, the UK Sanctions List.
Wryborg is a small, independent project. It turns official public lists into JSON APIs. It is not a consumer reporting agency, and this API is not for FCRA uses such as employment, tenant, credit, or insurance decisions. It does not cover PEP or adverse media.
A match is not a legal determination, and no match is not a clearance. Scores are candidate rankings for triage, not an identity determination. A screening result is not a sanctions determination and is not legal advice. Always confirm the official list at the entry's source_url.
A shorter OFAC-only walkthrough, written for RapidAPI keys, is already on the Sanctions Watch listing. This post uses the same /screen contract, adds the UK list, and shows the direct api.wryborg.com call as well as the RapidAPI equivalent.
Get a Sanctions Watch key
You can call the API with a key from wryborg.com, from the RapidAPI listing, or from the API.market store. Pick one path and stay on it: the host and auth headers are not interchangeable.
Direct (wryborg.com)
- Create an account at wryborg.com/account/signup. The form is email and password; the free tier does not ask for a card.
- Verify your email.
- Subscribe to Sanctions Watch. A free tier is available (100 calls a month, and it includes fuzzy name screening). If you choose a paid plan, payment is handled by Stripe. Plans are on the Sanctions Watch pricing page.
- Copy the key from your account. It starts with
wrb_and is not emailed.
Each Wryborg API is its own subscription and its own key. A key issued for a different API returns 403 on this one.
export WRYBORG_API_KEY=wrb_your_key
python3 -m pip install requests
The base URL is https://api.wryborg.com/sanctions/v1. Send the key in the X-API-Key header. Interactive docs are at api.wryborg.com/sanctions/v1/docs. The OpenAPI document is at api.wryborg.com/sanctions/v1/openapi.json. Curl, Python, and JavaScript samples live in github.com/wryborg/wryborg-api-examples.
RapidAPI
Subscribe on the Sanctions Watch API listing (a free plan is available and includes fuzzy name screening). Calls go to https://sanctions-watch-api.p.rapidapi.com with X-RapidAPI-Key and X-RapidAPI-Host: sanctions-watch-api.p.rapidapi.com. The path is still /screen; do not add /sanctions/v1.
GET /health and GET /sources on api.wryborg.com are public and do not need a key. /sources reports which lists are loaded, which are marked supported or partial, and the licence notes and known gaps for each list.
Ten lines
name is the only required query parameter (2Γ’β¬β200 characters). min_score defaults to 85 (allowed range 50Γ’β¬β100). limit defaults to 10 and caps at 50. Omitted jurisdiction stays on OFAC (the SDN and Consolidated lists). Allowed jurisdiction values are US, EU, GB, CA, AU, UN, a comma-separated list, or all.
To screen OFAC and the UK Sanctions List together, pass jurisdiction=US,GB:
import os, requests
r = requests.get("https://api.wryborg.com/sanctions/v1/screen",
headers={"X-API-Key": os.environ["WRYBORG_API_KEY"]},
params={"name": "Example Name", "jurisdiction": "US,GB"},
timeout=30)
r.raise_for_status()
data = r.json()
print(data["result"], data["complete"], data["count"], data["total"])
for m in data["matches"]:
e = m["entry"]
print(m["score"], m["matched_name"], e["source"], e["id"], e["source_url"])
Replace "Example Name" with the full name you want to screen. An empty matches array is still a successful, billable 200. That is not a clearance. Use result and complete, not an empty list, to decide what happened.
The same call in curl:
curl -sS -H "X-API-Key: ${WRYBORG_API_KEY}" \
--get --data-urlencode "name=Example Name" \
--data-urlencode "jurisdiction=US,GB" \
"https://api.wryborg.com/sanctions/v1/screen"
If you subscribed on RapidAPI, the Python is the same contract on a different host:
import os, requests
r = requests.get("https://sanctions-watch-api.p.rapidapi.com/screen",
headers={"X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"],
"X-RapidAPI-Host": "sanctions-watch-api.p.rapidapi.com"},
params={"name": "Example Name", "jurisdiction": "US,GB"},
timeout=30)
r.raise_for_status()
data = r.json()
print(data["result"], data["complete"], data["count"], data["total"])
for m in data["matches"]:
e = m["entry"]
print(m["score"], m["matched_name"], e["source"], e["id"], e["source_url"])
/screen does not take a date of birth or a country, so a candidate is not disambiguated that way. If you have those attributes, use them in your own review against the official entry at source_url.
What comes back
A successful screen response includes query, min_score, count, total, matches, and disclaimer. It also includes adjudication (default not_performed), clearance (null), result, coverage, complete, and warnings. count is how many matches this response returns. total is every match at or above min_score. When total is greater than count, the page is truncated.
result is one of no_candidates, incomplete, candidates, or candidates_incomplete. coverage reports the lists that were in scope for this call. When a source in scope is failed, stale, or not loaded, the default is an unbilled 503 with result incomplete, complete false, and no matches. allow_incomplete=true asks for a billed partial screen instead. Do not treat a missing or incomplete source as a clean result.
Each match includes score, matched_name, and entry, and may include score_method (default token_sort_ratio), matched_field, matched_name_raw, explanation, and identity_determination (default false). The entry object documents id, source, source_url, retrieved_at, and last_verified_at, and may include additional list fields. For an OFAC entry, source_url is that entry's Sanctions List Search details page (https://sanctionssearch.ofac.treas.gov/Details.aspx?id= plus the numeric uid). For a UK hit, source and source_url point at the UK list entry; confirm that official page, not an OFAC URL.
The following JSON is illustrative of the documented schema, not a live API response. Do not treat the names, scores, or ids as a real screening result. A real US,GB call can return OFAC hits, UK hits, both, or neither.
{
"query": "Example Name",
"min_score": 85,
"count": 1,
"total": 1,
"matches": [
{
"score": 100,
"matched_name": "EXAMPLE NAME",
"score_method": "token_sort_ratio",
"identity_determination": false,
"entry": {
"id": "sdn-12345",
"source": "OFAC SDN List",
"source_url": "https://sanctionssearch.ofac.treas.gov/Details.aspx?id=12345",
"retrieved_at": "2026-11-02T11:40:18+00:00",
"last_verified_at": "2026-11-02T17:40:18+00:00"
}
}
],
"disclaimer": "<the API's screening disclaimer; always confirm the official list at source_url>",
"adjudication": "not_performed",
"clearance": null,
"result": "candidates",
"complete": true
}
Adding the UK list, carefully
OFAC SDN and Consolidated are the default, and /sources marks them supported. The UK Sanctions List is opt-in via jurisdiction=GB (or US,GB, or all). On a public GET /sources check at 9:57 PM ET on 1 December 2026, the UK list was loaded and marked partial, not supported. Confirm current coverage against /sources rather than assuming it is unchanged.
A few limits from that same /sources document, which you should re-read before you rely on a UK result:
- The feed is the UK Sanctions List XML. The older OFSI Consolidated List of Asset Freeze Targets closed on 28 January 2026 and is not ingested.
- One Unique ID is one regime designation. The same person can have several Unique IDs. The API does not merge them.
- The separate Russia financial and investment restrictions list is not this file.
-
/sourcesalso publishes licence notes and legal limits for the UK list. Read them there; they can change.
EU, Canada, Australia, and UN lists are likewise opt-in and were also marked partial on that check. If UN is in scope, keep the UN Security Council Consolidated List attribution. This API does not apply OFAC's 50% ownership rule to unlisted entities.
Caveats you should not skip
Use a full name. A single token that exactly equals one whole token of a name or alias, after case, diacritic, and transliteration normalization, scores 90 when that token is at least three characters and is not a generic token such as Bank, Company, Group, or Ltd. That clears the default min_score of 85. It does not score 100, and min_score=100 does not return those surname-only hits. An exact full name stays on token_sort_ratio at 100. In short: a surname alone can rank above the default cutoff, and the API will warn you on some single-token queries.
A human has to review candidates. identity_determination defaults to false. adjudication defaults to not_performed. clearance is null. The API is ranking possible matches for triage. It is not deciding that the person or entity you screened is, or is not, the listed party.
No match is not a clearance. result: "no_candidates" means this snapshot produced no rows at or above min_score, not that the name is cleared.
The data may be delayed or incomplete. OFAC data is derived from official U.S. government records (the SDN and Consolidated lists). The UK list, and the other jurisdictions, use their official files when requested. Sanctions Watch re-reads those list files about every six hours, so a name that appeared on a list in the last few hours may not be in the current snapshot. retrieved_at is when ingest first stored the entry; last_verified_at is when ingest last rechecked it. GET /sources and GET /health show load status and the last successful ingest per source.
This is not legal advice, and Wryborg is not affiliated with OFAC, the UK list publisher, or any other list publisher. The official list at source_url controls. False positives happen; fuzzy scores are expected to. Build a review step before you block, file, or tell a customer that someone is sanctioned.
Watch total and warnings. If more matches exist than limit, raise limit (the maximum is 50). When limit is already 50, a warning tells you that is the cap. Those warnings are omitted when there is nothing to add.
GET /entries is not the free-plan screen. Browsing stored entries is documented as Pro and above. Free plans use /screen. A missing or unrecognized key is 401 (missing_api_key or invalid_api_key). Failed authentication is rate limited (30 failures per IP, and 300 across all IPs, each minute), so do not retry a bad key in a tight loop. Over the monthly quota or the per-second limit, the API returns 429. GET /usage reports quota and does not consume a call.
Do not put a key in a public web page.
Further reading
- Wryborg and Sanctions Watch pricing
- Create an account
- Sanctions Watch on RapidAPI, including the OFAC name screening tutorial
- Wryborg on API.market
- Sanctions Watch docs
- Code samples on GitHub
- UN Security Council Consolidated List
- Related: Food allergen alerts in 10 minutes on RapidAPI, and the longer food-recall allergen alert on this blog
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.