code

API Documentation

Integrate IP geolocation, DNS lookup, and network tools into your applications with our RESTful API.

rocket_launch Introduction

Welcome to the WhatIP.ca API! Our API provides programmatic access to all IP tools, network diagnostics, and geolocation services.

link Base URL: https://whatip.ca/api/v1

Features

  • RESTful API — clean, versioned endpoints (e.g. POST /api/v1/geolocate)
  • JSON in / JSON out — easy to parse and integrate
  • API-key authAuthorization: Bearer wip_…
  • Free to start — sign up for a key, 30 calls/day, plus 10 free trial uses of premium tools
  • Paid plans — Starter $5/mo (1,000/day) · Pro $19/mo (10,000/day)

play_arrow Try It Now

Test our IP geolocation API instantly:

// Response will appear here

key Authentication

Every API request needs an API key, sent as a Bearer token. Keys look like wip_….

Getting a key

  1. Create a free account.
  2. Open API Keys and generate a key — it's shown once, so copy it.
  3. Send it on every request as Authorization: Bearer wip_….

A free key includes 30 calls/day and a one-time pool of 10 free uses of premium tools so you can trial them before upgrading. The website's own tools work without a key; the programmatic API always requires one.

Using your key

cURL
curl -X POST https://whatip.ca/api/v1/geolocate \
  -H "Authorization: Bearer wip_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8"}'

speed Plans & rate limits

Quotas are counted as API calls. Limits are returned on every response in the X-RateLimit-* headers.

Plan Price Calls/day Burst Tools
Free $0 30 5/min Core lookups + 10 trial uses of premium tools
Starter $5/mo 1,000 60/min + WHOIS, DNS-all, ping/traceroute, reputation, host-intel, sentry
Pro $19/mo 10,000 240/min + port scan, threat-intel, SMTP/TLS, live host scan, sentry monitoring
info

Calling a tool above your plan uses your 10-use trial pool; once spent it returns 402 payment_required. Exceeding your quota returns 429 with Retry-After. The homepage "what is my IP" lookup is always free and never counted.

location_on IP Geolocation

Lookup geolocation data for any IP address using MaxMind GeoIP2.

POST /api/v1/geolocate
Request
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
city.name string City name
location.latitude float Latitude coordinate
location.longitude float Longitude coordinate

dns DNS Lookup

Query DNS records for any domain (A, AAAA, MX, TXT, NS, SOA, etc.)

POST /api/v1/dns/lookup
Request
curl -X POST https://whatip.ca/api/v1/dns/lookup \
  -H "Content-Type: application/json" \
  -d '{"domain": "google.com", "type": "A"}'

security Blacklist Check

Check IP addresses against 100+ blacklists and reputation databases.

POST /api/v1/security/blacklist
Request
curl -X POST https://whatip.ca/api/v1/security/blacklist \
  -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8"}'

person Auth Endpoints

Login

POST /auth/login
JavaScript
const response = await fetch('https://whatip.ca/api/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: 'john@example.com',
    password: 'SecurePass123'
  })
});

const data = await response.json();
console.log(data.token); // Save this token

Get Current User

GET /auth/me

Returns authenticated user's profile and subscription details.

Logout

POST /auth/logout

Revokes the current API token.

error Error Codes

The API uses standard HTTP status codes:

Code Meaning
200Success
400Bad Request — Invalid parameters
401Unauthorized — missing or invalid API key
402Payment Required — tool needs a paid plan and your 10-use trial is spent
403Forbidden — your key's plan can't access this tool
404Not Found — no such endpoint
429Too Many Requests — rate limit / daily quota exceeded (see Retry-After)
500Internal Server Error

terminal Code Examples

Python

Python
import requests

# IP Geolocation lookup
response = requests.post(
    'https://whatip.ca/api/v1/geolocate',
    headers={'Authorization': 'Bearer wip_your_key_here'},
    json={'ip': '8.8.8.8'}
)

data = response.json()
print(f"Country: {data['country']['name']}")
print(f"City: {data.get('city', {}).get('name')}")

Node.js

JavaScript
const axios = require('axios');

async function getGeoLocation(ip) {
  const { data } = await axios.post(
    'https://whatip.ca/api/v1/geolocate',
    { ip },
    { headers: { Authorization: 'Bearer wip_your_key_here' } }
  );

  console.log(`Country: ${data.country.name}`);
  console.log(`City: ${data.city.name}`);
}

getGeoLocation('8.8.8.8');
help

Need Help? Contact us at support@whatip.ca or visit our Support page.