Icanhazip API
Overview
Icanhazip returns your public IP address as a plain text string with no authentication, parsing, or configuration needed. It is one of the oldest and most widely used IP detection services, commonly embedded in shell scripts and network configuration tools. Both IPv4 (icanhazip.com) and IPv6 (ipv6.icanhazip.com) variants are available.
Beginner Tip
Just curl the URL and you get your IP address back as plain text — it is that simple. This is an ideal first API call for anyone new to curl or HTTP. Use it in shell scripts with MY_IP=$(curl -s https://icanhazip.com) to capture your current public IP into a variable.
Available Data
Example Response
{
"status": "success",
"data": {
"result": "Data from Icanhazip",
"description": "IP Address API",
"timestamp": "2025-01-15T10:00:00Z"
}
} Field Reference
(plain text body) Your public IP address as a plain text string, either IPv4 or IPv6 depending on your network stack. Implementation Example
const url = "https://major.io/icanhazip-com-faq/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →24 Pull Requests
⭐ Beginner's Pick24 Pull Requests is a community initiative that runs every December to encourage developers to contribute to open source projects.
Agify.io
⭐ Beginner's PickAgify.io is a free API that predicts the likely age of a person based solely on their first name, using a database of over 350 million historical records.
API Grátis
API Grátis is a Brazilian API aggregator that bundles multiple free utility services including CEP (postal code) lookup, CNPJ (company registry) data, vehicle plate information, and more — all under a single authentication token.
ApicAgent
⭐ Beginner's PickApicAgent parses User-Agent strings into structured device and browser information, returning details like browser name, version, OS, device type, and whether the client is a bot.
APIs.guru
⭐ Beginner's PickAPIs.guru maintains a crowd-sourced directory of OpenAPI (Swagger) specification files for hundreds of public web APIs, all normalized to OpenAPI 3.0 format.