Icanhazip

Icanhazip

Development

IP Address API

Visit API

πŸ“š Documentation & Examples

Everything you need to integrate with Icanhazip

πŸš€ Quick Start Examples

Icanhazip Javascript Examplejavascript
// Icanhazip API Example
const response = await fetch('https://major.io/icanhazip-com-faq/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

The IP Address API is an invaluable tool for any developer, cybersecurity expert, or hobbyist interested in acquiring a user's IP address through straightforward means. Hosted on "icanhazip.com", the API returns a user's IP address in a plain text format. Whether your use-case demands IPv4, IPv6, or even both, the IP Address API can accommodate any and all requests. For detailed documentation, please visit the official documentation page .

This API is crafted to be incredibly straightforward, yet highly flexible in its application, making it an excellent fitting piece for a wide range of solutions from security to customization based on locations. Some factors that set the IP Address API apart include:

  • It's completely free to use.
  • Quick and easy setup.
  • Returns IP in text format, simplifying parsing process.
  • Supports both IPv4 and IPv6.
  • Automatically detects the type of IP.

Here is an example of how to call this API using JavaScript:

var request = new XMLHttpRequest();

request.open('GET', 'https://icanhazip.com', true);

request.onload = function() {
  if (this.status >= 200 && this.status < 400) {
    // Success! IP address is in this.response
    console.log(this.response);
  } else {
    // We reached the server, but it returned an error
  }
};

request.onerror = function() {
  // Connection error of some sort
};

request.send();

In this example, the output will be the IP address of the calling machine in plain text. This API is a surefire way to get IP related information quickly and efficiently.

πŸ”’

Security Assessment

F
πŸ”’HTTPS
Enabled
SSL Grade: T
πŸ›‘οΈHeaders
0/100
πŸ•’Last Assessed
4 days ago
ℹ️Click for detailed analysis

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

May 31Jun 2Jun 4Jun 6Jun 8Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 2904008001440Minutes
Online
Offline

Related APIs in Development