Fetch and parse your public IPv4 and IPv6 address from our XML endpoint using your favorite tools!
← Back to API Docs<myipmeow> <ipv4>203.0.113.100</ipv4> <ipv6>2001:0db8:85a3:0000:0000:8a2e:0370:7334</ipv6> </myipmeow>
curl
and xmllint
curl -sL https://myipmeow.com/xml | xmllint --xpath 'string(//ipv4)' -
curl -sL https://myipmeow.com/xml | xmllint --xpath 'string(//ipv6)' -
Install xmllint: sudo apt-get install libxml2-utils
(Debian) or sudo yum install libxml2
(RedHat)
curl
and grep
curl -sL https://myipmeow.com/xml | grep -oP '(?<=\).*?(?=\ )'
curl -sL https://myipmeow.com/xml | grep -oP '(?<=\).*?(?=\ )'
addresses=$(curl -sL https://myipmeow.com/xml)
ipv4=$(echo $addresses | xmllint --xpath 'string(//ipv4)' -)
ipv6=$(echo $addresses | xmllint --xpath 'string(//ipv6)' -)
echo "IPv4: $ipv4, IPv6: $ipv6"
<?php
$xml = simplexml_load_file('https://myipmeow.com/xml');
echo $xml->ipv4;
echo $xml->ipv6;
?>
import requests
r = requests.get('https://myipmeow.com/xml')
print(r.text)