ip.robotstxt.es is a lightweight, self-hosted IP intelligence platform. It tells you your real public IP address and enriches it — or any IP you provide — with geolocation and ASN data. No accounts, no API keys, no JavaScript required.
Endpoints
All endpoints accept plain HTTP GET requests. JSON responses include a Cache-Control: public, max-age=60 header.
Your IP
| Endpoint | Description | Content-Type |
|---|---|---|
GET / | Your real public IP address | text/plain |
GET /geo | Geolocation data for your IP | application/json |
GET /asn | ASN data for your IP | application/json |
GET /json | All data for your IP | application/json |
Arbitrary IP lookup
| Endpoint | Description |
|---|---|
GET /{ip} | Returns the IP as-is (validates format) |
GET /{ip}/geo | Geolocation for the given IP |
GET /{ip}/asn | ASN data for the given IP |
GET /{ip}/json | All data for the given IP |
Both IPv4 and IPv6 addresses are accepted. City-level data (city, region, latitude, longitude) is only available for IPv4 addresses; IPv6 lookups return country and ASN data.
Examples
Get your public IP
curl https://ip.robotstxt.es/
# 82.152.2.0Get geolocation for your IP
curl https://ip.robotstxt.es/geo{
"ip": "82.152.2.0",
"country": "ES",
"city": "Barcelona",
"region": "Catalonia",
"timezone": "Europe/Madrid",
"latitude": 41.3888,
"longitude": 2.159
}Get ASN for your IP
curl https://ip.robotstxt.es/asn{
"ip": "82.152.2.0",
"asn": "AS3352",
"org": "Telefonica de Espana"
}Get everything for your IP
curl https://ip.robotstxt.es/json{
"ip": "82.152.2.0",
"country": "ES",
"city": "Barcelona",
"region": "Catalonia",
"timezone": "Europe/Madrid",
"latitude": 41.3888,
"longitude": 2.159,
"asn": "AS3352",
"org": "Telefonica de Espana"
}Look up a specific IP
curl https://ip.robotstxt.es/8.8.8.8/json{
"ip": "8.8.8.8",
"country": "US",
"city": "Mountain View",
"region": "California",
"timezone": "",
"latitude": 37.422000885009766,
"longitude": -122.08499908447266,
"asn": "AS15169",
"org": "Google LLC"
}IPv6 lookup
curl https://ip.robotstxt.es/2a00:1450:4003:808::200e/json{
"ip": "2a00:1450:4003:808::200e",
"country": "IE",
"city": null,
"region": null,
"timezone": null,
"latitude": null,
"longitude": null,
"asn": "AS15169",
"org": "Google LLC"
}Using the API in scripts
Bash — get your IP
MY_IP=$(curl -s https://ip.robotstxt.es/)
echo "My IP is: $MY_IP"Bash — get country code
COUNTRY=$(curl -s https://ip.robotstxt.es/json | jq -r '.country')
echo "Country: $COUNTRY"Python
import urllib.request, json
with urllib.request.urlopen("https://ip.robotstxt.es/json") as r:
data = json.loads(r.read())
print(data["ip"], data["country"], data["asn"])JavaScript (browser or Node.js)
const res = await fetch("https://ip.robotstxt.es/json");
const data = await res.json();
console.log(data.ip, data.country, data.asn);All endpoints send Access-Control-Allow-Origin: *, so the API is usable directly from browser JavaScript without a proxy.
Download section
Trusted IPs can download the raw GeoIP MMDB database files directly.
File listing
GET /downloadReturns an HTML page listing all available files with their size, last-updated date, and SHA-256 hash.
Download a file
GET /download/{filename}.mmdbAccess is restricted by IP. Unauthorized requests receive 403 Forbidden.
Available files
| File | Data | License | Update frequency |
|---|---|---|---|
asn.mmdb | ASN number + organization | CC BY 4.0 (RouteViews + DB-IP) | Daily |
country.mmdb | ISO country code | CC0 (GeoFeed + Whois + ASN) | Daily |
city.mmdb | City, region, lat/lon (IPv4 only) | CC BY 4.0 (DB-IP Lite) | Monthly |
Verify integrity
# Download and verify SHA-256
curl -O https://ip.robotstxt.es/download/asn.mmdb
sha256sum asn.mmdb
# Compare against the hash shown at /downloadRate limits
API endpoints are rate-limited to 30 requests per minute per IP address, with a burst allowance of 10. Exceeding the limit returns 429 Too Many Requests.
