ip2location facebbook  ip2location twitter  ip2location google+ ip2location github

IP2Location™ Web Service

USD $49.00 / 100,000 Credits * For 1 year

IP2Location™ web service is providing a service to do a reverse lookup of an IP address to an ISO3166 country code, region or state, city, latitude and longitude, ZIP/Postal code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, and usage type. To search, submit a query string and a set of parameters to the IP2Location™ Web APIs service and you will receive a search result. Search results are derived from IP2Location™ index of over 4 billion unique IP addresses.

IPv4 and IPv6 supported.

 

OVERVIEW

All successful HTTP or HTTPS request will return a response code of 200. In our web API, it also returns the lookup country code if successful or error code if failed.

Each API unit subscription allows 100,000 query credits. If you need more credits, please add multiple units during checkout. Total credits will be in multiplier (x 100,000) of number of units paid. An unique API key will be provided to query the web service.

IP2Location™ Web API uses a single web interface to perform the reverse lookup logic. The protocol used is HTTP or HTTPS GET. You can test this API as easy as using a web browser.

api.ip2location.com/?ip=<ip_address>&key=<your_api_key>&package=<WS1|WS2|WS3|...|WS24>

 

FEATURES

 

PARAMETERS
Name Description
key (required) API key.
ip (required) IP address (IPv4 or IPv6) for reverse lookup purpose. If not present, the server IP address will be used for the reverse lookup.
package (optional) If not present, the web service will assume the WS1 package query.
Valid value: WS1 | WS2 | WS3 | WS4 | WS5 | WS6 | WS7 | WS8 | WS9 | WS10 | WS11 | WS12 | WS13 | WS14 | WS15 | WS16 | WS17 | WS18 | WS19 | WS20 | WS21 | WS22 | WS23 | WS24

Please refer to the below pricing table for value returned.
format (optional) If not present, text format will be returned as the search result. Valid value: json | xml

 

DEMO

You can try out our web service by using the demo key. For example, http://api.ip2location.com/?ip=8.8.8.8&key=demo. Demo query limit is 20 per day.

IPv4:

api.ip2location.com/?ip=185.234.57.183&key=demo&package=WS10


IPv6:
api.ip2location.com/?ip=2607:f8b0:4001:c02::93&key=demo&package=WS1

 

PRICING
We offer you 24 packages for your IP query. Each package returns you a different set of IP information with different credits required for each query.
Package Information Returned Credit
WS1 Country Code 1 credit
 
WS2 Country, ISP 2 credits
 
WS3 Country, Region, City 2 credits
 
WS4 Country, Region, City, ISP 3 credits
 
WS5 Country, Region, City, Latitude, Longitude 3 credits
 
WS6 Country, Region, City, Latitude, Longitude, ISP 4 credits
 
WS7 Country, Region, City, ISP, Domain 4 credits
 
WS8 Country, Region, City, Latitude, Longitude, ISP, Domain 5 credits
 
WS9 Country, Region, City, Latitude, Longitude, ZIPCode 4 credits
 
WS10 Country, Region, City, Latitude, Longitude, ZIPCode, ISP, Domain 6 credits
 
WS11 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone 5 credits
 
WS12 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain 7 credits
 
WS13 Country, Region, City, Latitude, Longitude, TimeZone, NetSpeed 5 credits
 
WS14 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain, NetSpeed 8 credits
 
WS15 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, AreaCode 7 credits
 
WS16 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain, NetSpeed, AreaCode 10 credits
 
WS17 Country, Region, City, Latitude, Longitude, TimeZone, NetSpeed, Weather 6 credits
 
WS18 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain, NetSpeed, AreaCode, Weather 11 credits
 
WS19 Country, Region, City, Latitude, Longitude, ISP, Domain, Mobile 8 credits
 
WS20 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain, NetSpeed, AreaCode, Weather, Mobile 13 credits
 
WS21 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, AreaCode, Elevation 8 credits
 
WS22 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain, NetSpeed, AreaCode, Weather, Mobile, Elevation 14 credits
 
WS23 Country, Region, City, Latitude, Longitude, ISP, Domain, Mobile, UsageType 11 credits
 
WS24 Country, Region, City, Latitude, Longitude, ZIPCode, TimeZone, ISP, Domain, NetSpeed, AreaCode, Weather, Mobile, Elevation, UsageType 18 credits
 
API Examples:
WS1 Query: http://api.ip2location.com/?ip=<ip_address>&key=<your_api_key>
WS1 Response: US
 
WS24 Query: http://api.ip2location.com/?ip=<ip_address>&key=<your_api_key>&package=WS24
WS24 Response: US;United States;California;Mountain View;37.405992;-122.078515;94043;-08:00;Google Inc.;google.com;T1;1;650;USCA0746;Mountain View;-;-;-;31;SES
Web service response format

The web service supports text, json and xml response format. Below please find the details:

Format Example query string and response value
text query string:
http://api.ip2location.com/?ip=<ip_address>&key=<your_api_key>&package=WS24

response format:
US;United States;California;Mountain View;37.405992;-122.078515;94043;-08:00;Google Inc.;google.com;T1;1;650;USCA0746;Mountain View;-;-;-;31;SES


json query string:
http://api.ip2location.com/?ip=<ip_address>&key=<your_api_key>&package=WS24&format=json

response format:
{
"country_code":"US",
"country_name":"United States",
"region_name":"California",
"city_name":"Mountain View",
"latitude":"37.405992",
"longitude":"-122.078515",
"zip_code":"94043",
"time_zone":"-08:00",
"isp":"Google Inc.",
"domain":"google.com",
"net_speed":"T1",
"idd_code":"1",
"area_code":"650",
"weather_station_code":"USCA0746",
"weather_station_name":"Mountain View",
"mcc":"-",
"mnc":"-",
"mobile_brand":"-",
"elevation":"31",
"usage_type":"SES"
}


xml query string:
http://api.ip2location.com/?ip=<ip_address>&key=<your_api_key>&package=WS24&format=xml

response format:
<result>
<country_code>US</country_code>
<country_name>United States</country_name>
<region_name>California</region_name>
<city_name>Mountain View</city_name>
<latitude>37.405992</latitude>
<longitude>-122.078515</longitude>
<zip_code>94043</zip_code>
<time_zone>-08:00</time_zone>
<isp>Google Inc.</isp>
<domain>google.com</domain>
<net_speed>T1</net_speed>
<idd_code>1</idd_code>
<area_code>650</area_code>
<weather_station_code>USCA0746</weather_station_code>
<weather_station_name>Mountain View</weather_station_name>
<mcc>-</mcc>
<mnc>-</mnc>
<mobile_brand>-</mobile_brand>
<elevation>31</elevation>
<usage_type>SES</usage_type>
</result>


Note: The web service supports both HTTP and HTTPS queries.