> For the complete documentation index, see [llms.txt](https://docs.ipcheck.ing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipcheck.ing/knowledge-base/getting-started/curl-api.md).

# Using the Curl API

Sometimes you do not want a web page. You want your IP address in a terminal window, or inside a script. MyIP has a plain-text endpoint for exactly that.

Inside the app you can open this panel by clicking the **curl** banner in the product strip near the bottom of the page, just above the footer. The panel is titled **Command Line API**.

## The commands

On the official site, [ipcheck.ing](https://ipcheck.ing):

```bash
# Get your machine's IPv4 address
curl 4.ipcheck.ing

# Get your machine's IPv6 address
curl 6.ipcheck.ing

# Get whichever address your machine prefers to use
curl 64.ipcheck.ing
```

Each domain answers over one protocol only, which is what makes the first two reliable:

* `4.ipcheck.ing` can only be reached over IPv4, so it always reports your IPv4 address.
* `6.ipcheck.ing` can only be reached over IPv6, so it always reports your IPv6 address.
* `64.ipcheck.ing` accepts both, so it reports whichever your system chose — usually IPv6 when it is available.

{% hint style="info" %}
If `curl 6.ipcheck.ing` fails to connect, that is a result in itself: your network probably has no working IPv6. See [IPv4 vs IPv6](/knowledge-base/concepts/ipv4-vs-ipv6.md).
{% endhint %}

## Adding geolocation

Add `/geo` to any of the three to get geographic information about the address instead of the address alone:

```bash
curl 4.ipcheck.ing/geo
curl 6.ipcheck.ing/geo
curl 64.ipcheck.ing/geo
```

The `/geo` path is optional. Leave it off when you only want the address.

## Using it in scripts

Because the response is plain text and nothing else, it drops straight into shell scripts:

```bash
# Store your current address in a variable
MY_IP=$(curl -s 4.ipcheck.ing)
echo "Current address: $MY_IP"
```

```bash
# Check every minute whether your address has changed
while true; do
  date
  curl -s 4.ipcheck.ing
  sleep 60
done
```

The `-s` flag tells curl to stay quiet about its own progress, which keeps the output clean.

Common uses: confirming a VPN is up before starting a backup job, watching for a dynamic IP change on a home connection, or logging which exit address a server is using.

{% hint style="warning" %}
Please be reasonable about how often you call this. It is a free service running on donated effort — a request every few seconds from a loop will get rate-limited. Once a minute is plenty for almost every purpose.
{% endhint %}

## Checking the same thing in the app

Everything the command line gives you is also on the dashboard, with more detail:

* The **IP Infos** section shows the same addresses with location, ISP, and network number — see [Reading Your IP Cards](/knowledge-base/getting-started/reading-your-ip-cards.md).
* Press <kbd>q</kbd> to look up any other address you are curious about.

## Self-hosted instances

The curl domains are a deployment setting, not a fixed part of MyIP. Whoever runs a copy of MyIP chooses their own domain names for it, and the panel shows whatever they configured. If none are configured, the panel says the feature is not available.

That means:

* The `4.ipcheck.ing`, `6.ipcheck.ing`, and `64.ipcheck.ing` names above belong to the official site only.
* On a self-hosted copy, open the **Command Line API** panel there to see that instance's own commands.

For how to run your own copy, see [About MyIP](/knowledge-base/faq/about.md).

## Related pages

* [IP Information](/knowledge-base/connection-tools/ip-information.md)
* [Why Do Sites See a Different IP?](/knowledge-base/diagnose/why-do-sites-see-a-different-ip.md)
* [General FAQ](/knowledge-base/faq/general-faq.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ipcheck.ing/knowledge-base/getting-started/curl-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
