Geolocate an IP address and flag sanctioned countries
Updated
The geolocation endpoint resolves an IP address to its city, region, and country, and immediately tells you whether that country is subject to sanctions. This lets you combine location data and compliance checks in a single call rather than running them separately.
How to use it
- Geolocate a specific IP address by calling
GET /api/v1/geo/{ip_address}, replacing{ip_address}with the address you want to look up. - Geolocate the calling client's IP by omitting the path parameter and calling
GET /api/v1/geo. CompliAPI evaluates the IP of the incoming request. - Authenticate your request with a bearer API token in the
Authorizationheader, or use x402 pay-per-request if you don't have an account. - Read the response — check
sanctionedto see whether the resolved country carries a sanctions designation.
Response shape
{ "ip": "91.218.114.206", "city": "Moscow", "region": "Moscow", "country": "RU", "sanctioned": true, "source_url": "..." }
When sanctioned is true, the source_url field points directly at the sanctions program that covers the country, giving you an authoritative reference you can log or surface to your compliance team.
Tips and limits
This endpoint is metered — each call costs one credit. A sanctioned: true result means the IP's resolved country carries a sanctions designation; it does not by itself mean the individual user is on a sanctions list. For a complete screening workflow, combine this endpoint with the VPN detection endpoint (to catch users masking their location) and the appropriate screening endpoints (to check identities, wallets, or email addresses directly). The source_url in the response is a reliable audit trail entry if you need to document why a session was flagged or blocked.