IP2Location IP Geolocation Web Service

FREE
By ip2location
Updated 3 days ago
Tools
-/10
Popularity Score
-
Latency
-
Success Rate

IP2Location IP Geolocation Web Service API Documentation

IP2Location web service provides reverse lookup of an IP address to an ISO3166 country code, region or state, city, latitude and longitude, ZIP/Postal code, time zone, ISP, net speed, area code, weather station code, weather station name, mobile carrier data, elevation, and usage type. Visit https://www.ip2location.com/web-service for more info.

View API Details
GETIP2Location iP Geolocation WS24
GETIP2Location iP Geolocation WS24

Get geographical information from IP address.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
ipSTRING
REQUIREDIP address to query.
keySTRING
REQUIREDAPI key.
packageSTRING
REQUIRED - CONSTANTWeb service package.
Optional Parameters
langSTRING
OPTIONALTranslation information. The translation only applicable for continent, country, region and city name for the addon package.
addonSTRING
OPTIONALAdditional information of continent, country, region, city, geotargeting, country_groupings, time_zone_info
Code Snippet
unirest.get("https://ip2location-ip2location-v1.p.rapidapi.com/?package=WS24")
.header("X-RapidAPI-Host", "ip2location-ip2location-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://ip2location-ip2location-v1.p.rapidapi.com/
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://ip2location-ip2location-v1.p.rapidapi.com/?package=WS24")
.header("X-RapidAPI-Host", "ip2location-ip2location-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication