Screen any crypto wallet against the OFAC SDN list using Python and the SanctionsAI API.
import requests
def check_sanctions(wallet):
resp = requests.get(
"https://sanctionsai.dev/sanctions",
params={"wallet": wallet}, timeout=5
)
data = resp.json()
return data.get("blocked", False), data.get("matches", [])
blocked, matches = check_sanctions("0x098B716B8Aaf21512996dC57EB0615e2383E2f96")
print(f"Blocked: {blocked}, Matches: {matches}")import requests, time, logging
def check_safe(wallet, retries=3):
for attempt in range(retries):
try:
resp = requests.get("https://sanctionsai.dev/sanctions",
params={"wallet": wallet}, timeout=5)
resp.raise_for_status()
return resp.json()
except requests.RequestException:
if attempt < retries - 1:
time.sleep(2 ** attempt)
raise Exception("Screening failed")Check any wallet, name, or entity against OFAC, EU, UN sanctions lists in real time.
Free wallet checker