A Go CLI tool for querying the OFAC SDN (Specially Designated Nationals) Enhanced XML list.
Indexes a 101MB XML file containing 18,707 entities in 2-3 seconds; all subsequent queries respond in <50ms.
go build -o ofac-sdn ../ofac-sdn buildThe index is saved to ~/.cache/ofac-sdn/index.db.
Custom XML/DB path:
./ofac-sdn build --xml /path/to/SDN_ENHANCED.XML --db /path/to/index.dbSearch by name:
./ofac-sdn search --name "banco nacional"
./ofac-sdn search --name "putin"Filter by program:
./ofac-sdn search --program IRAN
./ofac-sdn search --program CUBA --type EntityFilter by type:
./ofac-sdn search --type Vessel
./ofac-sdn search --type Aircraft --program RUSSIA-EO14024Filter by country:
./ofac-sdn search --country Russia
./ofac-sdn search --country Iran --type Individual --limit 50Combinations (AND logic):
./ofac-sdn search --program IRAN --type Individual --name "ali"Single entity detail:
./ofac-sdn get --id 306
./ofac-sdn get --id 35096JSON output:
./ofac-sdn search --name "putin" --json
./ofac-sdn get --id 306 --jsonVerbose output:
./ofac-sdn search --program CUBA --verbose./ofac-sdn list-programs # all program codes and counts
./ofac-sdn list-countries # all countries and counts| Flag | Description |
|---|---|
--xml PATH |
Path to XML file (default: ./SDN_ENHANCED.XML) |
--db PATH |
Path to index database (default: ~/.cache/ofac-sdn/index.db) |
--json |
JSON output |
--verbose |
Full detailed output |
Environment variables: OFAC_XML_PATH, OFAC_DB_PATH
Individual— Individuals (7,391 records)Entity— Companies/Organizations (9,519 records)Vessel— Ships (1,455 records)Aircraft— Aircraft (342 records)