url-json-extract
PDF / doc URL + JSON schema → structured JSON. Paid via x402.
This is the live paid service for POST /v1/doc-extract.
Pass an HTTPS PDF URL and a JSON Schema; on success you get a schema-shaped JSON object.
No accounts. No Stripe.
$0.05 USDC per successful POST /v1/doc-extract
$0.001 cheap demo POST /v1/extract (HTML URL → schema)
Network: Base Sepolia (eip155:84532) for now · GET /health free
Try it (human)
Connect a browser wallet on Base Sepolia with testnet USDC, then pay and extract in one step.
MetaMask / injected window.ethereum required.
Result
Agent / curl
curl -sS -i -X POST https://url-json-extract-production.up.railway.app/v1/doc-extract \
-H 'content-type: application/json' \
-d '{"url":"https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/AmazonWebServices.pdf","schema":{"type":"object","properties":{"invoice_number":{"type":"string"},"date":{"type":"string"}},"required":["invoice_number","date"]}}'
Paid path (Node agent):
import { privateKeyToAccount } from "viem/accounts";
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(account));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const res = await fetchWithPayment(
"https://url-json-extract-production.up.railway.app/v1/doc-extract",
{
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify({ url: PDF_URL, schema: YOUR_SCHEMA })
}
);
console.log(res.status, await res.json());
Before / after
PDF text (snippet)
Invoice Number: 42183017 Date: August 3, 2014 Amazon Web Services…
→ schema JSON
{
"invoice_number": "42183017",
"date": "August 3 , 2014"
}
Links
GET /health— free livenessPOST /v1/doc-extract— live paid PDF → JSON ($0.05)POST /v1/extract— cheap demo HTML URL → JSON ($0.001)- Sample schemas: invoice · receipt · order
- x402 docs · repo / README