Introduction
The WhatIP.ca API gives programmatic access to the same tools as the website: your own IP, IP geolocation, DNS, WHOIS, email authentication checks and IP blacklist checks. It is free, needs no account and no API key.
https://whatip.ca/api/v1
Features
- RESTful API: versioned endpoints (e.g.
POST /api/v1/geolocate) - JSON in / JSON out: send a JSON body, get a JSON response
- No authentication: no sign-up, no API key, no headers beyond
Content-Type - Free: every endpoint, rate limited per IP address
- OpenAPI: a machine-readable description at
GET /api/v1/openapi.json - MCP: the same tools for AI assistants at
https://whatip.ca/mcp
Try It Now
Test our IP geolocation API instantly:
Authentication
None. The API is open: there are no accounts and no API keys. Send requests with a JSON body and a Content-Type: application/json header.
Rate Limits
To keep the service free and available for everyone, requests are rate limited per client IP address. When you exceed the limit the API answers 429 Too Many Requests; wait a little and retry. Please cache results where you can and avoid bulk scanning (see the Acceptable Use Policy).
My IP
Returns the public IP address the request came from, with its geolocation.
curl https://whatip.ca/api/v1/myip
Response Fields
| Field | Type | Description |
|---|---|---|
ip | string | Your public IP address |
city.name | string | City name |
subdivisions[0].name | string | Region / province / state |
country.name, country.code | string | Country name and ISO code |
continent.name | string | Continent name |
location.latitude, location.longitude | float | Approximate coordinates |
location.time_zone | string | IANA time zone |
asn.autonomous_system_number | integer | ASN |
asn.autonomous_system_organization | string | Network owner |
traits.organization | string | Organization, when known |
IP Geolocation
Look up the country and network (ASN) of any IPv4 or IPv6 address.
| Field | Type | Required | Description |
|---|---|---|---|
ip | string | yes | IP address to look up |
curl -X POST https://whatip.ca/api/v1/geolocate \
-H "Content-Type: application/json" \
-d '{"ip": "8.8.8.8"}'
Response Fields
| Field | Type | Description |
|---|---|---|
country.name | string | Country name |
country.code | string | ISO country code |
asn.autonomous_system_number | integer | ASN |
asn.autonomous_system_organization | string | Network owner |
DNS Lookup
Query DNS records for a domain.
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | yes | Domain name |
type | string | no | Record type: A (default), AAAA, MX, TXT, CNAME, NS, SOA |
curl -X POST https://whatip.ca/api/v1/dns/lookup \
-H "Content-Type: application/json" \
-d '{"domain": "google.com", "type": "A"}'
Reverse DNS
Find the hostname (PTR record) for an IP address.
| Field | Type | Required | Description |
|---|---|---|---|
ip | string | yes | IP address |
curl -X POST https://whatip.ca/api/v1/dns/reverse \
-H "Content-Type: application/json" \
-d '{"ip": "8.8.8.8"}'
WHOIS
Registration data for a domain or an IP network, fetched over RDAP. Send either domain or ip.
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | one of | Domain name |
ip | string | one of | IP address |
curl -X POST https://whatip.ca/api/v1/whois \
-H "Content-Type: application/json" \
-d '{"domain": "example.com"}'
Email Checks
Check the DNS records that decide whether a domain's mail is delivered. All endpoints take a domain.
| Endpoint | Fields | Description |
|---|---|---|
/email/mx | domain | MX records |
/email/spf | domain | SPF record and validation |
/email/dkim | domain, selector (optional) | DKIM public key for a selector |
/email/dmarc | domain | DMARC policy |
/email/deliverability | domain | MX, SPF, DKIM and DMARC together, with a deliverability score |
curl -X POST https://whatip.ca/api/v1/email/deliverability \
-H "Content-Type: application/json" \
-d '{"domain": "example.com"}'
Blacklist Check
Check an IP address against DNS-based blacklists (DNSBLs).
| Field | Type | Required | Description |
|---|---|---|---|
ip | string | yes | IP address |
curl -X POST https://whatip.ca/api/v1/security/blacklist \
-H "Content-Type: application/json" \
-d '{"ip": "8.8.8.8"}'
OpenAPI
A machine-readable OpenAPI description of every endpoint, for code generators and API clients.
curl https://whatip.ca/api/v1/openapi.json
MCP Server
WhatIP.ca also speaks the Model Context Protocol, so AI assistants and agents can call the same tools directly. Add this URL as a remote MCP server in any MCP-capable client. No key is needed.
https://whatip.ca/mcp
Error Codes
The API uses standard HTTP status codes:
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad Request: missing or invalid parameters |
404 | Not Found: no such endpoint |
429 | Too Many Requests: per-IP rate limit exceeded |
500 | Internal Server Error |
Code Examples
Python
import requests
# IP geolocation lookup
response = requests.post(
'https://whatip.ca/api/v1/geolocate',
json={'ip': '8.8.8.8'}
)
data = response.json()
print(f"Country: {data['country']['name']}")
print(f"ASN: {data.get('asn', {}).get('autonomous_system_organization')}")
JavaScript
async function getGeoLocation(ip) {
const res = await fetch('https://whatip.ca/api/v1/geolocate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ip })
});
const data = await res.json();
console.log(`Country: ${data.country.name}`);
console.log(`ASN: ${data.asn?.autonomous_system_organization}`);
}
getGeoLocation('8.8.8.8');
Need Help? Contact us or visit our Support page.