IP

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

EndpointDescriptionContent-Type
GET /Your real public IP addresstext/plain
GET /geoGeolocation data for your IPapplication/json
GET /asnASN data for your IPapplication/json
GET /jsonAll data for your IPapplication/json

Arbitrary IP lookup

EndpointDescription
GET /{ip}Returns the IP as-is (validates format)
GET /{ip}/geoGeolocation for the given IP
GET /{ip}/asnASN data for the given IP
GET /{ip}/jsonAll 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.0

Get 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 /download

Returns an HTML page listing all available files with their size, last-updated date, and SHA-256 hash.

Download a file

GET /download/{filename}.mmdb

Access is restricted by IP. Unauthorized requests receive 403 Forbidden.

Available files

FileDataLicenseUpdate frequency
asn.mmdbASN number + organizationCC BY 4.0 (RouteViews + DB-IP)Daily
country.mmdbISO country codeCC0 (GeoFeed + Whois + ASN)Daily
city.mmdbCity, 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 /download

Rate 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.