My IP Address API — /api/v1/ip/myip
Echoes back the caller's IP as seen at the edge, request headers, Cloudflare-injected geo signals, and a generated transaction id.
01 · OVERVIEW
What My IP Address does
Echoes back the caller's IP as seen at the edge, request headers, Cloudflare-injected geo signals, and a generated transaction id.
- Method GET
- Path /api/v1/ip/myip
- Stability STABLE
- Version v2026-05-15
- Summary Return the caller's public IP plus connection metadata.
03 · RESPONSE
Response schema
All successful responses follow the standard `{ success: true, data: {...} }` envelope. Notable fields on the data object for this endpoint:
- data.ip — string Public IPv4 / IPv6 as seen at the edge.
- data.headers — object Inbound request headers — useful for debugging proxies / VPNs.
- data.userAgent — string Inbound `User-Agent`.
- data.protocol — string `http` or `https`.
- data.host — string Server hostname that handled the request.
04 · EXAMPLE
Example response
Truncated but representative example for a real lookup:
{
"success": true,
"data": {
"ip": "2a09:bac5:3e0e:11c3::1c5:91",
"userAgent": "curl/8.7.1",
"protocol": "https",
"host": "titan-core-gpu-x1v4.domainscan.in",
"headers": {
"cf-ipcountry": "IN",
"cf-ray": "a0ace5fcbe8916dc-BOM"
}
}
}06 · BEST PRACTICES
Implementation tips
Patterns we recommend when integrating this endpoint:
- Cache on the client side for the session — IP rarely changes mid-session.
- Treat as the canonical source for client geo — beats `navigator.language`.
07 · FAQ
Frequently asked questions
- Why does this return IPv6? Modern carriers ship dual-stack. We return whichever address Cloudflare's edge accepted the TCP connection on.