IP info

$0.002 per call · USDC via x402 · POST /api/ip-info

Classify an IP address: version, public/private/loopback/link-local, integer form, and reverse-DNS (PTR) lookup. Send POST /api/ip-info with the required field ip and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with ip, version, scope and ptr.

Category: Validation & parsing · Tags: ip network ptr reverse-dns

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
ipstringyesIPv4 or IPv6 address

Example request

curl -i -X POST https://agent402.tools/api/ip-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 ip-info; any x402 v2 or MPP client pays it and retries.

Example response

{
  "ip": "8.8.8.8",
  "version": 4,
  "scope": "public",
  "ptr": [
    "dns.google"
  ]
}
FieldTypeAlways presentIn the example
ipstringyes8.8.8.8
versionnumberyes4
scopestringyespublic
ptrarray of stringyes1 item in the example

From an MCP client

catalog.call {
  "slug": "ip-info",
  "params": {
    "ip": "8.8.8.8"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for ip-info; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

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/ip-info", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "ip": "8.8.8.8"
  }),
});

Related tools

CIDR calculator

FREE w/ compute · or $0.001 · POST /api/cidr

Parse an IPv4 CIDR block: network address, broadcast, first/last host, netmask, and host count. Optionally test if an IP…

Card number validate

FREE w/ compute · or $0.001 · POST /api/card-validate

Validate a payment card number (Luhn checksum) and detect the brand. Numbers are not stored or logged.

Color convert

FREE w/ compute · or $0.001 · POST /api/color

Convert a color between hex, RGB, and HSL. Accepts "#1a2b3c", "rgb(26,43,60)", or "hsl(210,40%,17%)".

CSV lint

FREE w/ compute · or $0.001 · POST /api/csv-lint

Validate CSV structure: consistent column counts across rows, properly closed quotes, delimiter detection. Returns row/c…

Email validate

$0.001 · POST /api/email-validate

Validate an email address: syntax check plus live MX record lookup on the domain (deliverability signal, not a guarantee…

IBAN validate

FREE w/ compute · or $0.001 · POST /api/iban-validate

Validate an IBAN: country code, length, and the ISO 13616 mod-97 checksum.