• Your shopping cart is empty!
WS

IP2Location™ IP Geolocation Web Service

$49 / 100,000 credits For 1 year

IP2Location™ IP Geolocation web service is a REST API providing a service to do a reverse IP location lookup for 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™ REST API service and you will get the IP location lookup within seconds. Search results are derived from the IP2Location™ index of over 4 billion unique IP addresses.

IPv4 and IPv6 supported.

Overview

All successful HTTP or HTTPS requests will return a response code of 200, together with the lookup information. Error code will be returned if error occurred.

Each unit of package purchase entitles you to 100,000 query credits. If you need more credits, please add multiple units during checkout. Total credits will be the number of units purchased multiplied by 100,000. However, please note that only one unique API key will be given for each user account, even if multiple units are purchased. If you need a different API key, you should sign up using a different email account.

IP2Location™ web service is a RESTful API call for geolocation lookup. The REST API supports both HTTP GET or HTTPS GET. You can test this REST API easily using a web browser with the below syntax.

https://api.ip2location.com/?ip={IP_ADDRESS}&key={YOUR_API_KEY}&package={WS1|WS2|WS3|...|WS24}

Features

  • No database to download, to install or to upgrade in the server side
  • Supports 24 different types of package query with different granularity of data.
  • Supports HTTP or HTTPS queries up to 100,000 times or 1 year (whichever comes first)

Parameters

Name Description
key (required) API key.
ip (required) IP address (IPv4 or IPv6) for reverse IP location lookup purpose. If not present, the server IP address will be used for the location lookup.
package (optional) If not present, WS1 will be chosen as default web service package in the 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. Demo query limit is 20 per day.

Example for querying an IPv4 address:

https://api.ip2location.com/?ip=142.113.220.31&key=demo

Example for querying an IPv6 address:

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

Need more credits? You can sign up for a free trial key that will entitle you to a one time 5,000 free credits to evaluate our services.

Sign Up For a Trial Key

Pricing

You can pick an appropriate package from the 24 packages below to start adding IP location lookup web service to your solution. Each package returns a different set of IP address information with different amount of credits deducted for each query.

Package Information Returned Credit Cost/Query
WS1 Country Code 1 credit $0.0005
WS2 Country, ISP 2 credits $0.0010
WS3 Country, Region, City 2 credits $0.0010
WS4 Country, Region, City, ISP 3 credits $0.0015
WS5 Country, Region, City, Latitude, Longitude 3 credits $0.0015
WS6 Country, Region, City, Latitude, Longitude, ISP 4 credits $0.0020
WS7 Country, Region, City, ISP, Domain 4 credits $0.0020
WS8 Country, Region, City, Latitude, Longitude, ISP, Domain 5 credits $0.0025
WS9 Country, Region, City, Latitude, Longitude, ZIP Code 4 credits $0.0020
WS10 Country, Region, City, Latitude, Longitude, ZIP Code, ISP, Domain 6 credits $0.0029
WS11 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone 5 credits $0.0025
WS12 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain 7 credits $0.0034
WS13 Country, Region, City, Latitude, Longitude, Time Zone, Net Speed 5 credits $0.0025
WS14 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain, Net Speed 8 credits $0.0039
WS15 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, Area Code 7 credits $0.0034
WS16 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain, Net Speed, Area Code 10 credits $0.0049
WS17 Country, Region, City, Latitude, Longitude, Time Zone, Net Speed, Weather 6 credits $0.0029
WS18 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain, Net Speed, Area Code, Weather 11 credits $0.0054
WS19 Country, Region, City, Latitude, Longitude, ISP, Domain, Mobile 8 credits $0.0039
WS20 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain, Net Speed, Area Code, Weather, Mobile 13 credits $0.0064
WS21 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, Area Code, Elevation 8 credits $0.0039
WS22 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain, Net Speed, Area Code, Weather, Mobile, Elevation 14 credits $0.0069
WS23 Country, Region, City, Latitude, Longitude, ISP, Domain, Mobile, UsageType 11 credits $0.0054
WS24 Country, Region, City, Latitude, Longitude, ZIP Code, Time Zone, ISP, Domain, Net Speed, Area Code, Weather, Mobile, Elevation, UsageType 18 credits $0.0088

Web Service Query Example

WS1 Query:

https://api.ip2location.com/?ip={IP_ADDRESS}&key={YOUR_API_KEY}

WS1 Response:
US


WS24 Query:

https://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 IP Geolocation web service supports text, json and xml response format. Below please find the details:

Format Example query string and response value
text Query String:
https://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:
https://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:
https://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.