$ curl 'https://findip2.herokuapp.com/ip.json'
{"ip":"185.103.110.182"}
Вы считали получение IP сложным и странным занятием?
Теперь это всё открыто и бесплатно, а нужна только инструкция, и код
для получения чистого IP или GEO
Вы не ограниченны, и легко можете получать IP хоть каждую секунду.
Мы работаем с IPv4 адресами, что делает вероятность ошибок минимальной.
Мы онлайн, и при возникновении ошибок готовы помочь!
FullIP открыт всем (посмотрите этот GitHub репозиторий).
Никто не узнает о ваших посещениях, так как всё анонимно.
И последнее, FullIP не замедлит ваш сайт(программу).
Использование FullIP может быть в формате JS, JSON, JSONP и просто text.
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"; |
Тут описано использование кода через разные языки
#!/bin/bash
ip=$(curl -s https://findip2.herokuapp.com/ip)
echo "My public IP address is: $ip"
ip=`curl -s https://findip2.herokuapp.com/ip`
echo("My public IP address is: $ip")
# 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))
require "net/http"
ip = Net::HTTP.get(URI("https://findip2.herokuapp.com/ip"))
puts "My public IP Address is: " + ip
<?php
$ip = file_get_contents('https://findip2.herokuapp.com/ip');
echo "My public IP address is: " . $ip;
?>
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();
}
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;
var httpClient = new HttpClient();
var ip = await httpClient.GetStringAsync("https://findip2.herokuapp.com/ip");
Console.WriteLine($"My public IP address is: {ip}");
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}")
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);
});
});
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)
}
(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)
;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)))
Dim s As New HTTPSecureSocket
Dim t As String = s.Get("https://findip2.herokuapp.com/ip",10)
MsgBox "My public IP Address is: " + t
val addr = scala.io.Source.fromURL("https://findip2.herokuapp.com/ip").mkString
println(s"My public IP address is: $addr")
<script type="application/javascript" src="https://findip2.herokuapp.com/ip.js"></script>
<script type="application/javascript">alert(ip);</script>
<script type="application/javascript">
$(function() {
$.getJSON("https://findip2.herokuapp.com/ip.json",
function(json) {
document.write("My public IP address is: ", json.ip);
}
);
});
</script>
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);
}
}
}
:inets.start
{:ok, {_, _, inet_addr}} = :httpc.request('http://findip2.herokuapp.com/ip')
:inets.stop
import HttpClient
var ip = newHttpClient().getContent("https://findip2.herokuapp.com/ip")
echo("My public IP address is: ", ip)
$ip = Invoke-RestMethod -Uri 'https://findip2.herokuapp.com/ip.json'
"My public IP address is: $($ip.ip)"
http.Fetch("https://findip2.herokuapp.com/ip", function(body) print("My ip is: " .. body ) end
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
put "My public IP address is" && url "https://findip2.herokuapp.com/ip"
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);
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)
}
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");
}
Это тестовая функция, и доступна пока только в формате 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'; |