Skip to main content
GET
/
v3
/
ip_address
Check Customer's IP address
curl --request GET \
  --url 'https://api.moonpay.com/v3/ip_address?apiKey='
import requests

url = "https://api.moonpay.com/v3/ip_address?apiKey="

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.moonpay.com/v3/ip_address?apiKey=', 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://api.moonpay.com/v3/ip_address?apiKey=",
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://api.moonpay.com/v3/ip_address?apiKey="

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://api.moonpay.com/v3/ip_address?apiKey=")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.moonpay.com/v3/ip_address?apiKey=")

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
{
  "alpha2": "GB",
  "alpha3": "GBR",
  "country": "United Kingdom",
  "state": "",
  "ipAddress": "81.152.178.191",
  "isAllowed": true,
  "isBuyAllowed": true,
  "isSellAllowed": true,
  "isNftAllowed": true
}
{
"message": "<string>",
"type": "<string>"
}

Authorizations

apiKey
string
query
required

Query Parameters

query
object
required

Response

Successful response — IP Address details

alpha2
string

The country's ISO 3166-1 alpha-2 code.

Example:

"GB"

alpha3
string

The country's ISO 3166-1 alpha-3 code.

Example:

"GBR"

country
string

The IP address country.

Example:

"United Kingdom"

state
string

The IP address state or region or empty if not applicable.

Example:

""

ipAddress
string

The IPv4 or IPv6 address of the caller

Example:

"81.152.178.191"

isAllowed
boolean

Whether residents of this country can use the service.

Example:

true

isBuyAllowed
boolean

Whether residents of this country can buy cryptocurrencies.

Example:

true

isSellAllowed
boolean

Whether residents of this country can sell cryptocurrencies.

Example:

true

isNftAllowed
boolean

Whether residents of this country can buy NFTs.

Example:

true