API Reference
Curl to obtain the local IP address
curl checkip.com
The output has two lines: the first is the IP address; the second shows the country, ASN, and organization.
The output has two lines: the first is the IP address; the second shows the country, ASN, and organization.
Curl to obtain the local IP address (JSON)
curl checkip.com/json
Use JSONP on the frontend to get the visitor's IP info
function callback(ip, location, asn, org) {
document.getElementById('result').textContent =
`${ip} ${location} ${asn} ${org}`;
}