x402AgentTools

๐ŸŒIP Geolocation (Live)

Geolocate any IPv4/IPv6 address (or the caller's own IP when omitted) via ipwho.is: country, region, city, coordinates, timezone, ASN/network owner and currency. Cached 24 hours per IP.

Worked examples

Google DNS

GET /api/v1/live/ip-lookup?ip=8.8.8.8

Result: 8.8.8.8 โ€” San Jose, California, United States

Cloudflare DNS

GET /api/v1/live/ip-lookup?ip=1.1.1.1

Result: 1.1.1.1 โ€” Brisbane, Queensland, Australia

IPv6 example

GET /api/v1/live/ip-lookup?ip=2606%3A4700%3A4700%3A%3A1111

Result: 2606:4700:4700::1111 โ€” San Francisco, California, United States

Machine API (x402)

$0.002 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol โ€” no accounts, no API keys.

GET /api/v1/live/ip-lookup?ip=8.8.8.8 HTTP/1.1
Host: agenttools-hub.vercel.app

โ†’ 402 (payment required, instructions in headers)
โ†’ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "live/ip-lookup",
  "input": {"ip":"8.8.8.8"},
  "result": { "value": null, "answer": "8.8.8.8 โ€” San Jose, California, United States" }
}

Agent docs: /llms.txt ยท OpenAPI spec ยท integration guide

About this tool

Geolocate any IP address: country, region, city, coordinates, time zone, ASN/network owner and currency. Omitting the `ip` parameter looks up the caller's own address โ€” handy for personalizing agent responses.

Frequently asked questions

How accurate is IP geolocation?

Country-level is ~99% accurate; city-level is approximate (often the ISP hub, ยฑ50 km). Good enough for personalization, never for safety-critical decisions.

What happens for private IPs like 192.168.x.x?

Reserved and private ranges can't be geolocated; the API returns a clear error explaining this.

Related tools