Current IP: [United States Virginia Ashburn]

Why use?

Do you need to get the public IP address or IP Geolocation programmatically? Do you have the requirements to obtain the servers’ public IP address? Do you need to get the location of your servers? Whatever the reason,sometimes a public IP address and IP Geolocation API are useful.

You should use because:

  • You can initiate requests without any limit.
  • You can get the english or chinese location data.
  • Does not record the visitor information.
  • Lastly, is sponsored by IPIP.NET and will exist in long-term stability, please feel free to use it.

API Usage

Using is ridiculously simple. You have two options. Address location support English and Chinese. You can get your public IP directly (in plain text), you can get your public IP in JSON format.

- API URI Type Sample Output (IPv4) Sample Output (IPv6)
get IP text 2001:4860:4860::8888
get XFF(X-Forwarded-For) text 2001:4860:4860::8888
get IP Location(English) json
  "ip": "2001:19f0:7001:5607:5400:1ff:fec7:13a9",
  "location": {
    "city": "Tokyo",
    "country_code": "JP",
    "country_name": "Japan",
    "latitude": "35.709026",
    "longitude": "139.731993",
    "province": "Tokyo"
get IP Location(Chinese Simplified) json
  "ip": "2001:19f0:7001:5607:5400:1ff:fec7:13a9",
  "location": {
    "city": "东京",
    "country_code": "JP",
    "country_name": "日本",
    "latitude": "35.709026",
    "longitude": "139.731993",
    "province": "东京都"

Gets the information for the request.

- API URI Type Sample Output
get Request Header text
GET /header HTTP/1.1
Accept: */*
User-Agent: curl/7.54.0


This section contains some common usage patterns from a variety of programming languages. Email me!



ip=$(curl -s
echo "My public IP address is: $ip"


# This example requires the requests library be installed.  You can learn more
# about the Requests library here:
from requests import get

ip = get('').text
print('My public IP address is: {}'.format(ip))


require "net/http"

ip = Net::HTTP.get(URI(""))
puts "My public IP Address is: " + ip


    $ip = file_get_contents('');
    echo "My public IP address is: " . $ip;


try (java.util.Scanner s = new java.util.Scanner(new"").openStream(), "UTF-8").useDelimiter("\\A")) {
    System.out.println("My current IP address is " +;
} catch ( e) {


use strict;
use warnings;
use LWP::UserAgent;

my $ua = new LWP::UserAgent();
my $ip = $ua->get('')->content;
print 'My public IP address is: '. $ip;


var httpClient = new HttpClient();
var ip = await httpClient.GetStringAsync("");
Console.WriteLine($"My public IP address is: {ip}");


var http = require('http');

http.get({'host': '', 'port': 80, 'path': '/'}, function(resp) {
  resp.on('data', function(ip) {
    console.log("My public IP address is: " + ip);


package main

import (

func main() {
        res, _ := http.Get("")
        ip, _ := ioutil.ReadAll(res.Body)



GET / HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: br,gzip
Accept-Language: en-US,en;q=0.5
Connection: Keep-Alive
If-Modified-Since: Thu, 06 Oct 2022 20:53:59 GMT
User-Agent: CCBot/2.0 (