RapidAPI logo

IP 2 Location

FREEMIUM
By futureneo
Updated a month ago
Data
-/10
Popularity Score
-
Latency
-
Success Rate

IP 2 Location API Documentation

IP2Location offers a powerful, real-time IP to geolocation API capable of looking up accurate location data and assessing security threats originating from risky IP addresses. Results are delivered within milliseconds in JSON. Using the IP2Location API you will be able to locate website visitors at first glance and adjust your user experience and application accordingly

View API Details
GETIP2Location
GETIP2Location

Get location from IP Address

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
ipaddressSTRING
REQUIREDInput your Ip Address
Code Snippet
unirest.get("https://ip-2-location.p.rapidapi.com/v1/global/ip2location?ipaddress=216.58.200.78")
.header("X-RapidAPI-Host", "ip-2-location.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://ip-2-location.p.rapidapi.com/v1/global/ip2location
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://ip-2-location.p.rapidapi.com/v1/global/ip2location?ipaddress=216.58.200.78")
.header("X-RapidAPI-Host", "ip-2-location.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