• Your shopping cart is empty!
WS

IP2Location™ IP Geolocation Web Service

WS
$49
100,000 credits (for 1 year)
WS10X
$441
1,000,000 credits (for 1 year)
WS50X
$1960
5,000,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/v2/?ip={IP_ADDRESS}&key={YOUR_API_KEY}&package={WS1|WS2|WS3|...|WS24}&addon={continent,country,region,city,geotargeting,country_groupings,time_zone_info}

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 additional information (optional), such as olson time zone, translations and so on.
  • 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.
addon (optional)
Valid value: continent, country, region, city, geotargeting, country_groupings, time_zone_info

Please refer to the below pricing table for value returned.
lang (optional)
Valid value: ar | cs | da | de | en | es | et | fi | fr | ga | it | ja | ko | ms | nl | pt | ru | sv | tr | vi | zh-cn | zh-tw

You can only specify one language value for the returns.
format (optional)

If unspecified, json format will be used for the response message. Valid value: json | xml

Response

Field Description
country_code Two-character country code based on ISO 3166.
country_name Country name based on ISO 3166.
region_name Region or state name.
city_name City name.
latitude City latitude. Defaults to capital city latitude if city is unknown.
longitude City longitude. Defaults to capital city longitude if city is unknown.
zip_code ZIP/Postal code (168 countries supported).
time_zone UTC time zone (with DST supported).
isp Internet Service Provider or company's name.
domain Internet domain name associated with IP address range.
net_speed Internet connection type.
DIAL = dial up, DSL = broadband/cable/fiber/mobile, COMP = company/T1
idd_code The IDD prefix to call the city from another country.
area_code A varying length number assigned to geographic areas for calls between cities (220 countries supported).
weather_station_code The special code to identify the nearest weather observation station.
weather_station_name The name of the nearest weather observation station.
mcc Mobile Country Codes (MCC) as defined in ITU E.212 for use in identifying mobile stations in wireless telephone networks, particularly GSM and UMTS networks.
mnc Mobile Network Code (MNC) is used in combination with a Mobile Country Code (MCC) to uniquely identify a mobile phone operator or carrier.
mobile_brand Commercial brand associated with the mobile carrier. You may click here to view the coverage report.
elevation Average height of city above sea level in meters (m).
usage_type Usage type classification of ISP or company
(COM) Commercial
(ORG) Organization
(GOV) Government
(MIL) Military
(EDU) University/College/School
(LIB) Library
(CDN) Content Delivery Network
(ISP) Fixed Line ISP
(MOB) Mobile ISP
(DCH) Data Center/Web Hosting/Transit
(SES) Search Engine Spider
(RSV) Reserved

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/v2/?ip=142.113.220.31&key=demo

Example for querying an IPv6 address:

https://api.ip2location.com/v2/?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 14 credits $0.0069
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 15 credits $0.0074
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

Add On Information Returned Credit Cost/Query
continent Continent details with multilingual supports. 1 credit $0.0005
country Country information with multilingual supports. 2 credits $0.0010
region Region names with multilingual supports. Required WS3 and above. 2 credits $0.0010
city City names with multilingual supports. Required WS3 and above. 2 credits $0.0010
geotargeting Metro code for supported area. Required the package that has zip code data, such as WS9. 2 credits $0.0010
country_groupings Country Grouping Terminology. 2 credits $0.0010
time_zone_info Local time in real time. Required the package that has time zone data, such as DB11. 4 credits $0.0020
You can query for multiple add-on by joining the values with comma. For example: addon=country,region,city

Web Service Response Format

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

