Tools / AI

Extract structured data

Give it a URL or text plus either a JSON schema or a simple list of field names, and it returns JSON that matches. Good for turning product pages, job posts, invoices, articles or profiles into structured records. Missing values come back as null instead of being made up.

Price per call
$0.01 USDC
Endpoint
POST https://x402-tools.com/v1/extract
Also accepts
GET with query parameters
Payment
x402, exact scheme, USDC on Base
Returns
application/json

Parameters

NameTypeDescription
urlstringURL to extract from (use this or text).
textstringText to extract from, up to 40000 characters.
fieldsobjectSimple alternative to schema: a list of field names, or an object of field name to type/description.
schemaobjectA JSON schema for the output object.
instructionsstringOptional extra guidance, e.g. 'prices in EUR'.

Call it from an agent

import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const paidFetch = wrapFetchWithPayment(fetch, account);

const res = await paidFetch("https://x402-tools.com/v1/extract", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "url": "https://example.com/product/123",
    "fields": {
      "title": "string",
      "price": "number",
      "in_stock": "boolean"
    }
  }),
});
// costs $0.01 in USDC on Base

Without a payment the endpoint answers 402 with the price, so you can inspect it first:

curl -i -X POST "https://x402-tools.com/v1/extract" -H "content-type: application/json" -d '{"url":"https://example.com/product/123","fields":{"title":"string","price":"number","in_stock":"boolean"}}'

Example response

{
  "data": {
    "title": "Acme Anvil",
    "price": 49.99,
    "in_stock": true
  },
  "source": "https://example.com/product/123",
  "input_characters": 8123
}

If the tool fails or your input is invalid, the payment is not settled.

Other tools