IP geolocation API
The IP geolocation API provides insights about the country and city associated with an IP address, along with optional distance comparison to a user-provided address.
This can be used to flag unexpected or foreign leads without affecting lead acceptance decisions.
This can be used to flag unexpected or foreign leads without affecting lead acceptance decisions.
Endpoint
POST
https://api.provero.io/api/fraud-check/geoip
Headers
Authorization:
Content-Type: application/json
Accept: application/json
Request Body
Request Payload Example (JSON)
{
"ip": "8.8.8.8",
"address": "London",
"geoMatch": true
}
Request Examples
Choose language Bash (cURL) 5 examples
ip="0.0.0.0" # Replace with clients IP
address="REPLACE_WITH_AN_ADDRESS" # Optional address for distance calculation
geoMatch=true # Enable geoMatch to compare IP location with address
curl -X POST https://api.provero.io/api/fraud-check/geoip \
-H "Authorization: Bearer REPLACE_WITH_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{ \"ip\": \"$ip\", \"address\": \"$address\", \"geoMatch\": $geoMatch }"
import requests
ip = "0.0.0.0" # Replace with clients IP
address = "REPLACE_WITH_AN_ADDRESS" # Optional address for distance calculation
geoMatch = true # Enable geoMatch to compare IP location with address
url = "https://api.provero.io/api/fraud-check/geoip"
headers = {
"Authorization": "Bearer REPLACE_WITH_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {"ip": ip, "address": address, "geoMatch": geoMatch}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.text)
<?php
$ip = "0.0.0.0"; // Replace with clients IP
$address = "REPLACE_WITH_AN_ADDRESS"; // Optional address for distance calculation
$geoMatch = true; // Enable geoMatch to compare IP location with address
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.provero.io/api/fraud-check/geoip",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode([
"ip" => $ip,
"address" => $address,
"geoMatch" => $geoMatch
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer REPLACE_WITH_API_TOKEN",
"Content-Type: application/json",
"Accept: application/json"
]
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
}
curl_close($curl);
echo $response;
$ip = "0.0.0.0"; // Replace with clients IP
$address = "REPLACE_WITH_AN_ADDRESS"; // Optional address for distance calculation
$geoMatch = true; // Enable geoMatch to compare IP location with address
$response = Http::withToken('REPLACE_WITH_API_TOKEN')
->acceptJson()
->post('https://api.provero.io/api/fraud-check/geoip', [
'ip' => $ip,
'address' => $address,
'geoMatch' => $geoMatch,
]);
return $response->json();
const ip = "0.0.0.0"; // Replace with clients IP
const address = "REPLACE_WITH_AN_ADDRESS"; // Optional address for distance calculation
const geoMatch = true; // Enable geoMatch to compare IP location with address
fetch("https://api.provero.io/api/fraud-check/geoip", {
method: "POST",
headers: {
"Authorization": "Bearer REPLACE_WITH_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({ ip, address, geoMatch })
})
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.error("Error:", error));
Response Examples
Choose response example Success 6 examples
{
"country": "Ireland",
"regionName": "Leinster",
"city": "Dublin",
"zip": "D02",
"lat": "53.3498",
"lon": "-6.26031",
"ip": "46.51.128.144",
"distance": {
"km": 0.0514,
"mi": 0.0319
},
"geoMatch": {
"country": true,
"city": true
}
}
{
"requestError": {
"serviceException": {
"messageId": "Error message",
"code": "400"
}
}
}
{
"message": "Insufficient balance for validation request.",
"service": "geoip",
"required_amount": "0.0060000000",
"current_balance": "0.0000000000"
}
{
"message": "The ip field is required.",
"errors": {
"ip": [
"The ip field is required."
]
}
}
{
"message": "The ip field must be a valid IP address.",
"errors": {
"ip": [
"The ip field must be a valid IP address."
]
}
}
{
"message": "Please provide a valid destination to match.",
"errors": {
"address": [
"Please provide a valid destination to match."
]
}
}