UTILITY
IP Address API
/ipFind the public IP address of the client making the request.
No signup or API key required.
Parameters
No endpoint-specific parameters. Use format to choose the response representation.
formatenumoptional · query- Response format. Defaults to json.
jsontext
No request body. Unknown or repeated query parameters return HTTP 400.
Returns 200 OK
A JSON object with the following fields.
ipstring- Public IP of the calling client from Cloudflare metadata. Server-side calls report the server’s outgoing IP.
Plain text
With format=text: Only the ip value, without the JSON wrapper.
Errors
Validation and service errors always return JSON, including when format=text.
errorstring- A machine-readable error code, such as invalid_parameter or rate_limited.
messagestring- A description of the problem.
400 Invalid parameters.
414 Query string exceeds 2048 characters.
429 Rate limit reached. Wait the seconds in Retry-After before retrying.
503 ip_unavailable: Cloudflare caller-IP metadata is unavailable.
Usage notes
Caller IP from Cloudflare's CF-Connecting-IP metadata. Returns 503 if metadata is unavailable. Never uses X-Forwarded-For.
Use a browser request to show a visitor their public IP. A request from your server reports that server’s outgoing IP instead of the visitor’s address.
Responses are not cached. Browser requests are supported through open CORS.
120 requests per minute per IP, with up to 30 per 10 seconds, shared across APIs. Limits are approximate per Cloudflare location. Full usage limits ↗