API V2
IP-to-Country Endpoint
Look up BIN-backed country information without an API key.
POST
/v2/ip-country
API key
Not required.
Parameters
| Name | Required | Description |
|---|---|---|
| ip | Yes | Body field. IPv4 or IPv6 address to look up. |
| format | No | Optional body field. Supported values: json plain xml jsonp php csv serialized. |
Example Request
POST https://api.iplocation.net/v2/ip-country
Content-Type: application/json
{
"ip": "8.8.8.8"
}
Example Response
{
"ip": "8.8.8.8",
"ip_number": "",
"ip_version": "4",
"country_name": "United States of America",
"country_code2": "US",
"response_code": "200",
"response_message": "OK"
}