Newline Separated

Usage

To receive the response in Newline (\n) separated values format, send a GET request to

http://ip-api.com/line

You can supply an IP address or domain to lookup, or none to use your current IP address.

Response

A successful request will return, by default, the following:

 1: success
 2: COUNTRY
 3: COUNTRY CODE
 4: REGION CODE
 5: REGION NAME
 6: CITY
 7: ZIP CODE
 8: LATITUDE
 9: LONGITUDE
10: TIME ZONE
11: ISP NAME
12: ORGANIZATION NAME
13: AS NUMBER / NAME
14: IP ADDRESS USED FOR QUERY

List of returned values

A failed request will return, by default, the following:

1: fail
2: ERROR MESSAGE
3: IP ADDRESS USED FOR QUERY

List of error messages

Selectable return values

Usage limits

Our system will automatically ban any IP addresses doing over 150 requests per minute. To unban your IP click here.

You are free to use ip-api.com for non-commercial use. We do not allow commercial use without prior approval.

For commercial, unlimited use see our pro service.

Examples

http://ip-api.com/line/208.80.152.201

success
United States
US
CA
California
San Francisco
94105
37.7898
-122.3942
America/Los_Angeles
Wikimedia Foundation
Wikimedia Foundation
AS14907 Wikimedia US network
208.80.152.201

Bash Example

Set local variables country and IP:

read COUNTRY IP <<< $(wget -qO- http://ip-api.com/line/?fields=countryCode,query); echo $IP $COUNTRY

Output only the IP:

wget -qO- ip-api.com/line/?fields=query