Redirect.li API
Access the Redirect.li service through the API.
Geo IP
Get my IP
Get detailed geo information for the client's IP address
Query Example
curl https://api.redirect.li/v1/ip/
200 Success
This JSON object will be returned on a successful query.
The IP address that was requested
IP address version (4 or 6)
IP Status code for the results (unknown, private, or geoip)
ISO code for the country (only for geoip code)
Country name (only for geoip code)
ISO code for the country region (only for geoip code)
Region name (only for geoip code)
City name (only for geoip code)
Location postal/zip code (only for geoip code)
Location timezone (only for geoip code)
Latitude value (only for geoip code)
Longitude value (only for geoip code)
Radius in which the lat/long value is accurate (metres) (only for geoip code)
Example
HTTP/1.1 200 OK
{
"ip": "86.163.132.1",
"ipType": 4,
"code": "geoip",
"countryCode": "GB",
"countryName": "United Kingdom",
"regionCode": "ENG",
"regionName": "England",
"city": "London",
"postCode": "W2",
"timeZone": "Europe/London",
"latitude": 55.5333,
"longitude": -1.1833,
"accuracyRadius": 1
}
Get IP
Gets detailed geo information for the given IP address.
URL Parameters
These parameters are supplied in the request URL.
IP address (v4 or v6)
Query Example
curl https://api.redirect.li/v1/ip/192.168.1.1
200 Success
This JSON object will be returned on a successful query.
The IP address that was requested
IP address version (4 or 6)
IP Status code for the results (unknown, private, or geoip)
ISO code for the country (only for geoip code)
Country name (only for geoip code)
ISO code for the country region (only for geoip code)
Region name (only for geoip code)
City name (only for geoip code)
Location postal/zip code (only for geoip code)
Location timezone (only for geoip code)
Latitude value (only for geoip code)
Longitude value (only for geoip code)
Radius in which the lat/long value is accurate (metres) (only for geoip code)
Example
HTTP/1.1 200 OK
{
"ip": "86.163.132.1",
"ipType": 4,
"code": "geoip",
"countryCode": "GB",
"countryName": "United Kingdom",
"regionCode": "ENG",
"regionName": "England",
"city": "London",
"postCode": "W2",
"timeZone": "Europe/London",
"latitude": 55.5333,
"longitude": -1.1833,
"accuracyRadius": 1
}