IP Location.net API site

API V2

IP Location Endpoint

Look up full IP location and network information with a valid API key.

POST /v2/ip-location

API key

Required. Send an active key in the Authorization header as Bearer YOUR_API_KEY. This endpoint does not fall back to IP-to-Country when the bearer token is missing.

Parameters

Name Required Description
ip Yes Body field. IPv4 or IPv6 address to look up.
Authorization Yes Header. Use Bearer YOUR_API_KEY.
format No Optional body field. Supported values: json plain xml jsonp php csv serialized.

Example Request

POST https://api.iplocation.net/v2/ip-location
Authorization: Bearer YOUR_API_KEY
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",
    "isp": "Google LLC",
    "city_name": "Mountain View",
    "region_name": "California",
    "latitude": "37.4056",
    "longitude": "-122.0775",
    "time_zone": "-08:00",
    "asn": "15169",
    "as_name": "Google LLC",
    "network_type": "DCH",
    "network_type_label": "(DCH) - Data Center",
    "response_code": "200",
    "response_message": "OK"
}