A REST API for searching the U.S. Treasury's Office of Foreign Assets Control (OFAC) sanctions lists.
- Fuzzy name search using FTS5 trigram matching
- Exact name matching with support for first/last name components
- Address search by country, city, street address, or postal code
- ID search by passport, tax ID, national ID, and other identification types
- Batch search for efficient bulk searching
- Human-readable summaries for easy interpretation of results
npm install
npm run devThe server starts on http://localhost:3000. Swagger docs available at /docs.
GET /- Health checkGET /stats- Database statistics (entity counts by type and list)
GET /search?q=<query>- Generic fuzzy search across all namesGET /search/name- Name-specific search with exact or fuzzy matchingGET /search/address- Search by address componentsGET /search/id- Search by identification documentsPOST /batch- Batch search for multiple queries
| Parameter | Description |
|---|---|
list |
Filter by list: sdn or cons |
type |
Filter by entity type: individual, entity, vessel, aircraft (comma-separated) |
limit |
Max results (1-200, default 50) |
offset |
Pagination offset |
curl "http://localhost:3000/search?q=bank"curl "http://localhost:3000/search/name?name=Mohammad%20Hassan&fuzzy=false"curl "http://localhost:3000/search/name?first_name=Mohammad&last_name=Hassan"curl "http://localhost:3000/search/address?country=Russia&city=Moscow"curl "http://localhost:3000/search/id?id_value=ABC123&id_type=passport"curl -X POST "http://localhost:3000/batch" \
-H "Content-Type: application/json" \
-d '{
"queries": [
{"id": "1", "search_type": "name", "name": "ali", "fuzzy": true},
{"id": "2", "search_type": "address", "country": "IR"},
{"id": "3", "search_type": "id", "id_value": "ABC123"}
]
}'All search responses include:
success: Boolean indicating successquery: Echo of search parameterstotal: Total matching resultsresults: Array of matching entities with names, addresses, and IDshuman_readable: Natural language summary of resultsdisclaimer: Legal disclaimer
- SDN List: Specially Designated Nationals and Blocked Persons
- Consolidated List: Non-SDN Consolidated Sanctions List
Data is downloaded from the U.S. Treasury and cached locally for performance.
Interactive Swagger documentation is available at /docs when the server is running.
OpenAPI 3.0 specification is available at /docs/json.
# Start the server first
npm run dev
# In another terminal, run tests
npx tsx scripts/api-tests.tsThis API provides access to sanctions information for informational purposes only and does not constitute official guidance. The data is provided "as is" without warranties of any kind, and may be incomplete or out of date. Users should verify results against official sources before making decisions or taking action. The provider disclaims any liability for decisions or actions taken based on this information. By using the API, you acknowledge responsibility for compliance with applicable laws and regulations.
For official OFAC information, visit: https://ofac.treasury.gov/
MIT