Don't want to read anything else? Then don't, run the code sample below in your terminal to see some code magic!

$ curl ''

What can I do with it?

Have you ever needed to get an IPv4 or IPv6 address separately within your software or web app? Maybe you want to show your visitors both their IPv4 and IPv6 addresses at the same time or you want to test IPv6 readiness. With SeeIP you can do this and more!

You should use SeeIP because:

  • You can use it without any real limit.
  • It's open source, and 100% free to use.
  • It will always be online and secure.
  • It can show both IPv6 and IPv4 addresses together or separately.
  • The API powering this site is open source, and can be viewed on .
  • No user information is ever logged no matter what. We value privacy.
  • SeeIP is funded by UNVIO, LLC, you don't need to worry about the website disappearing or the SSL certs expiring, which we've had some trouble with in the past and is one of the main reasons why we wanted to fund and serve an open public IP API ourselves.

API Usage

Using SeeIP is really easy. You have multiple options. You can retrieve an IP in text, JSON or JSONP format, and you can also retrieve the IP's Geolocation information. You can choose to get either IPv4 or IPv6 or only IPv4 or IPv6.

API URI Response Type Sample Output (IPv4) Sample Output (IPv6) text 2a05:dfc7:5::53 json {"ip":""} {"ip":"2a05:dfc7:5::53"} jsonip getip({"ip":""}); getip({"ip":"2a05:dfc7:5::53"});

IPv4 Only

The endpoints below will only display IPv4 addresses.

API URI Response Type Sample Output text json {"ip":""} jsonip getip({"ip":""});

IPv6 Only

The endpoints below will only display IPv6 addresses.

API URI Response Type Sample Output text 2a05:dfc7:5::53 json {"ip":"2a05:dfc7:5::53"} jsonip getip({"ip":"2a05:dfc7:5::53"});


Some common usage patterns from a variety of programming languages are outlined below.



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}");


Dim httpClient As New System.Net.Http.HttpClient
Dim ip As String = 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)


(require net/url)

(define ip (port->string (get-pure-port (string->url ""))))
(printf "My public IP address is: ~a" ip)


val addr ="").mkString
println(s"My public IP address is: $addr")


<script type="application/javascript">
  function getIP(json) {
    document.write("My public IP address is: ", json.ip);

<script type="application/javascript" src=""></script>


<script type="application/javascript">
  $(function() {
      function(json) {
        document.write("My public IP address is: ", json.ip);


using System;
using System.Net;

namespace seeip.Examples {
    class Program {
        public static void Main (string[] args) {
            WebClient webClient = new WebClient();
            string publicIp = webClient.DownloadString("");
            Console.WriteLine("My public IP Address is: {0}", publicIp);


import HttpClient
var ip = newHttpClient().getContent("")
echo("My public IP address is: ", ip)


$ip = Invoke-RestMethod -Uri ''
"My public IP address is: $($ip.ip)"


http.Fetch("", function(body) print("My ip is: " .. body ) end


*Buffer = ReceiveHTTPMemory("")
If *Buffer
  ParseJSON(0, PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8))
  Debug GetJSONString(GetJSONMember(JSONValue(0), "ip"))


put "My public IP address is" && url ""


if (client.connect("", 80)) {
    client.println("GET / HTTP/1.0");
} else {
    Serial.println("connection failed");

GeoIP (Get IP address location in JSON format)

Calling the API endpoint without any parameter will return location information for the visitor IP address:

Appending an IP address as parameter will return location information for this IP address:

JSON Output Scheme

The output is a JSON object containing the following elements:

Please note that the IP location database, which for this API is Maxmind, may not contain all information about a given IP. In this case, only the available data is displayed.

  • ip (Visitor IP address, or IP address specified as parameter)
  • country_code (Two-letter ISO 3166-1 alpha-2 country code)
  • country_code3 (Three-letter ISO 3166-1 alpha-3 country code)
  • country (Name of the country)
  • region_code (Two-letter ISO-3166-2 state/region code for US and Canada, FIPS 10-4 region codes otherwise)
  • region (Name of the region)
  • city (Name of the city)
  • postal_code (Postal code/Zip code)
  • continent_code (Two-letter continent code)
  • latitude (Latitude)
  • longitude (Longitude)
  • dma_code (DMA Code)
  • area_code (Area Code)
  • organization (ASN + ISP name)
  • timezone (Time Zone)
  • offset (UTC time offset)

Output example

The dma, continent, and area code information is not available and thus not present in the output JSON object:

  "organization": "AS36692 OpenDNS, LLC",
  "city": "San Francisco",
  "region": "California",
  "dma_code": "0",
  "area_code": "0",
  "timezone": "America\/Los_Angeles",
  "offset": "-7",
  "longitude": -122.3933,
  "country_code3": "USA",
  "postal_code": "94107",
  "continent_code": "NA",
  "country": "United States",
  "region_code": "CA",
  "country_code": "US","latitude":37.7697