Geographic Restrictions
Openfish blocks order placement from certain locations for regulatory and sanctions compliance. Applications should implement geoblock checks to give users feedback before they attempt to trade.
Endpoint
Section titled “Endpoint”GET /api/geoblock
Base URL: https://api.openfish.fun
Authentication
Section titled “Authentication”None required.
Parameters
Section titled “Parameters”None. The endpoint uses the requesting IP address and proxy/CDN headers to determine location.
Response
Section titled “Response”{ "blocked": false, "closeOnly": false, "ip": "203.0.113.42", "country": "JP", "region": ""}| Field | Type | Description |
|---|---|---|
blocked | boolean | Whether the user is fully blocked from trading |
closeOnly | boolean | Whether the user is in close-only mode (can sell but not buy) |
ip | string | Detected IP address |
country | string | ISO 3166-1 alpha-2 country code |
region | string | Region/state code (if available) |
Blocked Countries
Section titled “Blocked Countries”Fully restricted — all trading operations blocked:
| Code | Country |
|---|---|
| US | United States |
| BY | Belarus |
| CU | Cuba |
| IR | Iran |
| IQ | Iraq |
| CI | Cote d’Ivoire |
| LR | Liberia |
| KP | North Korea |
| SD | Sudan |
| SY | Syria |
| ZW | Zimbabwe |
| MM | Myanmar |
Close-Only Countries
Section titled “Close-Only Countries”Users can close/sell existing positions but cannot open new ones:
| Code | Country |
|---|---|
| PL | Poland |
| SG | Singapore |
| TH | Thailand |
| TW | Taiwan |
Example
Section titled “Example”curl https://api.openfish.fun/api/geoblockIP Detection
Section titled “IP Detection”The endpoint extracts the client IP from proxy headers in this order of priority:
CF-Connecting-IP(Cloudflare)X-Real-IPX-Forwarded-For(first IP)
Country is determined from CF-IPCountry or X-Country-Code headers.