📖 API Documentation

IP 2 Location JSON API — free, no key required

Base URL

https://ip.nored.su/api

Endpoints

GET /api

Returns geolocation and ASN info for the requester's IP address.

No parameters required.

GET /api?ip={address}

Returns geolocation and ASN info for a specific IPv4 or IPv6 address.

Parameter Type Description
ip string IPv4 or IPv6 address to look up

Response Fields

Field Type Description
status string success, error, or not_found
ip string The queried IP address
data.country string ISO 3166-1 country code (e.g. US)
data.country_name string Full country name
data.region string State or region name
data.city string City name
data.latitude float Latitude coordinate
data.longitude float Longitude coordinate
data.zip_code string Postal / ZIP code
data.timezone string UTC offset (e.g. -07:00)
data.asn string Autonomous System Number
data.as string AS name / organization

* Not all fields are returned for every IP. Only available data is included.

Examples

cURL

# Look up your own IP
curl https://ip.nored.su/api

# Look up a specific IP
curl https://ip.nored.su/api?ip=8.8.8.8

JavaScript (fetch)

fetch('https://ip.nored.su/api?ip=8.8.8.8')
  .then(res => res.json())
  .then(data => {
    console.log(data.data.country);  // "US"
    console.log(data.data.city);     // "Mountain View"
  });

PHP

$response = file_get_contents('https://ip.nored.su/api?ip=1.1.1.1');
$data = json_decode($response, true);
echo $data['data']['country_name']; // "Australia"

Python

import requests
r = requests.get('https://ip.nored.su/api?ip=8.8.8.8')
data = r.json()
print(data['data']['city'])  # "Mountain View"

Example Response

✅ Success (200)

{
    "status": "success",
    "ip": "8.8.8.8",
    "data": {
        "country": "US",
        "country_name": "United States of America",
        "region": "California",
        "city": "Mountain View",
        "latitude": 37.38605,
        "longitude": -122.08385,
        "zip_code": "94043",
        "timezone": "-07:00",
        "asn": "15169",
        "as": "GOOGLE"
    }
}

❌ Error (400)

{
    "status": "error",
    "message": "Invalid or missing IP address",
    "ip": "not-an-ip"
}

🔍 Not Found (404)

{
    "status": "not_found",
    "ip": "0.0.0.0",
    "message": "No data found for this IP"
}

HTTP Status Codes

Code Meaning
200 Success — data returned
400 Bad request — invalid or missing IP
404 Not found — no data for the given IP
500 Server error — database lookup failed

Notes