Get geolocation for an IP address
curl --request GET \
--url https://v2.prod.halliday.xyz/geolocationimport requests
url = "https://v2.prod.halliday.xyz/geolocation"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://v2.prod.halliday.xyz/geolocation', 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.prod.halliday.xyz/geolocation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prod.halliday.xyz/geolocation"
req, _ := http.NewRequest("GET", url, nil)
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.prod.halliday.xyz/geolocation")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.prod.halliday.xyz/geolocation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"alpha3_country_code": "USA",
"state_code": "PA",
"default_currency": "USD"
}{
"errors": [
{
"code": "invalid_union",
"path": [
"customer_ip_address"
],
"message": "Invalid input"
}
]
}Geolocation
Get geolocation for an IP address
Resolve an IP address to a country, region, and default fiat currency. Pass the end user’s
customer_ip_address when your backend makes the request on their behalf; when omitted, the
IP address of the request itself is used.
Onramp provider and payment method availability depend on the user’s location, so use this to
pick a default fiat currency before quoting and to confirm which location the
customer_ip_address you pass to POST /payments/quotes resolves to.
GET
/
geolocation
Get geolocation for an IP address
curl --request GET \
--url https://v2.prod.halliday.xyz/geolocationimport requests
url = "https://v2.prod.halliday.xyz/geolocation"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://v2.prod.halliday.xyz/geolocation', 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.prod.halliday.xyz/geolocation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prod.halliday.xyz/geolocation"
req, _ := http.NewRequest("GET", url, nil)
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.prod.halliday.xyz/geolocation")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.prod.halliday.xyz/geolocation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"alpha3_country_code": "USA",
"state_code": "PA",
"default_currency": "USD"
}{
"errors": [
{
"code": "invalid_union",
"path": [
"customer_ip_address"
],
"message": "Invalid input"
}
]
}Query Parameters
IPv4 or IPv6 address of the end user. Defaults to the IP address of the request.
Response
object | null
Geolocation resolved successfully
Resolved location, or null if the IP address could not be resolved

