Skip to content
On this page

Quick Start

iplook provides a simple HTTP-based API that allows you to check the location, ownership, and threat profile of any IP address.

The simplest call you can make would be a parameter-less GET call to the API endpoint at https://api.iplook.io/json. This will return the location of the device making the API request.

curl
curl "https://api.iplook.io/json?token=${APIKEY}"

To check a specific IP Address, pass the IP address as a path parameter.

curl
curl "https://api.iplook.io/json?ip=8.8.8.8&token=${APIKEY}"

More Examples

Javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.iplook.io/json?token=${APIKEY}");
xhr.send();
Python
import http.client

conn = http.client.HTTPSConnection("api.iplook.io")
payload = ''
conn.request("GET", "/json?token=${APIKEY}", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Js
var request = require('request');
var options = {
   'method': 'GET',
   'url': 'https://api.iplook.io/json?token=${APIKEY}',
};
request(options, function (error, response) {
   if (error) throw new Error(error);
   console.log(response.body);
});
Go
package main

import (
   "fmt"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://api.iplook.io/json?token=${APIKEY}"
   method := "GET"

   client := &http.Client {
   }
   req, err := http.NewRequest(method, url, nil)

   if err != nil {
      fmt.Println(err)
      return
   }

   res, err := client.Do(req)
   if err != nil {
      fmt.Println(err)
      return
   }
   defer res.Body.Close()

   body, err := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}
PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://api.iplook.io/json?token=${APIKEY}',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Java
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://api.iplook.io/json?token=${APIKEY}")
   .asString();
Swift
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

var request = URLRequest(url: URL(string: "https://api.iplook.io/json?token=${APIKEY}")!,timeoutInterval: Double.infinity)

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
   guard let data = data else {
      print(String(describing: error))
      semaphore.signal()
      return
   }
   print(String(data: data, encoding: .utf8)!)
   semaphore.signal()
}

task.resume()
semaphore.wait()