Overview
In both IP Geolocation and IP Lookup endpoints you can pass thesecurity module in the params query parameter to get full insights about security threats for that IP address.
Sample Request
curl --request GET \
--url 'https://v2.greipapi.com/geo/ip?params=security' \
--header 'Authorization: Bearer <token>'
import requests
url = "https://v2.greipapi.com/geo/ip"
querystring = {"params":"security"}
headers = {"Authorization": "Bearer <token>"}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
const options = { method: "GET", headers: { Authorization: "Bearer <token>" } };
fetch("https://v2.greipapi.com/geo/ip?params=security", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.greipapi.com/geo/ip?params=security",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>"],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://v2.greipapi.com/geo/ip?params=security"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.get("https://v2.greipapi.com/geo/ip?params=security")
.header("Authorization", "Bearer <token>")
.asString();
Sample Response
{
"success": true,
"data": {
"ip": {
"address": "165.227.149.217",
"version": 4,
"numeric": 2783155673,
"bogon": false
},
"geo": {
"continent": "Europe",
"continent_code": "EU",
"country": "Germany",
"country_code": "DE",
"region": "Hessen",
"city": "Frankfurt am Main",
"postal": "65931",
"latitude": 50.11552,
"longitude": 8.68417
},
"security": {
"vpn_or_proxy": true,
"vpn_or_proxy_type": "VPN",
"tor": false,
"bot": false,
"relay": false,
"hosting": true,
"is_blacklisted": false
}
},
"execution_ms": 4
}