Une clé API ?
Non. GET sur les URL HTTPS publiques.
IP publique de cette connexion, ou n’importe quelle IPv4/IPv6, en JSON ipkit.v1 stable. Base https://ipkit.dev. Pas de clé.
IPKit tourne en bordure Cloudflare. Le HTML et le JSON partagent la même pipeline. Cette page décrit l’API HTTP telle qu’implémentée. Pas de SLA ; usage raisonnable.
Tout est sur https://ipkit.dev. Les chemins sont sensibles à la casse. Encodez l’IPv6 si le shell casse sur les deux-points.
Lookup routes accept GET, HEAD, and OPTIONS. HEAD returns the same status and headers with an empty body. POST and other methods are not part of the lookup API. Clients do not send an API key; arbitrary lookups still need the operator-configured IPREGISTRY_API_KEY Worker secret.
There is no plaintext-only route and no endpoint that returns a single field. Read ip from the ipkit.v1 object (for example jq -r .ip). Lookups of private, loopback, link-local, CGNAT, multicast, unspecified, documentation, and other reserved IPv4/IPv6 ranges (including IPv4-mapped IPv6 such as ::ffff:10.0.0.1) return 400 RESERVED_IP. Current-IP detection of this connection is not subject to that check.
Seul / bascule HTML/JSON. /{ip} et /api/* renvoient toujours du JSON.
Successful lookups return Content-Type application/json; charset=utf-8, pretty-printed with two-space indent and a trailing newline. Field names stay in English. null means that value was not supplied. Locations are network estimates, not a street address or identity.
source is "ipregistry" when the configured intelligence provider succeeded. It is "cloudflare" when the record is built from Cloudflare request metadata (used for the current IP if the provider is missing or fails). Cloudflare metadata describes the connecting client only; it is never used as geolocation for a different target IP. Cloudflare-sourced records fill location.countryCode from request.cf.country or CF-IPCountry and location.country from that code when a name is known. Several network fields stay null, security flags are null, and security.risk is "unknown". If IPREGISTRY_API_KEY is unset, arbitrary lookups return 503 instead of guessing the caller’s country.
Illustrative ipkit.v1 object for 8.8.8.8. Values change with the address and data source; clients must tolerate nulls.
{
"schema": "ipkit.v1",
"ip": "8.8.8.8",
"type": "IPv4",
"source": "ipregistry",
"location": {
"continent": "North America",
"country": "United States",
"countryCode": "US",
"region": "California",
"regionCode": "CA",
"city": "Mountain View",
"postalCode": null,
"latitude": 37.386,
"longitude": -122.0838,
"timezone": "America/Los_Angeles"
},
"network": {
"asn": "AS15169",
"organization": "Google LLC",
"domain": "google.com",
"route": "8.8.8.0/24",
"usage": "hosting",
"carrier": null
},
"security": {
"proxy": false,
"vpn": false,
"tor": false,
"relay": false,
"cloud": true,
"threat": false,
"risk": "medium"
}
}Failures return JSON { "error": string, "code": string } with Cache-Control: no-store. error is a human-readable message; code is a stable machine token.
Chaque réponse JSON (y compris les erreurs) a Access-Control-Allow-Origin: *. Le prévol OPTIONS (204) existe sur /, /{ip}, /api/my-ip et /api/ip/{ip} (GET, HEAD, OPTIONS ; Max-Age 86400). Le HTML de / n’est pas une réponse JSON CORS.
300 requêtes par 60 secondes par IP cliente. Pas de SLA. Usage raisonnable : outil public gratuit, pas une API contractuelle.
Current-IP JSON (negotiated / and /api/my-ip) is Cache-Control: private, no-store so one client’s address is not reused for another. Specific-IP lookups (/{ip} and /api/ip/{ip}) are Cache-Control: public, max-age=300, s-maxage=3600, stale-while-revalidate=86400. Error responses are no-store. / JSON also varies on Accept and CF-Connecting-IP.
No authentication. HTTPS only. Parse schema and handle nulls and error objects.
Current public IP (curl)
curl https://ipkit.devLook up an address
curl https://ipkit.dev/8.8.8.8IPv6 in the path (quote colons)
curl "https://ipkit.dev/2001:4860:4860::8888"Always-JSON current IP
curl https://ipkit.dev/api/my-ipJavaScript fetch
const response = await fetch('https://ipkit.dev', {
headers: { Accept: 'application/json' },
});
const data = await response.json();
console.log(data.ip, data.location.countryCode);Python
import json, urllib.request
with urllib.request.urlopen('https://ipkit.dev') as response:
data = json.load(response)
print(data['ip'], data['location']['countryCode'])Shell one-liner (scripts / DDNS)
curl -sS https://ipkit.dev | jq -r .ipIPKit traite l’adresse demandée et les métadonnées HTTP en edge Cloudflare. Pas de base applicative d’IP visiteurs. La localisation est une estimation réseau. Voir la politique de confidentialité.
Non. GET sur les URL HTTPS publiques.
Pas de text/plain. Parsez le JSON : curl -sS https://ipkit.dev | jq -r .ip
Accept contient text/html. Utilisez ?format=json ou /api/my-ip.
Non. /{ip} et /api/ip/{ip} refusent les plages privées/réservées avec 400 RESERVED_IP. GET / et /api/my-ip renvoient toujours le client connecté.
Le message « IP intelligence is not configured for arbitrary lookups. » signifie que le secret Worker IPREGISTRY_API_KEY n’est pas défini sur le compte Cloudflare de ipkit.dev. La détection de l’IP courante fonctionne toujours.