Fetch and parse your public IPv4 and IPv6 address from our JSON endpoint using your favorite tools!
← Back to API Docs{ "ipv4": "203.0.113.100", "ipv6": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" }
curl
and jq
curl -sL https://myipmeow.com/json | jq -r '.ipv4'
curl -sL https://myipmeow.com/json | jq -r '.ipv6'
Install jq: sudo apt-get install jq
(Debian) or sudo yum install jq
(RedHat)
curl
and grep
curl -sL https://myipmeow.com/json | grep -oP '(?<="ipv4": ")[^"]+'
curl -sL https://myipmeow.com/json | grep -oP '(?<="ipv6": ")[^"]+'
addresses=$(curl -sL https://myipmeow.com/json)
ipv4=$(echo $addresses | jq -r '.ipv4')
ipv6=$(echo $addresses | jq -r '.ipv6')
echo "IPv4: $ipv4, IPv6: $ipv6"
<?php
$json = file_get_contents('https://myipmeow.com/json');
$data = json_decode($json, true);
echo $data['ipv4'];
echo $data['ipv6'];
?>
import requests
r = requests.get('https://myipmeow.com/json')
data = r.json()
print(data['ipv4'])
print(data['ipv6'])