API Reference

Free, public REST endpoint. No signup. Multi-provider fallback chain with 24 h in-memory cache. Free tier: 100 req/min per caller IP. Higher limits and paid SLAs ship with E5 (BV) close.

Try it

Loading your IP…

Endpoint

MethodGET
URLhttps://iploc.eu/api/lookup
AuthNone (anonymous tier). API keys ship with paid plans.
Content-Typeapplication/json
CORSAccess-Control-Allow-Origin: *

Query patterns

GET /api/lookup?ip=8.8.8.8         # explicit IP via query param
GET /api/lookup/8.8.8.8            # path-style (also accepted)
GET /api/lookup                    # no IP — geolocates the caller

Response schema

Full JSON Schema 2020-12: /lookup.schema.json.

{
  "ip":            "8.8.8.8",
  "city":          "Mountain View",
  "region":        "California",
  "country_code":  "US",
  "country_name":  "United States",
  "lat":           37.4056,
  "lon":           -122.0775,
  "timezone":      "America/Los_Angeles",
  "asn":           "AS15169",
  "org":           "Google LLC",
  "postal":        "94043",
  "is_eu":         false,

  "_provider":         "ip-api.com",
  "_cached":           false,
  "_response_time_ms": 47
}

Error responses

StatusError codeMeaning
400invalid_ipThe supplied value is not a valid IPv4 or IPv6 address.
400private_ip_rejectedLoopback, RFC1918, link-local, multicast, and CGNAT addresses are not geolocatable.
405method_not_allowedOnly GET and HEAD are accepted.
429rate_limitedYou hit the anonymous-tier rate limit (100 req/min per caller IP). Wait, or join early-access.
502all_providers_failedAll upstream geo providers timed out. Retry shortly.

Rate limits

Examples

1. curl — lookup an IP

curl https://iploc.eu/api/lookup?ip=8.8.8.8

2. JavaScript (fetch) — geo-personalize without a backend

const geo = await fetch('https://iploc.eu/api/lookup', {
  headers: { Accept: 'application/json' },
}).then(r => r.json());

if (geo.is_eu) showCookieBanner();
document.documentElement.lang = (geo.country_code || 'en').toLowerCase();
console.log('caller geo:', geo.city, geo.country_code, geo.asn);

3. Python (requests) — ASN-based bot filtering

import requests

BLOCKLIST_ASNS = {'AS14618', 'AS16509', 'AS8075'}  # AWS, AWS, Microsoft

def is_likely_bot(ip: str) -> bool:
    r = requests.get('https://iploc.eu/api/lookup', params={'ip': ip}, timeout=5)
    r.raise_for_status()
    return r.json().get('asn') in BLOCKLIST_ASNS

4. Go (net/http) — fraud-scoring pipeline

type Geo struct {
    IP          string  `json:"ip"`
    CountryCode string  `json:"country_code"`
    ASN         string  `json:"asn"`
    IsEU        bool    `json:"is_eu"`
}

func lookup(ctx context.Context, ip string) (*Geo, error) {
    req, _ := http.NewRequestWithContext(ctx, "GET",
        "https://iploc.eu/api/lookup?ip="+url.QueryEscape(ip), nil)
    resp, err := http.DefaultClient.Do(req)
    if err != nil { return nil, err }
    defer resp.Body.Close()
    var g Geo
    return &g, json.NewDecoder(resp.Body).Decode(&g)
}

Privacy

Source providers (current)

While the M0 beta runs, /api/lookup proxies a fallback chain of four free providers (ip-api.com → ipwho.is → ipinfo.io → freeipapi.com). The provider that served your response is reported in _provider. The owned MaxMind GeoIP2-City + ASN stack ships post BV-close (target: 8 weeks).

Join the waitlist for paid tiers →


Get early access — 50% off for 12 months

First 100 signups lock in 50% off any paid plan for the first year. No credit card required — we’ll email you at launch.