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
| Name | Type | Description |
|---|---|---|
| url | string | URL to extract from (use this or text). |
| text | string | Text to extract from, up to 40000 characters. |
| fields | object | Simple alternative to schema: a list of field names, or an object of field name to type/description. |
| schema | object | A JSON schema for the output object. |
| instructions | string | Optional 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
Web page to markdown$0.003
Turn any URL (HTML, PDF, Office docs) into clean markdown an agent can read.
Website screenshot$0.01
A PNG screenshot of any web page, rendered in a real browser.
Summarize text or a URL$0.005
A faithful short, medium or long summary of any text or web page.
Translate text$0.003
Translate text into any language, keeping formatting and tone.
Generate an image$0.02
Text-to-image with FLUX.1 schnell, returned in seconds.
Base wallet lookup$0.002
ETH, USDC and any ERC-20 balances for an address on Base, live from the chain.