This service offers a REST API allowing to get a visitor IPv4&IPv6 address and to query location information from any IPv6-Only address, It outputs JSON-encoded IP geolocation data.
1.1 Returns the visitor IPv4&IPv6 address in plain text, useful for shell scripts or to find the external Internet routable address.
http(s)://ip.ddnspod.com IPv4/IPv6 for Global
http(s)://ipv4.ddnspod.com IPv4-Only for Global
http(s)://ipv6.ddnspod.com IPv6-Only for Global
curl ip.ddnspod.com
curl ip.ddnspod.com -4
curl ip.ddnspod.com -6
#!/bin/bash
ipv4=$(curl -s ip.ddnspod.com -4)
ipv6=$(curl -s ip.ddnspod.com -6)
echo "My public IPv4 address is: $ipv4"
echo "My public IPv6 address is: $ipv6"
My public IPv4 address is: 18.222.112.142
2.1 Calling the API endpoint without any parameter will return IPv6 prefix for the visitor:
http(s)://ip.ddnspod.com/prefix/
2.2 Get IPv6 prefix for the visitor and Appending an IPv6 suffix as parameter return this IPv6 address:
GET /prefix/1:2:3:4
GET /prefix/:5
or
POST /prefix?suffix=1:2:3:4
POST /prefix?suffix=:5
3.1 Calling the API endpoint without any parameter will return location information for the visitor IPv6 address:
http(s)://ip.ddnspod.com/geoip/
or
http(s)://ip.ddnspod.com/geoip2/
3.2 Appending an IP address as parameter will return location information for this IPv6 address:
GET /geoip/2400:3200::1
or
POST /geoip?ipv6=2400:3200::1
3.3 The output is a JSON object containing the following elements:
{
"ipv6":"2400:3200::1",
"full":"2400:3200:0000:0000:0000:0000:0000:0001",
"range":{
"start":"2400:3200::",
"end": "2400:3200:15ff:ffff::"
},
"cidr":"2400:3200::/35",
"addr":{
"location":"中国 浙江省 杭州市",
"isp": "阿里云计算有限公司"
},
"disp":"中国 浙江省 杭州市 阿里云",
"timestamp":"1746080659170"
}
Parameter | Description |
---|---|
ipv6 | Visitor IPv6 address, or IPv6 address specified as parameter. |
full | IPv6 full 128-bit notation. |
range->start | The start IPv6 prefix for an IPv6 address range. |
range->end | The end IPv6 prefix for an IPv6 address range. |
cidr | The CIDR notation for an IPv6 addresses range. |
addr->location | Name of the country,province,city,region. |
addr->isp | ISP name. |
disp | Location + ISP name. |
timestamp | The current timestamp. |
4.1 Use CIDR notation to provide information about a given IPv6 address range.
GET /cidr/2400:3200::/2400:3200:ffff::
or
POST /cidr?start=2400:3200::&end=2400:3200:ffff::
{
"start":"2400:3200::",
"end": "2400:3200:ffff::",
"cidr": "2400:3200::/32"
}
5.1 The default is the millisecond timestamp:
http(s)://ip.ddnspod.com/timestamp/
GET /timestamp/s
GET /timestamp/ms
GET /timestamp/us
GET /timestamp/ns
or
POST /timestamp?precision=s
POST /timestamp?precision=ms
POST /timestamp?precision=us
POST /timestamp?precision=ns
When incorrect user input is entered, the server returns an Error, along with a JSON-encoded error message.
©2019- DDNSPod. All Rights Reserved.1