IPPubblico Public API

Free, no-auth public IP API. Four endpoints returning IPv4, IPv6, ISP, ASN, geolocation and timezone — in JSON or plain text.

✓ Free forever ✓ No API key ✓ No rate limit JSON & Plain text CORS enabled

Base URLs endpoints

endpoints
# Full data (JSON)
https://ippubblico.org/?api=1

# IPv4 + IPv6 (plain text, 2 lines)
https://ippubblico.org/?text=1

# IPv4 only
https://ipv4.ippubblico.org/

# IPv6 only
https://ipv6.ippubblico.org/

Endpoints reference

GET https://ippubblico.org/?api=1 Full JSON response

Returns a complete JSON object with all available data about the caller's IP address.

curl
curl https://ippubblico.org/?api=1
Response — application/json
{
  "status":   "ok",
  "ip":       "93.45.12.88",
  "ipv4":     "93.45.12.88",
  "ipv6":     null,
  "isp":      "Telecom Italia S.p.A.",
  "asn":      "AS3269",
  "timezone": "Europe/Rome",
  "datetime": "2026-05-05T12:00:00+02:00",
  "geo": {
    "city":    "Rome",
    "region":  "Lazio",
    "country": "Italy",
    "lat":     41.9028,
    "lon":     12.4964
  },
  "headers":  { /* HTTP request headers */ },
  "cached":   false,
  "lang":     "en"
}
FieldTypeDescription
statusstring"ok" or "partial" if geolocation failed
ipstringDetected IP (may be IPv4 or IPv6)
ipv4string | nullIPv4 address if available
ipv6string | nullIPv6 address if available
ispstring | nullInternet Service Provider name
asnstring | nullAutonomous System Number (e.g. "AS3269")
timezonestring | nullIANA timezone (e.g. "Europe/Rome")
datetimestringISO 8601 datetime in the caller's timezone
geo.citystring | nullApproximate city name
geo.regionstring | nullRegion / state name
geo.countrystring | nullCountry name
geo.lat / geo.lonfloat | nullApproximate coordinates
cachedbooleantrue if result served from 1h cache
GET https://ippubblico.org/?text=1 Plain text — IPv4 + IPv6

Returns IPv4 and IPv6 on two separate lines. Returns NONE if a protocol is unavailable.

curl
curl https://ippubblico.org/?text=1
Response — text/plain
IPv4: 93.45.12.88
IPv6: NONE
GET https://ipv4.ippubblico.org/ IPv4 only

Returns only the IPv4 address as plain text, or NONE if not available.

curl
curl https://ipv4.ippubblico.org/
Response — text/plain
93.45.12.88
GET https://ipv6.ippubblico.org/ IPv6 only

Returns only the IPv6 address as plain text, or NONE if not available.

curl
curl https://ipv6.ippubblico.org/
Response — text/plain
2001:db8::1

Code examples samples

bash / curl
# Get full JSON
curl https://ippubblico.org/?api=1

# Get only IPv4
MY_IP=$(curl -s https://ipv4.ippubblico.org/)
echo "My IPv4: $MY_IP"

# Get only IPv6
MY_IPV6=$(curl -s https://ipv6.ippubblico.org/)
echo "My IPv6: $MY_IPV6"
JavaScript (fetch)
// Full JSON
const res = await fetch('https://ippubblico.org/?api=1');
const data = await res.json();
console.log(data.ipv4, data.ipv6, data.geo.country);

// IPv4 only
const ipv4 = await fetch('https://ipv4.ippubblico.org/').then(r => r.text());
console.log('IPv4:', ipv4);
Python
import requests

# Full JSON
data = requests.get('https://ippubblico.org/?api=1').json()
print(data['ipv4'], data['geo']['country'])

# IPv4 only
ipv4 = requests.get('https://ipv4.ippubblico.org/').text.strip()
print(f'IPv4: {ipv4}')
PHP
// Full JSON
$data = json_decode(file_get_contents('https://ippubblico.org/?api=1'), true);
echo $data['ipv4'];

// IPv4 only
$ipv4 = trim(file_get_contents('https://ipv4.ippubblico.org/'));
Go
resp, _ := http.Get("https://ipv4.ippubblico.org/")
body, _ := io.ReadAll(resp.Body)
fmt.Println("IPv4:", strings.TrimSpace(string(body)))
PowerShell
$ip = (Invoke-WebRequest 'https://ipv4.ippubblico.org/').Content.Trim()
Write-Host "IPv4: $ip"
Ruby
require 'open-uri'
ipv4 = URI.open('https://ipv4.ippubblico.org/').read.strip
puts "IPv4: #{ipv4}"
C# / .NET
var client = new HttpClient();
var ipv4 = (await client.GetStringAsync("https://ipv4.ippubblico.org/")).Trim();
Console.WriteLine($"IPv4: {ipv4}");

Notes info

  • No authentication — no API key or token required
  • CORS enabled — usable from browser JavaScript on any domain
  • 1h cache — geolocation data is cached for 1 hour per IP
  • IPv4 subdomainipv4.ippubblico.org forces IPv4 connection via DNS A record only
  • IPv6 subdomainipv6.ippubblico.org forces IPv6 connection via DNS AAAA record only
  • Geolocation accuracy — approximate city/region level (~50km). Not suitable for legal or surveillance purposes.
  • Data retention — IP and metadata stored for max 90 days for statistics. No third-party sharing.

Available languages 36 languages

The full website is available in 36 languages. The API itself is language-independent.

🇮🇹 IT Italiano
🇬🇧 EN English
🇩🇪 DE Deutsch
🇫🇷 FR Français
🇪🇸 ES Español
🇵🇹 PT Português
🇳🇱 NL Nederlands
🇵🇱 PL Polski
🇷🇴 RO Română
🇨🇿 CS Čeština
🇸🇪 SV Svenska
🇩🇰 DA Dansk
🇫🇮 FI Suomi
🇭🇺 HU Magyar
🇸🇰 SK Slovenčina
🇧🇬 BG Български
🇭🇷 HR Hrvatski
🇸🇮 SL Slovenščina
🇪🇪 ET Eesti
🇱🇻 LV Latviešu
🇱🇹 LT Lietuvių
🇬🇷 EL Ελληνικά
🇲🇹 MT Malti
🇮🇪 GA Gaeilge
🇷🇺 RU Русский
🇺🇦 UK Українська
🇯🇵 JA 日本語
🇨🇳 ZH 中文
🇮🇳 HI हिन्दी
🇸🇦 AR العربية
🇰🇷 KO 한국어
🇹🇷 TR Türkçe
🇮🇩 ID Bahasa Indonesia
🇻🇳 VI Tiếng Việt
🇹🇭 TH ภาษาไทย
🇲🇾 MS Bahasa Melayu