Want to skip the docs? Use the MCP Server
Endpoint availability: Free and aboveLearn more
{
"data": {
"ip": "165.227.149.217",
"ipType": "IPv4",
"IPNumber": 2783155673,
"bogon": false,
"continentName": "Europe",
"continentCode": "EU",
"countryCode": "DE",
"continentGeoNameID": 6255148,
"countryName": "Germany",
"countryGeoNameID": 2921044,
"regionName": "Hessen",
"cityName": "Frankfurt am Main",
"zipCode": "65931",
"latitude": "50.115520",
"longitude": "8.684170",
"location": {
"capital": "Berlin",
"population": 83783942,
"language": { "name": "German", "code": "de", "native": "Deutsch" },
"flag": {
"emoji": "🇩🇪",
"unicode": "U+1F1E9 U+1F1EA",
"png": {
"1000px": "https://www.gredev.io/img/flags/png1000px/de.png",
"250px": "https://www.gredev.io/img/flags/png250px/de.png",
"100px": "https://www.gredev.io/img/flags/png100px/de.png"
},
"svg": "https://www.gredev.io/img/flags/svg/de.svg"
},
"phoneCode": "49",
"countryIsEU": true,
"countryNeighbours": "CH,PL,NL,DK,BE,CZ,LU,FR,AT",
"tld": ".de"
},
"currency": {
"currencyName": "Euro",
"currencyCode": "EUR",
"currencySymbol": "€"
},
"asn": {
"asn": "AS14061",
"name": "DIGITALOCEAN-ASN",
"org": "DigitalOcean, LLC",
"phone": "+1-347-875-6044",
"email": "noc@digitalocean.com",
"domain": "digitalocean.com",
"created": "2012-05-14",
"type": "hosting"
},
"timezone": {
"name": "Europe/Berlin",
"abbreviation": "CET",
"offset": 3600,
"currentTime": "03:33:13",
"currentTimestamp": 1709519593,
"isDST": false,
"sunInfo": {
"sunset": "18:14:11",
"sunrise": "06:59:29",
"transit": "12:36:50",
"civilTwilightBegin": "06:28:47",
"civilTwilightEnd": "18:44:53",
"nauticalTwilightBegin": "05:51:20",
"nauticalTwilightEnd": "19:22:21",
"astronomicalTwilightBegin": "05:13:27",
"astronomicalTwilightEnd": "20:00:13",
"dayLength": "11:14:42"
}
},
"security": {
"isProxy": true,
"proxyType": "VPN",
"isTor": false,
"isBot": false,
"isRelay": false,
"isHosting": true,
"blacklisted": false
},
"device": {
"isMobile": false,
"type": "desktop",
"OS": {
"type": "desktop",
"name": "MacOS",
"family": "macintosh",
"version": "Big Sur",
"title": "MacOS Big Sur",
"64bits_mode": 1
},
"browser": {
"name": "Safari",
"version": 17.2,
"versionMajor": 1,
"title": "Safari 17.2"
}
},
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"status": "success",
"executionTime": 4
}
{
"status": "error",
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
IP Geolocation
curl --request GET \
--url https://greipapi.com/geoip \
--header 'Authorization: Bearer <token>'import requests
url = "https://greipapi.com/geoip"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://greipapi.com/geoip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://greipapi.com/geoip",
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"
)
func main() {
url := "https://greipapi.com/geoip"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://greipapi.com/geoip")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://greipapi.com/geoip")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"ip": "165.227.149.217",
"ipType": "IPv4",
"IPNumber": 2783155673,
"bogon": false,
"continentName": "Europe",
"continentCode": "EU",
"countryCode": "DE",
"continentGeoNameID": 6255148,
"countryName": "Germany",
"countryGeoNameID": 2921044,
"regionName": "Hessen",
"cityName": "Frankfurt am Main",
"zipCode": "65931",
"latitude": "50.115520",
"longitude": "8.684170",
"location": {
"capital": "Berlin",
"population": 83783942,
"language": { "name": "German", "code": "de", "native": "Deutsch" },
"flag": {
"emoji": "🇩🇪",
"unicode": "U+1F1E9 U+1F1EA",
"png": {
"1000px": "https://www.gredev.io/img/flags/png1000px/de.png",
"250px": "https://www.gredev.io/img/flags/png250px/de.png",
"100px": "https://www.gredev.io/img/flags/png100px/de.png"
},
"svg": "https://www.gredev.io/img/flags/svg/de.svg"
},
"phoneCode": "49",
"countryIsEU": true,
"countryNeighbours": "CH,PL,NL,DK,BE,CZ,LU,FR,AT",
"tld": ".de"
},
"currency": {
"currencyName": "Euro",
"currencyCode": "EUR",
"currencySymbol": "€"
},
"asn": {
"asn": "AS14061",
"name": "DIGITALOCEAN-ASN",
"org": "DigitalOcean, LLC",
"phone": "+1-347-875-6044",
"email": "noc@digitalocean.com",
"domain": "digitalocean.com",
"created": "2012-05-14",
"type": "hosting"
},
"timezone": {
"name": "Europe/Berlin",
"abbreviation": "CET",
"offset": 3600,
"currentTime": "03:33:13",
"currentTimestamp": 1709519593,
"isDST": false,
"sunInfo": {
"sunset": "18:14:11",
"sunrise": "06:59:29",
"transit": "12:36:50",
"civilTwilightBegin": "06:28:47",
"civilTwilightEnd": "18:44:53",
"nauticalTwilightBegin": "05:51:20",
"nauticalTwilightEnd": "19:22:21",
"astronomicalTwilightBegin": "05:13:27",
"astronomicalTwilightEnd": "20:00:13",
"dayLength": "11:14:42"
}
},
"security": {
"isProxy": true,
"proxyType": "VPN",
"isTor": false,
"isBot": false,
"isRelay": false,
"isHosting": true,
"blacklisted": false
},
"device": {
"isMobile": false,
"type": "desktop",
"OS": {
"type": "desktop",
"name": "MacOS",
"family": "macintosh",
"version": "Big Sur",
"title": "MacOS Big Sur",
"64bits_mode": 1
},
"browser": {
"name": "Safari",
"version": 17.2,
"versionMajor": 1,
"title": "Safari 17.2"
}
},
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"status": "success",
"executionTime": 4
}
{
"status": "error",
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
Data Lookup
IP Geolocation
This API allows you to retrieve detailed geolocation information for a visitor’s or user’s IP address.
By using the IP Geolocation method, you can access data such as the user’s country, city, ISP, and more, enabling you to personalize user experiences, enhance security, and make data-driven decisions based on geographic insights.
Want to skip the docs? Use the MCP Server
Endpoint availability: Free and aboveLearn more
{
"data": {
"ip": "165.227.149.217",
"ipType": "IPv4",
"IPNumber": 2783155673,
"bogon": false,
"continentName": "Europe",
"continentCode": "EU",
"countryCode": "DE",
"continentGeoNameID": 6255148,
"countryName": "Germany",
"countryGeoNameID": 2921044,
"regionName": "Hessen",
"cityName": "Frankfurt am Main",
"zipCode": "65931",
"latitude": "50.115520",
"longitude": "8.684170",
"location": {
"capital": "Berlin",
"population": 83783942,
"language": { "name": "German", "code": "de", "native": "Deutsch" },
"flag": {
"emoji": "🇩🇪",
"unicode": "U+1F1E9 U+1F1EA",
"png": {
"1000px": "https://www.gredev.io/img/flags/png1000px/de.png",
"250px": "https://www.gredev.io/img/flags/png250px/de.png",
"100px": "https://www.gredev.io/img/flags/png100px/de.png"
},
"svg": "https://www.gredev.io/img/flags/svg/de.svg"
},
"phoneCode": "49",
"countryIsEU": true,
"countryNeighbours": "CH,PL,NL,DK,BE,CZ,LU,FR,AT",
"tld": ".de"
},
"currency": {
"currencyName": "Euro",
"currencyCode": "EUR",
"currencySymbol": "€"
},
"asn": {
"asn": "AS14061",
"name": "DIGITALOCEAN-ASN",
"org": "DigitalOcean, LLC",
"phone": "+1-347-875-6044",
"email": "noc@digitalocean.com",
"domain": "digitalocean.com",
"created": "2012-05-14",
"type": "hosting"
},
"timezone": {
"name": "Europe/Berlin",
"abbreviation": "CET",
"offset": 3600,
"currentTime": "03:33:13",
"currentTimestamp": 1709519593,
"isDST": false,
"sunInfo": {
"sunset": "18:14:11",
"sunrise": "06:59:29",
"transit": "12:36:50",
"civilTwilightBegin": "06:28:47",
"civilTwilightEnd": "18:44:53",
"nauticalTwilightBegin": "05:51:20",
"nauticalTwilightEnd": "19:22:21",
"astronomicalTwilightBegin": "05:13:27",
"astronomicalTwilightEnd": "20:00:13",
"dayLength": "11:14:42"
}
},
"security": {
"isProxy": true,
"proxyType": "VPN",
"isTor": false,
"isBot": false,
"isRelay": false,
"isHosting": true,
"blacklisted": false
},
"device": {
"isMobile": false,
"type": "desktop",
"OS": {
"type": "desktop",
"name": "MacOS",
"family": "macintosh",
"version": "Big Sur",
"title": "MacOS Big Sur",
"64bits_mode": 1
},
"browser": {
"name": "Safari",
"version": 17.2,
"versionMajor": 1,
"title": "Safari 17.2"
}
},
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"status": "success",
"executionTime": 4
}
{
"status": "error",
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
GET
/
geoip
IP Geolocation
curl --request GET \
--url https://greipapi.com/geoip \
--header 'Authorization: Bearer <token>'import requests
url = "https://greipapi.com/geoip"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://greipapi.com/geoip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://greipapi.com/geoip",
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"
)
func main() {
url := "https://greipapi.com/geoip"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://greipapi.com/geoip")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://greipapi.com/geoip")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"ip": "165.227.149.217",
"ipType": "IPv4",
"IPNumber": 2783155673,
"bogon": false,
"continentName": "Europe",
"continentCode": "EU",
"countryCode": "DE",
"continentGeoNameID": 6255148,
"countryName": "Germany",
"countryGeoNameID": 2921044,
"regionName": "Hessen",
"cityName": "Frankfurt am Main",
"zipCode": "65931",
"latitude": "50.115520",
"longitude": "8.684170",
"location": {
"capital": "Berlin",
"population": 83783942,
"language": { "name": "German", "code": "de", "native": "Deutsch" },
"flag": {
"emoji": "🇩🇪",
"unicode": "U+1F1E9 U+1F1EA",
"png": {
"1000px": "https://www.gredev.io/img/flags/png1000px/de.png",
"250px": "https://www.gredev.io/img/flags/png250px/de.png",
"100px": "https://www.gredev.io/img/flags/png100px/de.png"
},
"svg": "https://www.gredev.io/img/flags/svg/de.svg"
},
"phoneCode": "49",
"countryIsEU": true,
"countryNeighbours": "CH,PL,NL,DK,BE,CZ,LU,FR,AT",
"tld": ".de"
},
"currency": {
"currencyName": "Euro",
"currencyCode": "EUR",
"currencySymbol": "€"
},
"asn": {
"asn": "AS14061",
"name": "DIGITALOCEAN-ASN",
"org": "DigitalOcean, LLC",
"phone": "+1-347-875-6044",
"email": "noc@digitalocean.com",
"domain": "digitalocean.com",
"created": "2012-05-14",
"type": "hosting"
},
"timezone": {
"name": "Europe/Berlin",
"abbreviation": "CET",
"offset": 3600,
"currentTime": "03:33:13",
"currentTimestamp": 1709519593,
"isDST": false,
"sunInfo": {
"sunset": "18:14:11",
"sunrise": "06:59:29",
"transit": "12:36:50",
"civilTwilightBegin": "06:28:47",
"civilTwilightEnd": "18:44:53",
"nauticalTwilightBegin": "05:51:20",
"nauticalTwilightEnd": "19:22:21",
"astronomicalTwilightBegin": "05:13:27",
"astronomicalTwilightEnd": "20:00:13",
"dayLength": "11:14:42"
}
},
"security": {
"isProxy": true,
"proxyType": "VPN",
"isTor": false,
"isBot": false,
"isRelay": false,
"isHosting": true,
"blacklisted": false
},
"device": {
"isMobile": false,
"type": "desktop",
"OS": {
"type": "desktop",
"name": "MacOS",
"family": "macintosh",
"version": "Big Sur",
"title": "MacOS Big Sur",
"64bits_mode": 1
},
"browser": {
"name": "Safari",
"version": 17.2,
"versionMajor": 1,
"title": "Safari 17.2"
}
},
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"status": "success",
"executionTime": 4
}
{
"status": "error",
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
Query Parameters
string
The params command can be used to specify the required modules you want to get
in the response.Expected values:
security, currency, timezone, location, and/or deviceSample value: security,timezone,currencyFor more information please refer to Customize response modules.string
default:"JSON"
The format command is used to get a response in a specific format.Expected values:
JSON, XML, CSV, or NewlineFor more information please refer to Response Format.string
default:"EN"
The lang command is used to get a response in a specific language.Expected values:
EN, AR, DE, FR, ES, JA, ZH, or RUFor more information please refer to Localization.string
default:"live"
The mode command is used to in the development stage to simulate the integration process before releasing it to the production environment.Expected values:
live, or test.For more information please refer to Development Environment.string
The userID command can be used to identify requests sent by specific users to monitor in the Events Page.Expected values: email address, phone number, user id, name, etc.For more information please refer to User Identifier.
string
The callback command can help you make the response as a JSONP format.Expected values: any name that can be used as a function name in Javascript, e.g:
myFunctionName.For more information please refer to JSONP Callback.Response properties
object
required
Hide properties
Hide properties
string
required
IP address you’re looking up.
string
required
Type of IP address (
IPv4, or IPv6).integer
required
Numeric representation of the IP address.
boolean
required
Indicates if the IP address is a bogon.
string
required
Name of the continent where the IP address is.
string
required
Code representation of the continent.
string
required
Code representation of the country in
ISO-3166 format.integer
required
GeoName ID of the continent.
string
required
Name of the country.
integer
required
GeoName ID of the country.
string
required
Name of the region.
string
required
Name of the city.
string
required
ZIP code of the location where the IP address belong.
string
required
Latitude coordinate of the location.
string
required
Longitude coordinate of the location.
object
required
Show details
Show details
string
required
Capital city of the country.
integer
required
Population of the country.
object
required
object
required
string
required
International dialing code for the country.
boolean
required
Indicates if the country is in the EU.
string
required
List of neighboring countries’ codes.
string
required
Top-level domain of the country.
object
required
object
required
Show details
Show details
string
required
Autonomous System Number.
string
required
Name of the ASN.
string
required
Organization associated with the ASN.
string
required
Phone contact for the ASN.
string
required
Email contact for the ASN.
string
required
Domain associated with the ASN.
string
required
Date of ASN creation.
string
required
Type of organization (“isp”, “hosting”, “business”, “education”, or
“government”).
object
required
Show details
Show details
string
required
Timezone name.
string
required
Timezone abbreviation.
integer
required
Timezone offset from UTC.
string
required
Current time in the timezone.
integer
required
Current timestamp in the timezone.
boolean
required
Indicates if Daylight Saving Time is active.
object
required
Show details
Show details
string
required
Sunset time.
string
required
Sunrise time.
string
required
Solar transit time.
string
required
Civil twilight begin time.
string
required
Civil twilight end time.
string
required
Nautical twilight begin time.
string
required
Nautical twilight end time.
string
required
Astronomical twilight begin time.
string
required
Astronomical twilight end time.
string
required
Length of the day.
object
required
Show details
Show details
boolean
required
Indicates if the IP address is a proxy service.
string
required
Type of proxy used.
boolean
required
Indicates if accessed through Tor network.
boolean
required
Indicates if the user is a bot.
boolean
required
Indicates if it’s a Apple’s Private Relay connection.
boolean
required
Indicates if the IP address belong to a hosting provider.
boolean
required
Indicates if the IP address is blacklisted due to applying custom
rules or were found in one of
your blacklists.
object
required
Show details
Show details
boolean
required
Indicates if the device is a mobile device.
string
required
Type of device.
object
required
object
The custom rules applied to this request, learn
more.
Hide properties
Hide properties
integer
required
The total number of custom rules applied to this request.
object
required
The custom rules applied to this request, learn
more.
string
required
Response status (success/error).
integer
required
Time taken to process the data (in milliseconds).
Was this page helpful?
⌘I