Back to What Is My IP
Free Forever · No API Key · CORS Enabled

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.

IP geolocationISP & ASNVPN / Proxy detectionBrowser & OSCORS enabled10 req/min free
Fast setup

Paste one snippet and go live quickly.

Frontend-friendly

Call directly from the browser with CORS enabled.

Practical signals

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

GEThttps://sitealive.io/functions/ipinfo
Attribution Required

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

ipstringThe caller's public IP address
countrystringFull country name
country_codestringISO 3166-1 alpha-2 country code (e.g. SE)
regionstringRegion or state name
citystringCity name
lat / lonnumberApproximate coordinates (city-level)
ispstringInternet Service Provider name
orgstringOrganisation and ASN string
asnstringAutonomous System Number (e.g. AS1257)
hostnamestring|nullReverse DNS hostname, if available
vpnbooleanTrue if the IP is likely a VPN exit node
proxybooleanTrue if the IP is detected as a proxy
torbooleanTrue if the IP appears to be a Tor exit node
datacenterbooleanTrue if the IP belongs to a hosting/datacenter ASN
mobilebooleanTrue if the IP is from a mobile carrier
userAgentstringRaw User-Agent header from the request
browserstringDetected browser name
osstringDetected operating system
devicestringDesktop, Mobile, or Tablet

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.

❓Frequently asked questions

Is the API really free?
Yes — completely free, no credit card, no API key, no sign-up. You must include the X-Attribution: sitealive header with every request and display a 'Powered by SiteAlive.io' link in your UI.
Does it work from the browser (CORS)?
Yes. CORS headers are set to allow any origin, so you can call the API directly from client-side JavaScript without a backend proxy.
How accurate is the geolocation?
Country-level accuracy is above 99%. City-level accuracy depends on the IP type — residential IPs are typically within 25 km, while mobile and datacenter IPs may resolve to a network hub rather than the user's physical location.
Can I use it to block certain countries?
Yes. You can read the country_code field in your JavaScript and conditionally redirect or hide content. Be aware that VPN users can circumvent country-based restrictions — the vpn and proxy flags can help identify this.
Is there a rate limit?
Yes, the API is rate limited to 10 requests per minute per IP address. This is sufficient for most websites. If you hit the limit, you'll receive a 429 Too Many Requests response.