Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 6 min read

OFAC screening in 10 lines of Python

Name screening against the U.S. Treasury OFAC lists can start with a single HTTP request. The Wryborg Sanctions Watch API exposes fuzzy name screening as GET /screen. This post shows a 10-line Python caller, then the cav

Name screening against the U.S. Treasury OFAC lists can start with a single HTTP request. The Wryborg Sanctions Watch API exposes fuzzy name screening as GET /screen. This post shows a 10-line Python caller, then the caveats you should not skip.

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 source_url.

Get a Sanctions Watch key

  1. Create an account at wryborg.com/account/signup.
  2. Verify your email.
  3. Subscribe to Sanctions Watch (a free tier is available, and it includes fuzzy name screening). If you choose a paid plan, payment is handled by Stripe.
  4. 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, such as Food Recall Monitor, returns 403 with error.code api_mismatch on this one. Plans and quotas are on the Sanctions Watch pricing page.

export WRYBORG_API_KEY=wrb_your_key
python3 -m pip install requests

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. A runnable Postman collection is in the public Wryborg APIs workspace.

The base URL is https://api.wryborg.com/sanctions/v1. Send the key in the X-API-Key header. By default, /screen searches the OFAC SDN and Consolidated lists. UK, EU, UN, Canada, and Australia lists are included when you set the jurisdiction parameter (US, EU, GB, CA, AU, UN, a comma-separated list, or all). Contains data from the United Nations Security Council Consolidated List. The lists are re-read about every six hours.

PEP and adverse media are documented as unsupported coverage, not live feeds. GET /health and GET /sources are public and do not need a key. /sources reports which lists are loaded and which screening types are unavailable.

Ten lines

name is the only required query parameter. min_score defaults to 85 (allowed range 50Γ’β‚¬β€œ100). limit defaults to 10 and caps at 50. Omitted jurisdiction stays on OFAC.

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"}, 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["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.

The same call in curl:

curl -sS -H "X-API-Key: ${WRYBORG_API_KEY}" \
  --get --data-urlencode "name=Example Name" \
  "https://api.wryborg.com/sanctions/v1/screen"

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.

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. The schema allows additional list fields on entry. 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).

result is one of no_candidates, incomplete, candidates, or candidates_incomplete. Use that field, and complete, rather than treating an empty matches list as a pass.

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.

{
  "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
}

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.

/screen does not take a date of birth or a country. 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.

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. If a source in scope is failed, stale, or unloaded, the screen may be incomplete or candidates_incomplete. allow_incomplete=true returns a billed partial screen in that situation; the default is to avoid presenting a partial result as complete.

The data may be delayed or incomplete. OFAC data is derived from official U.S. government records (the SDN and Consolidated lists). Other jurisdictions use their official lists 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 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.

Other jurisdictions are opt-in. Add jurisdiction=all (or a comma-separated list) only when you intend to search them, and keep the UN Security Council Consolidated List attribution. On a public GET /sources check on 22 November 2026 (America/New_York), OFAC SDN and Consolidated were reported as supported; the UK, Canada, Australia, EU, and UN lists were reported as partial. Confirm current coverage against /sources rather than assuming it is unchanged.

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).

Sanctions Watch currently allows any browser origin (Access-Control-Allow-Origin: *). Do not put a key in a public web page anyway.

Further reading

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.