Free IP Address API
A lightweight, browser-friendly IP API that returns your visitor's IP, country, ISP, VPN or proxy status, and more. Paste one HTML snippet and you're live — no sign-up required.
Paste one snippet and go live quickly.
Call directly from the browser with CORS enabled.
Get IP, location, ISP, and risk context together.
Quick start
Paste this snippet anywhere in your HTML — no backend needed. It detects your visitor's IP and displays it with the required attribution link already included.See live preview →
<!-- Display IP info with attribution -->
<div id="sitealive-ip" style="padding:12px; background:#f5f5f5; border-radius:8px; max-width:300px;">
<p>Loading...</p>
</div>
<script>
(async () => {
try {
const res = await fetch('https://sitealive.io/functions/ipinfo', {
headers: { 'X-Attribution': 'sitealive' }
});
const data = await res.json();
if (data.error) {
document.getElementById('sitealive-ip').innerHTML = '<p style="color:red;">Error: ' + data.error + '</p>';
return;
}
document.getElementById('sitealive-ip').innerHTML =
'<p style="margin:0 0 8px 0"><strong>Your IP:</strong> ' + data.ip + '</p>' +
'<p style="margin:0 0 8px 0"><strong>Country:</strong> ' + (data.country || 'N/A') + '</p>' +
'<p style="margin:0 0 12px 0"><strong>ISP:</strong> ' + (data.isp || 'N/A') + '</p>' +
'<p style="margin:0; font-size:11px; color:#666;">Powered by <a href="https://sitealive.io/whatismyip" target="_blank">SiteAlive.io</a></p>';
} catch (e) {
document.getElementById('sitealive-ip').innerHTML = '<p style="color:red;">Unable to fetch IP info</p>';
}
})();
</script>What this IP Info API is for
This page is designed for developers and builders who want a fast, simple way to detect visitor IP information directly from the browser.
It is useful for lightweight personalization, network awareness, traffic quality checks, location context, and basic privacy or security signals.
Why it matters
IP context can help you adapt experiences, understand traffic sources, and add simple risk signals without a heavy backend setup.
API Endpoint
Every API request must include the header X-Attribution: sitealive and your page must display a visible link Powered by SiteAlive.io. Requests without the header or missing the attribution link will return a 403 Forbidden error.
$cURL
curl -H "X-Attribution: sitealive" https://sitealive.io/functions/ipinfo
JSJavaScript (fetch)
const res = await fetch('https://sitealive.io/functions/ipinfo', {
headers: { 'X-Attribution': 'sitealive' }
});
const data = await res.json();
console.log(data.ip, data.country, data.isp);
// Results include: ip, country, city, isp, vpn, proxy, datacenter, etc.PYPython
import requests
data = requests.get('https://sitealive.io/functions/ipinfo',
headers={'X-Attribution': 'sitealive'}).json()
print(data['ip'], data['country'])📦Example Response
{
"ip": "203.0.113.42",
"country": "Sweden",
"country_code": "SE",
"region": "Stockholm County",
"city": "Stockholm",
"lat": 59.3293,
"lon": 18.0686,
"isp": "Telia Company AB",
"org": "AS1257 Telia AB",
"asn": "AS1257",
"hostname": "h-203-0-113.host.example.com",
"vpn": false,
"proxy": false,
"tor": false,
"datacenter": false,
"mobile": false,
"userAgent": "Mozilla/5.0 ...",
"browser": "Chrome",
"os": "Windows",
"device": "Desktop"
}Response Fields
CORS is enabled — call directly from any browser or frontend. Free usage is rate limited to 10 requests per minute per IP. For higher limits, contact us.
What can you do with an IP detection API?
An IP detection API lets your website identify where a visitor is connecting from the moment they load the page — with no login or user input required. Common use cases include geolocation-based personalisation (showing prices in the visitor's currency, pre-filling a country field in a form, or serving region-specific content), fraud and abuse prevention (flagging requests from VPNs, proxies, Tor exit nodes, or known bad ASNs), and analytics enrichment (tagging events with country or ISP data without relying on a third-party tracker).
Because the SiteAlive API is called client-side via the browser's fetch API, it detects the actual visitor's IP — not a proxy or load balancer IP that a server-side call might see. CORS is fully enabled, so no backend proxy is needed.
VPN and proxy detection explained
The API checks each IP against known hosting and datacenter ASN ranges. If the IP belongs to a cloud provider (AWS, DigitalOcean, Vultr, etc.), a commercial VPN service, or a datacenter, the vpn or datacenter flags will be set to true.
Tor exit node detection works by checking whether the IP appears in the Tor exit node consensus list. Mobile carrier detection uses carrier-registered IP ranges from regional internet registries. These signals combined give you a reliable, low-latency risk signal for each visitor — at zero cost.
Rate limits & fair use
The API is free with a limit of 10 requests per minute per client IP. This is sufficient for most web pages and low to medium traffic sites. There is no daily cap — only the per-minute window is enforced.
If you exceed the limit you will receive a 429 Too Many Requests response. For higher throughput requirements or SLA guarantees, contact us.