Financial services, crypto, gaming, and export-controlled SaaS all need a country determination on every request — and a paper trail for audits.
| Field | Use |
|---|---|
country | ISO 3166-1 alpha-2, RIR-sourced. Check against OFAC SDN, EU sanctions, UK HMT lists. |
registry | Which RIR allocated the block. Useful for regional enforcement audits. |
is_vpn, is_datacenter | Flag attempts to bypass geo blocks via VPN or cloud relays. |
abuse_contact roadmap | For automated takedown notices when you detect abuse. |
// Current US-OFAC comprehensive-sanctions list (2026) const BLOCKED = ['IR', 'KP', 'SY', 'CU']; app.use(async (req, res, next) => { const r = await ipa.lookup(req.ip); if (BLOCKED.includes(r.country)) { audit.log({ event: 'sanctions-block', ip: req.ip, country: r.country, ts: Date.now() }); return res.status(451).send('Service not available in your jurisdiction.'); } if (r.is_vpn) { // extra scrutiny: challenge with KYC step-up } next(); });