ASN + IP geolocation
POST /api/asn-infoLook up the Autonomous System (ASN), prefix, country, registry, and allocation date for an IPv4 address - or for a hostname (which is resolved first). Send POST /api/asn-info with no required fields (2 optional) and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with ip, asn, owner, prefix, country and 3 more.
Uses Team Cymru's free DNS-based IP→ASN mapping; no HTTPS upstream, no auth, no rate-limit headaches.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ip | string | no | IPv4 address to look up (mutually exclusive with host) |
host | string | no | Hostname to resolve first (also accepts hostname/domain/url/email) |
Example request
curl -i -X POST https://agent402.tools/api/asn-info \
-H "Content-Type: application/json" \
-d '{"ip":"8.8.8.8"}'
Without payment this returns HTTP 402 Payment Required with the exact price for asn-info; any x402 v2 or MPP client pays it and retries.
Example response
{
"ip": "8.8.8.8",
"asn": "AS15169",
"owner": "GOOGLE",
"prefix": "8.8.8.0/24",
"country": "US",
"registry": "arin",
"allocationDate": "1992-12-01",
"queriedAt": "2026-06-19T22:00:00.000Z"
}
| Field | Type | Always present | In the example |
|---|---|---|---|
ip | string | yes | 8.8.8.8 |
asn | string | yes | AS15169 |
owner | string | yes | |
prefix | string | yes | 8.8.8.0/24 |
country | string | yes | US |
registry | string | yes | arin |
allocationDate | string | yes | 1992-12-01 |
queriedAt | string | yes | 2026-06-19T22:00:00.000Z |
From an MCP client
catalog.call {
"slug": "asn-info",
"params": {
"ip": "8.8.8.8"
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for asn-info; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/asn-info returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/asn-info", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"ip": "8.8.8.8"
}),
});
Part of these workflows
ASN + IP geolocation is one step in these 2 skill packs, each sold as a single call:
- DNS & network ops - End-to-end DNS health check: records, multi-resolver propagation, WHOIS, ASN, robots.txt, and reachability.
- Fraud signals - Is this domain trustworthy, or is it a phishing site / typosquat / scam? Pull the reputation signals an analyst checks before clicking anything: domain age, cert issuance history, hosting reputation, DNS topology, tech-stack fingerprint, and page-content red flags. Different from a security audit - this is about whether the domain is what it claims to be.
Related tools
Certificate transparency search
POST /api/cert-transparencySearch public Certificate Transparency logs for every cert issued to a domain. Two independent public CT search services…
DNS lookup
POST /api/dns-lookupResolve any DNS record type for a host: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR. Returns the records plus a coun…
DNS propagation check
POST /api/dns-propagationResolve the same DNS record against 4 public resolvers (Google, Cloudflare, Quad9, OpenDNS) in parallel; surface diverge…
Gravatar existence check
POST /api/gravatar-checkCheck whether an email address has a Gravatar: hashes the normalized email (MD5, pure CPU - the raw address is never sen…
HTTP headers + security analysis
POST /api/http-headersFetch a URL and return every response header plus a security analysis: HSTS, CSP, X-Frame-Options, X-Content-Type-Option…
Tech stack detection
POST /api/tech-stackDetect the technology stack of a public website: CDN, web server, language/runtime, frontend framework (Next.js, Nuxt, S…