Query String:
https://api.ip2location.com/v2/?ip={IP_ADDRESS}&key={YOUR_API_KEY}&package=WS24&format=json&&addon=continent,country,region,city,geotargeting,country_groupings,time_zone_info&lang=en
Response:
{
	"country_code": "US",
	"country_name": "United States",
	"region_name": "California",
	"city_name": "Mountain View",
	"continent": {
		"code": "NA",
		"name": "North america",
		"hemisphere": [
			"north",
			"east"
		],
		"translations": {
			"en": "North America"
		}
	},
	"country": {
		"name": "United States",
		"alpha3_code": "USA",
		"numeric_code": "840",
		"demonym": "Americans",
		"flag": "https:\/\/www.ip2location.com\/assets\/img\/flags\/us.png",
		"capital": "Washington, D.C.",
		"total_area": "9826675",
		"population": "326766748",
		"currency": {
			"code": "USD",
			"name": "United States Dollar",
			"symbol": "$"
		},
		"language": {
			"code": "EN",
			"name": "English"
		},
		"idd_code": "1",
		"tld": "us",
		"translations": {
			"en": "United States"
		}
	},
	"region": {
		"name": "California",
		"code": "06",
		"translations": {
			"en": "California"
		}
	},
	"city": {
		"name": "Mountain View",
		"translations": []
	},
	"geotargeting": {
		"metro": "807"
	},
	"country_groupings": [
		{
			"acronym": "Americas",
			"name": "Americas"
		},
		{
			"acronym": "APEC",
			"name": "Asia-Pacific Economic Cooperation"
		},
		{
			"acronym": "DAC",
			"name": "Development Assistance Committee"
		},
		{
			"acronym": "G2",
			"name": "Group of Two"
		},
		{
			"acronym": "G20",
			"name": "Group of Twenty"
		},
		{
			"acronym": "G7",
			"name": "Group of Seven"
		},
		{
			"acronym": "G8+5",
			"name": "G8+5"
		},
		{
			"acronym": "NAFTA",
			"name": "North American Free Trade Agreement"
		},
		{
			"acronym": "NALA",
			"name": "NALA"
		},
		{
			"acronym": "OAS",
			"name": "Organization of American States"
		},
		{
			"acronym": "OECD",
			"name": "Organisation for Economic Co-operation and Development"
		},
		{
			"acronym": "P5",
			"name": "P5"
		},
		{
			"acronym": "UN",
			"name": "United Nations"
		}
	],
	"time_zone_info": {
		"olson": "America\/Los_Angeles",
		"current_time": "2019-03-03T23:06:07-08:00",
		"gmt_offset": -28800,
		"is_dst": "no"
	}
}
Query String:
https://api.ip2location.com/v2/?ip={IP_ADDRESS}&key={YOUR_API_KEY}&package=WS24&format=xml&&addon=continent,country,region,city,geotargeting,country_groupings,time_zone_info&lang=en
Response:
<?xml version="1.0" encoding="utf-8"?>
<result>
	<country_code>US</country_code>
	<country_name>United States</country_name>
	<region_name>California</region_name>
	<city_name>Mountain View</city_name>
	<continent>
		<code>NA</code>
		<name>North america</name>
		<hemisphere>
			<item0>north</item0>
			<item1>east</item1>
		</hemisphere>
		<translations>
			<en>North America</en>
		</translations>
	</continent>
	<country>
		<name>United States</name>
		<alpha3_code>USA</alpha3_code>
		<numeric_code>840</numeric_code>
		<demonym>Americans</demonym>
		<flag>https://www.ip2location.com/assets/img/flags/us.png</flag>
		<capital>Washington, D.C.</capital>
		<total_area>9826675</total_area>
		<population>326766748</population>
		<currency>
			<code>USD</code>
			<name>United States Dollar</name>
			<symbol>$</symbol>
		</currency>
		<language>
			<code>EN</code>
			<name>English</name>
		</language>
		<idd_code>1</idd_code>
		<tld>us</tld>
		<translations>
			<en>United States</en>
		</translations>
	</country>
	<region>
		<name>California</name>
		<code>06</code>
		<translations>
			<en>California</en>
		</translations>
	</region>
	<city>
		<name>Mountain View</name>
		<translations/>
	</city>
	<geotargeting>
		<metro>807</metro>
	</geotargeting>
	<country_groupings>
		<item0>
			<acronym>Americas</acronym>
			<name>Americas</name>
		</item0>
		<item1>
			<acronym>APEC</acronym>
			<name>Asia-Pacific Economic Cooperation</name>
		</item1>
		<item2>
			<acronym>DAC</acronym>
			<name>Development Assistance Committee</name>
		</item2>
		<item3>
			<acronym>G2</acronym>
			<name>Group of Two</name>
		</item3>
		<item4>
			<acronym>G20</acronym>
			<name>Group of Twenty</name>
		</item4>
		<item5>
			<acronym>G7</acronym>
			<name>Group of Seven</name>
		</item5>
		<item6>
			<acronym>G8+5</acronym>
			<name>G8+5</name>
		</item6>
		<item7>
			<acronym>NAFTA</acronym>
			<name>North American Free Trade Agreement</name>
		</item7>
		<item8>
			<acronym>NALA</acronym>
			<name>NALA</name>
		</item8>
		<item9>
			<acronym>OAS</acronym>
			<name>Organization of American States</name>
		</item9>
		<item10>
			<acronym>OECD</acronym>
			<name>Organisation for Economic Co-operation and Development</name>
		</item10>
		<item11>
			<acronym>P5</acronym>
			<name>P5</name>
		</item11>
		<item12>
			<acronym>UN</acronym>
			<name>United Nations</name>
		</item12>
	</country_groupings>
	<time_zone_info>
		<olson>America/Los_Angeles</olson>
		<current_time>2019-03-03T23:31:01-08:00</current_time>
		<gmt_offset>-28800</gmt_offset>
		<is_dst>no</is_dst>
	</time_zone_info>
</result>
Note: The web service supports both HTTP and HTTPS queries.