Network & DNS

GET/api/v1/my-ip

What Is My IP Address

The public IP address NetSH sees for your request, and whether it is IPv4 or IPv6. Nothing else: no lookups, so it is the cheapest and fastest endpoint.

Cost: 1 credit per request, out of 300 per day.

Example request

curl "https://netsh.io/api/v1/my-ip?api_key=YOUR_API_KEY"

Example response

{
  "ok": true,
  "data": { "ip": "203.0.113.42", "version": "IPv4" },
  "meta": { "tool": "my-ip", "version": "v1" }
}

Notes

  • Authentication is the same as every endpoint: an x-api-key header, or an api_key query parameter. It costs 1 credit per request.
  • The address returned is the public source IP that NetSH observed on the connection your request arrived from. If the request goes through a VPN, proxy, or NAT, that is the address of the VPN, proxy, or NAT gateway, not of the machine that sent it.
  • IPv4 and IPv6: version is "IPv4" or "IPv6", matching how the request reached NetSH. A client that can use both may get either one, so call it again with curl -4 or curl -6 to check a specific protocol.
  • Forwarding headers sent by the client are ignored. The address comes from the connection as recorded by NetSH's own front-end proxy, so it cannot be spoofed by setting a header.
  • If the address is missing, malformed, or private (for example a request made from inside a private network), the endpoint returns an error instead of an address.
  • Use it for scripts that need their own egress IP, firewall allowlisting, checking that a VPN or proxy is doing what you expect, troubleshooting a server's public egress IP, and cloud or server connectivity tests. For details about an address (owner, ISP, country), use IP Info.
TLS Configuration