myip.mk

myip.mk

IP API documentation

myip.mk provides two simple HTTPS endpoints for scripts, monitoring, shell commands, and small applications. No API key is required for reasonable use. Responses identify the requesting public address by default, while the JSON endpoint can also enrich a supplied globally routable IPv4 or IPv6 address.

Plain-text address endpoint

Send GET or HEAD to https://myip.mk/ip. A successful GET returns the requesting public IP address followed by a newline with content type text/plain. Use curl https://myip.mk/ip in a terminal. The endpoint deliberately returns no HTML, labels, or network metadata, making it suitable for shell variables and connectivity checks.

curl https://myip.mk/ip

Structured JSON endpoint

Send GET or HEAD to https://myip.mk/api/v1/ip. The JSON object includes ip, version, secure, location, and network fields. To inspect another public address, add an encoded ip parameter, for example /api/v1/ip?ip=8.8.8.8. Private, reserved, documentation, malformed, and empty explicit addresses return HTTP 400 with an invalid_ip error.

Caching, methods, and content negotiation

Personalized responses use Cache-Control: no-store. Supported methods are GET and HEAD; other methods return HTTP 405 and an Allow header. The website root is HTML by default. Clients that require machine output should use the explicit endpoints, request text/plain or application/json, or use the legacy format query parameter.

Responsible use and availability

The endpoints are intended for normal interactive use, scripts, and lightweight applications. Avoid high-frequency polling, bulk address enumeration, or behavior that degrades service for others. Network-enrichment fields depend on an upstream dataset and can be temporarily unavailable. Applications should tolerate null values, timeouts, and approximate rather than exact location data.