To get your public IP address or external IP address, you can use any one of these sites:
You can visit them from your web browser, and it will return your public IP address in plaintext format.
If you want to get your public IP address from your terminal, you have options such as:
- PowerShell
- Command prompt (CMD)
- Linux/Bash based terminals
PowerShell
curl
in PowerShell usually requires some configuration to get started however, the best way to make an API request on PowerShell is with the Invoke-RestMethod
. If you run:
Invoke-RestMethod ipinfo.io/ip
You will get your public IP address as a plaintext response.
Learn more about the Invoke-RestMethod from the PowerShell documentation.
Command Prompt (CMD)
In the latest versions of Windows OS, curl
comes standard with the command prompt (CMD).
curl ipinfo.io/ip
If your Windows OS did not come with curl
, you will need to download it from the official site and install it and add it to your PATH environment variable.
Unix like/based terminals
There are a few terminal solutions that replicate the Unix experience on Windows. Such as:
- Cygwin
- Git Bash (MinGW)
- Windows Subsystem for Linux
- GNU on Windows etc.
In these terminals, curl
may come with the standard install. If not, you can easily install it.