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

GEThttps://api.redirect.li/v1/ip/

Query Example

curl https://api.redirect.li/v1/ip/

200 Success

This JSON object will be returned on a successful query.

ipString

The IP address that was requested

ipTypeInteger

IP address version (4 or 6)

codeString

IP Status code for the results (unknown, private, or geoip)

countryCodeString

ISO code for the country (only for geoip code)

countryNameString

Country name (only for geoip code)

regionCodeString

ISO code for the country region (only for geoip code)

regionNameString

Region name (only for geoip code)

cityString

City name (only for geoip code)

postCodeString

Location postal/zip code (only for geoip code)

timeZoneString

Location timezone (only for geoip code)

latitudefloat

Latitude value (only for geoip code)

longitudefloat

Longitude value (only for geoip code)

accuracyRadiusfloat

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.

GEThttps://api.redirect.li/v1/http/:ip

URL Parameters

These parameters are supplied in the request URL.

:ipipv4 | ipv6

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.

ipString

The IP address that was requested

ipTypeInteger

IP address version (4 or 6)

codeString

IP Status code for the results (unknown, private, or geoip)

countryCodeString

ISO code for the country (only for geoip code)

countryNameString

Country name (only for geoip code)

regionCodeString

ISO code for the country region (only for geoip code)

regionNameString

Region name (only for geoip code)

cityString

City name (only for geoip code)

postCodeString

Location postal/zip code (only for geoip code)

timeZoneString

Location timezone (only for geoip code)

latitudefloat

Latitude value (only for geoip code)

longitudefloat

Longitude value (only for geoip code)

accuracyRadiusfloat

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
}