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/lookup/my Get your own IP info
cURL
curl "https://ipaddress.to/api/lookup/my"
JavaScript
const res = await fetch('https://ipaddress.to/api/lookup/my');
const data = await res.json();
console.log(data);
Python
import requests

data = requests.get('https://ipaddress.to/api/lookup/my').json()
print(data)
PHP
$data = json_decode(
    file_get_contents('https://ipaddress.to/api/lookup/my'),
    true
);
print_r($data);
C#
using var client = new HttpClient();
var json = await client.GetStringAsync("https://ipaddress.to/api/lookup/my");
Console.WriteLine(json);
Go
resp, _ := http.Get("https://ipaddress.to/api/lookup/my")
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/lookup/my')))
puts data
Java
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://ipaddress.to/api/lookup/my")).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/lookup/my'));
print $data->{ip};
Rust
let body = reqwest::get("https://ipaddress.to/api/lookup/my")
    .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/lookup/{ip_or_hostname} Lookup an IP address or hostname
ip_or_hostname optional
string
IPv4/IPv6 address or hostname. Omit to get your own IP info.
Example
curl "https://ipaddress.to/api/lookup/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/lookup/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/RDAP lookup (subdomains auto-stripped to root domain)
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/dns/{type}/{domain} DNS propagation checker across 40 global servers
type required
string
DNS record type: A, AAAA, CNAME, MX, NS, TXT, SOA, PTR, SRV, CAA
domain required
string
Domain to query (e.g., google.com)
server optional
string
Query a single DNS server IP instead of all 40. Pass as query param: ?server=8.8.8.8
cURL
curl "https://ipaddress.to/api/dns/a/google.com"
JavaScript
const res = await fetch('https://ipaddress.to/api/dns/mx/google.com');
const reader = res.body.getReader();
// Streams NDJSON — one result per line per server
Python
import requests, json
r = requests.get('https://ipaddress.to/api/dns/ns/google.com', stream=True)
for line in r.iter_lines():
    print(json.loads(line))

Response is NDJSON (streaming). Each line is a JSON object: start, result (×40 servers), then done with propagation summary.

GET /api/resolve/{hostname} Resolve hostname to IP addresses
hostname required
string
Hostname to resolve (e.g., github.com)
cURL
curl "https://ipaddress.to/api/resolve/github.com"
JavaScript
const res = await fetch('https://ipaddress.to/api/resolve/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/resolve/github.com').json()
for ip in data['a']:
    print(ip)
PHP
$data = json_decode(
    file_get_contents('https://ipaddress.to/api/resolve/github.com'),
    true
);
print_r($data['a']); // IPv4 addresses
C#
using var client = new HttpClient();
var json = await client.GetStringAsync(
    "https://ipaddress.to/api/resolve/github.com");
Console.WriteLine(json);
Go
resp, _ := http.Get("https://ipaddress.to/api/resolve/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/resolve/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