Skip to content

Free IP API

Your IP address as JSON, XML, YAML or plain text

A free, no-key API for your public IP address. Call it from shell scripts, monitoring dashboards, CI pipelines or any app, and pick the format that fits.

  • No API key or sign-up
  • CORS enabled
  • Rate-limited for fair use
Content-Type: application/json
Fetching your IP address…
$ curl https://tracethatip.com/json Open /json

Live output for your connection. Switch format with the tabs above.

Endpoints

Four endpoints, one answer

Send a GET request and get back the public IP address it came from. No API key or sign-up needed. Every endpoint is CORS-enabled and rate-limited for fair use.

GET

/raw

Plain text

Shell scripts, cron jobs and piping into other commands.

https://tracethatip.com/raw
Content-Type
text/plain; charset=utf-8

Example response

203.0.113.42
GET

/json

JSON

Web apps, dashboards, REST integrations and CI pipelines.

https://tracethatip.com/json
Content-Type
application/json; charset=utf-8

Example response

{"ip":"203.0.113.42"}
GET

/xml

XML

Enterprise tooling, SOAP services and legacy integrations.

https://tracethatip.com/xml
Content-Type
application/xml; charset=utf-8

Example response

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <ip>203.0.113.42</ip>
</response>
GET

/yaml

YAML

DevOps tooling and configuration files.

https://tracethatip.com/yaml
Content-Type
text/yaml; charset=utf-8

Example response

ip: "203.0.113.42"

Fair use. Requests are rate-limited so the service stays fast for everyone. If a script checks your IP on a schedule, once every few minutes is plenty. See the Terms of Service for details.

Integration

Quick integration examples

Copy-paste snippets for the tools you already use. The raw endpoint is ideal for piping into other commands; use /json when you want structured data.

# Plain text: just the address
curl -s https://tracethatip.com/raw

# JSON
curl -s https://tracethatip.com/json

# Store it in a variable (Bash)
MY_IP=$(curl -s https://tracethatip.com/raw) && echo "My IP: $MY_IP"

The -s flag hides the progress meter so only your IP is printed, which makes it easy to use in firewall rules, DNS updates or deployment scripts.

Formats

Understanding IP address output formats

Different applications and workflows need IP data in different shapes. Pick the one that fits, whether you're building a dashboard, writing a deployment script or wiring IP detection into a web app.

JSON

The most widely used format for web APIs and JavaScript apps. Lightweight, human-readable and natively supported by every modern language, it suits REST integrations, frontends and data pipelines.

/json

XML

A structured markup format common in enterprise environments, SOAP web services and legacy integrations, with strict schema validation and tools like XSLT for transformation.

/xml

YAML

A human-friendly format popular in DevOps tooling such as Kubernetes configs, Ansible playbooks and CI/CD pipelines. Its clean syntax makes it easy to drop IP data into config files.

/yaml

Plain text

The simplest option: just the raw IP string with no wrapper. Perfect for shell scripts, command-line tools and automation where you pipe the result straight into another command.

/raw

Built for developers

Developer-friendly features

TraceThatIP is designed to slot into your existing workflow, whether you're building a SaaS app, managing infrastructure or doing security research.

  • Lightweight responses

    The format endpoints return only your IP address, with no geolocation lookup and no HTML, so responses are tiny and quick.

  • Multiple output formats

    JSON, XML, YAML and plain text outputs to fit any integration requirement.

  • CORS enabled

    Every endpoint sends Access-Control-Allow-Origin: *, so you can call it straight from browser JavaScript.

  • Protected lookup API

    The site's own geolocation API is secured with encrypted tokens to prevent unauthorised automated access, while these endpoints stay open and rate-limited.

  • No tracking or logging

    We respect your privacy: IP lookups are not logged for marketing. See our Privacy Policy

FAQ

IP API questions

Can't find what you need? Get in touch.

Is the IP API free to use?

Yes. The /raw, /json, /xml and /yaml endpoints are free, with no API key or sign-up required. Send a GET request and you get your public IP back.

Is there a rate limit?

Yes. Requests are rate-limited so the service stays fast for everyone; our Terms of Service set the limit at 300 requests per minute. If a script checks your IP on a schedule, once every few minutes is plenty.

Which endpoint should I use?

Use /raw for shell scripts and cron jobs, /json for applications, dashboards and CI pipelines, /xml for XML-based tooling and /yaml for configuration files. They all return the same address.

Does the API return my location or ISP?

No. These endpoints return only the IP address your request came from. For the approximate location, ISP, ASN and timezone of any address, use IP Lookup.

Can I call the API from browser JavaScript?

Yes. Every endpoint sends Access-Control-Allow-Origin: *, so a plain fetch() from any web page works without a proxy.

Why is the IP different from the one in my network settings?

Your computer's network settings usually show a private address assigned by your router, such as 192.168.1.20. The API sees the public IP your router (or VPN) uses on the internet, the same one shown on What's My IP.