{
"success": true,
"data": {
"ip": {
"address": "165.227.149.217",
"version": 4,
"numeric": 2783155673,
"bogon": false
}
},
"documentation": "https://docs.greip.io",
"execution_ms": 0
}
Free get IP
curl --request GET \
--url https://v2.greipapi.com/ip \
--header 'Authorization: Bearer <token>'import requests
url = "https://v2.greipapi.com/ip"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v2.greipapi.com/ip', 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://v2.greipapi.com/ip",
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://v2.greipapi.com/ip"
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://v2.greipapi.com/ip")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.greipapi.com/ip")
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
{
"success": true,
"data": {
"ip": {
"address": "165.227.149.217",
"version": 4,
"numeric": 2783155673,
"bogon": false
}
},
"documentation": "https://docs.greip.io",
"execution_ms": 0
}
Data Lookup
Free Get-IP
This method allows you to retrieve the IP address of your visitors or users without the need for an account or API key in Greip.
Itβs a quick and easy way to access IP information, making it ideal for basic integrations or when you need to capture user IPs with minimal setup.
{
"success": true,
"data": {
"ip": {
"address": "165.227.149.217",
"version": 4,
"numeric": 2783155673,
"bogon": false
}
},
"documentation": "https://docs.greip.io",
"execution_ms": 0
}
GET
/
ip
Free get IP
curl --request GET \
--url https://v2.greipapi.com/ip \
--header 'Authorization: Bearer <token>'import requests
url = "https://v2.greipapi.com/ip"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v2.greipapi.com/ip', 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://v2.greipapi.com/ip",
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://v2.greipapi.com/ip"
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://v2.greipapi.com/ip")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.greipapi.com/ip")
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
{
"success": true,
"data": {
"ip": {
"address": "165.227.149.217",
"version": 4,
"numeric": 2783155673,
"bogon": false
}
},
"documentation": "https://docs.greip.io",
"execution_ms": 0
}
This endpoint does not use Bearer authentication or an API key. Do not send an
Authorization header.
Usage example
https://v2.greipapi.com/ip
curl --request GET \
--url https://v2.greipapi.com/ip
import requests
url = "https://v2.greipapi.com/ip"
response = requests.request("GET", url)
print(response.text)
const options = { method: "GET" };
fetch("https://v2.greipapi.com/ip", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
200
OK
Was this page helpful?