Copied to clipboard
Your IP Address
Loading...
IPv4
Location
Country
ISP
ASN
Timezone
Coordinates

Precise IP geolocation for modern applications

Get accurate location data from any IP address. City-level precision, real-time updates, and all lookups processed in-house for maximum privacy.

<40ms
Avg response time
100%
In-house processing
195
Countries covered
0
External API calls
REST API

Simple, private API

All lookups are processed locally using our own geolocation database. No data is sent to third parties.

GET /api/ Get the requesting client's IP info
cURL
curl "https://ipaddress.to/api/"
JavaScript
const res = await fetch('https://ipaddress.to/api/');
const data = await res.json();
console.log(data);
Python
import requests

data = requests.get('https://ipaddress.to/api/').json()
print(data)
PHP
$data = json_decode(
    file_get_contents('https://ipaddress.to/api/'),
    true
);
print_r($data);
C#
using var client = new HttpClient();
var json = await client.GetStringAsync("https://ipaddress.to/api/");
Console.WriteLine(json);
Go
resp, _ := http.Get("https://ipaddress.to/api/")
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
Ruby
require 'net/http'
require 'json'

data = JSON.parse(Net::HTTP.get(URI('https://ipaddress.to/api/')))
puts data
Java
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://ipaddress.to/api/")).build();
String body = client.send(req, BodyHandlers.ofString()).body();
System.out.println(body);
Perl
use LWP::Simple;
use JSON;

my $data = decode_json(get('https://ipaddress.to/api/'));
print $data->{ip};
Rust
let body = reqwest::get("https://ipaddress.to/api/")
    .await?.text().await?;
println!("{}", body);
Response
{
  "success": true,
  "ip": "203.45.167.89",
  "type": "IPv4",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "city": "San Francisco",
  "latitude": 37.7749,
  "longitude": -122.4194,
  "timezone": "America/Los_Angeles",
  "isp": "Cloudflare, Inc.",
  "asn": "AS13335"
}
GET /api/{address} Lookup a specific IP address
address required
string
IPv4 or IPv6 address as a URL path segment
Example
curl "https://ipaddress.to/api/8.8.8.8"
Response
{
  "success": true,
  "ip": "8.8.8.8",
  "type": "IPv4",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "city": "Mountain View",
  "latitude": 37.386,
  "longitude": -122.0838,
  "timezone": "America/Los_Angeles",
  "isp": "Google LLC",
  "asn": "AS15169"
}
POST /api/batch Lookup multiple IPs in one request (max 100)
Request Body
{
  "ips": ["8.8.8.8", "1.1.1.1", "9.9.9.9"],
  "fields": ["ip", "country", "city"]  // optional
}
Response
{
  "success": true,
  "count": 3,
  "results": [
    { "ip": "8.8.8.8", "country": "United States", "city": "Mountain View" },
    { "ip": "1.1.1.1", "country": "Australia", "city": "Sydney" },
    { "ip": "9.9.9.9", "country": "Switzerland", "city": "Zurich" }
  ]
}
GET /api/whois/{ip_or_domain} WHOIS lookup for IPs and domains
query required
string
IP address (v4/v6) or domain name to query
cURL
curl "https://ipaddress.to/api/whois/google.com"
JavaScript
const res = await fetch('https://ipaddress.to/api/whois/google.com');
const data = await res.json();
console.log(data.parsed.registrar); // "MarkMonitor Inc."
Python
import requests

data = requests.get('https://ipaddress.to/api/whois/google.com').json()
print(data['parsed']['registrar'])
PHP
$data = json_decode(
    file_get_contents('https://ipaddress.to/api/whois/google.com'),
    true
);
echo $data['parsed']['registrar'];
C#
using var client = new HttpClient();
var json = await client.GetStringAsync(
    "https://ipaddress.to/api/whois/google.com");
Console.WriteLine(json);
Go
resp, _ := http.Get("https://ipaddress.to/api/whois/google.com")
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
Perl
use LWP::Simple;
use JSON;

my $data = decode_json(get('https://ipaddress.to/api/whois/google.com'));
print $data->{parsed}{registrar};
Response (domain)
{
  "success": true,
  "query": "google.com",
  "type": "domain",
  "found": true,
  "parsed": {
    "domain_name": "google.com",
    "registrar": "MarkMonitor Inc.",
    "registrar_url": "http://www.markmonitor.com",
    "registrar_iana_id": "292",
    "whois_server": "whois.markmonitor.com",
    "creation_date": "1997-09-15T04:00:00Z",
    "expiry_date": "2028-09-14T04:00:00Z",
    "updated_date": "2019-09-09T15:39:04Z",
    "status": ["clientDeleteProhibited", "clientTransferProhibited"],
    "nameservers": ["ns1.google.com", "ns2.google.com"],
    "dnssec": "unsigned",
    "registrant_org": "Google LLC",
    "registrant_state": "CA",
    "registrant_country": "US",
    "registrant_email": "select request email form at...",
    "admin_org": "Google LLC",
    "admin_email": "select request email form at...",
    "tech_org": "Google LLC",
    "tech_email": "select request email form at...",
    "abuse_email": "[email protected]",
    "abuse_phone": "+1.2086851750"
  },
  "raw": "Domain Name: google.com\nRegistrar: ...",
  "duration_ms": 342
}
GET /api/hostname/{hostname} Resolve hostname to IP addresses
q required
string
Hostname to resolve (e.g., google.com)
cURL
curl "https://ipaddress.to/api/hostname/github.com"
JavaScript
const res = await fetch('https://ipaddress.to/api/hostname/github.com');
const data = await res.json();
console.log(data.a); // ["140.82.121.3"]
Python
import requests

data = requests.get('https://ipaddress.to/api/hostname/github.com').json()
for ip in data['a']:
    print(ip)
PHP
$data = json_decode(
    file_get_contents('https://ipaddress.to/api/hostname/github.com'),
    true
);
print_r($data['a']); // IPv4 addresses
C#
using var client = new HttpClient();
var json = await client.GetStringAsync(
    "https://ipaddress.to/api/hostname/github.com");
Console.WriteLine(json);
Go
resp, _ := http.Get("https://ipaddress.to/api/hostname/github.com")
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
Perl
use LWP::Simple;
use JSON;

my $data = decode_json(get('https://ipaddress.to/api/hostname/github.com'));
print join("\n", @{$data->{a}});
Response
{
  "success": true,
  "hostname": "github.com",
  "a": ["140.82.121.3"],
  "aaaa": [],
  "cname": [],
  "reverse": {
    "140.82.121.3": "lb-140-82-121-3-iad.github.com"
  },
  "total_ips": 1,
  "has_ipv4": true,
  "has_ipv6": false,
  "duration_ms": 87
}
Try it live

API Playground

Test all APIs directly in your browser.

Live Testing
Ready
// Click "Run Test" or a preset to make a request