ipify map

Получи IP без риска

Не надо ждать, быстро и без регистрации, всё открыто!

IPv4
$ curl 'https://findip2.herokuapp.com/ip.json'
{"ip":"185.103.110.182"}

Почему FullIP?

Вы считали получение IP сложным и странным занятием?
Теперь это всё открыто и бесплатно, а нужна только инструкция, и код для получения чистого IP или GEO

Плюсы использования FullIP:

1

Вы не ограниченны, и легко можете получать IP хоть каждую секунду.

2

Мы работаем с IPv4 адресами, что делает вероятность ошибок минимальной.

3

Мы онлайн, и при возникновении ошибок готовы помочь!

4

FullIP открыт всем (посмотрите этот GitHub репозиторий).

5

Никто не узнает о ваших посещениях, так как всё анонимно.

6

И последнее, FullIP не замедлит ваш сайт(программу).

API FullIP:

Использование FullIP может быть в формате JS, JSON, JSONP и просто text.

IPv4

API URL Response Type Sample Output (IPv4)
https://findip2.herokuapp.com/ip text 98.207.254.136
https://findip2.herokuapp.com/ip.json json {"ip":"98.207.254.136"}
https://findip2.herokuapp.com/ip.jsonp jsonp callback({"ip":"98.207.254.136"});
https://findip2.herokuapp.com/getip.jsonp jsonp getip({"ip":"98.207.254.136"});
https://findip2.herokuapp.com/ip.js js let ip = "98.207.254.136";

Использование в коде:

Тут описано использование кода через разные языки

Bash

#!/bin/bash

ip=$(curl -s https://findip2.herokuapp.com/ip)
echo "My public IP address is: $ip"

NGS (Next Generation Shell)

ip=`curl -s https://findip2.herokuapp.com/ip`
echo("My public IP address is: $ip")

Python

# This example requires the requests library be installed.  You can learn more
# about the Requests library here: http://docs.python-requests.org/en/latest/
from requests import get

ip = get('https://findip2.herokuapp.com/ip').text
print('My public IP address is: {}'.format(ip))

Ruby

require "net/http"

ip = Net::HTTP.get(URI("https://findip2.herokuapp.com/ip"))
puts "My public IP Address is: " + ip

PHP

<?php
    $ip = file_get_contents('https://findip2.herokuapp.com/ip');
    echo "My public IP address is: " . $ip;
?>

Java

try (java.util.Scanner s = new java.util.Scanner(new java.net.URL("https://findip2.herokuapp.com/ip").openStream(), "UTF-8").useDelimiter("\\A")) {
    System.out.println("My current IP address is " + s.next());
} catch (java.io.IOException e) {
    e.printStackTrace();
}

Perl

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

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

C#

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

VB.NET

Dim httpClient As New System.Net.Http.HttpClient
Dim ip As String = Await httpClient.GetStringAsync("https://findip2.herokuapp.com/ip")
Console.WriteLine($"My public IP address is: {ip}")

NodeJS

var http = require('http');

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

Go

package main

import (
        "io/ioutil"
        "net/http"
        "os"
)

func main() {
        res, _ := http.Get("https://findip2.herokuapp.com/ip")
        ip, _ := ioutil.ReadAll(res.Body)
        os.Stdout.Write(ip)
}

Racket

(require net/url)

(define ip (port->string (get-pure-port (string->url "https://findip2.herokuapp.com/ip"))))
(printf "My public IP address is: ~a" ip)

Lisp

;This example requires the drakma http package installed.
;It can be found here: http://www.weitz.de/drakma

(let ((stream
    (drakma:http-request "https://findip2.herokuapp.com/ip" :want-stream t)))
  (let ((public-ip (read-line stream)))
    (format t "My public IP address is: ~A" public-ip)))

Xojo

Dim s As New HTTPSecureSocket
Dim t As String = s.Get("https://findip2.herokuapp.com/ip",10)
MsgBox "My public IP Address is: " + t

Scala

val addr = scala.io.Source.fromURL("https://findip2.herokuapp.com/ip").mkString
println(s"My public IP address is: $addr")

Javascript

<script type="application/javascript" src="https://findip2.herokuapp.com/ip.js"></script>
        
<script type="application/javascript">alert(ip);</script>

jQuery

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

C#

using System;
using System.Net;

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

Elixir

:inets.start
{:ok, {_, _, inet_addr}} = :httpc.request('http://findip2.herokuapp.com/ip')
:inets.stop

nim

import HttpClient
var ip = newHttpClient().getContent("https://findip2.herokuapp.com/ip")
echo("My public IP address is: ", ip)

PowerShell

$ip = Invoke-RestMethod -Uri 'https://findip2.herokuapp.com/ip.json'
"My public IP address is: $($ip.ip)"

Lua

http.Fetch("https://findip2.herokuapp.com/ip", function(body) print("My ip is: " .. body ) end

PureBasic

InitNetwork()
*Buffer = ReceiveHTTPMemory("https://findip2.herokuapp.com/ip.jsonn")
If *Buffer
  ParseJSON(0, PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8))
  FreeMemory(*Buffer)
  Debug GetJSONString(GetJSONMember(JSONValue(0), "ip"))
EndIf

LiveCode

put "My public IP address is" && url "https://findip2.herokuapp.com/ip"

Objective-C

NSURL *url = [NSURL URLWithString:@"https://findip2.herokuapp.com/ip"];
NSString *ipAddress = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
NSLog(@"My public IP address is: %@", ipAddress);

Swift

import Foundation

let url = URL(string: "https://findip2.herokuapp.com/ip")

do {
    if let url = url {
        let ipAddress = try String(contentsOf: url)
        print("My public IP address is: " + ipAddress)
    }
} catch let error {
    print(error)
}

Arduino

if (client.connect("findip2.herokuapp.com", 80)) {
    Serial.println("connected");
    client.println("GET / HTTP/1.0");
    client.println("Host: findip2.herokuapp.com");
    client.println();
} else {
    Serial.println("connection failed");
}

GEO

Это тестовая функция, и доступна пока только в формате JS и JSON:

API URL Response Type Sample Output (IPv4)
https://findip2.herokuapp.com/geo json {"ip": "98.207.254.136", "aso": "COMCAST-7922", "asn": "7922", "iso_code": "US", "continent_code": "NA", "country": "United States", "continent": "North America", "zip_code": "94015", "state": "California", "state_code": "CA", "city": "Daly City", "latitude": 37.6811, "longitude": -122.4806}
https://findip2.herokuapp.com/geo.js js let ip = '98.207.254.136'; let geocity = 'Daly City'; let geocountry = 'United States';