POST · JSON API
PDF-to-JSON Converter
Extract normalized pages, paragraphs, tables, sections, and geometry from a supplied PDF.
$0.760 USD / request
Not covered by the initial $0.050 grant. This quote requires full payment; there is no partial credit-plus-payment split.
Trial access and limits
Try eligible APIs with free service credit. Each verified EVM externally owned wallet receives $0.050 once, shared across APIs with no expiry. No deposit, payment, on-chain transaction, API key, or registration is required. Wallet sign-in (SIWX) is required; contract wallets are not supported. Credit is nontransferable. Execution requires sufficient credit, daily trial budget, and API availability.
Not covered by the initial $0.050 grant. This quote requires full payment; there is no partial credit-plus-payment split.
No free execution is promised for this API. Check its availability and quote before choosing access. An unaffordable quote requires a separate, fully paid request; there is no partial credit-plus-payment split.
Trial-only protocol reference (stops without paying)
// Node.js 22+ ES module. Use an existing EOA key locally; never send it to the seller.
// npm init -y && npm pkg set type=module && npm install @x402/extensions viem
import { privateKeyToAccount } from "viem/accounts";
const privateKey = process.env.TRIAL_PRIVATE_KEY;
if (!/^0x[0-9a-fA-F]{64}$/.test(privateKey ?? "")) throw new Error("Set an existing EOA's TRIAL_PRIVATE_KEY locally.");
const existingSigner = privateKeyToAccount(privateKey);
// npm install @x402/extensions
// existingSigner is your EVM EOA signer with address and signMessage({ message }).
// Use plain fetch, never a payment-wrapped fetch, for trial-only access.
import { wrapFetchWithSIWx } from "@x402/extensions/sign-in-with-x";
const trialFetch = wrapFetchWithSIWx(fetch, existingSigner);
const response = await trialFetch("https://manyfish-seller.redcliff-d7368db1.westus2.azurecontainerapps.io/api/v1/content/pdf-to-json", {
method: "POST",
headers: { "content-type": "application/json", accept: "application/json" },
body: JSON.stringify({
"pdfBase64": "JVBERi0xLjQKJcTl8uXrCg==",
"pages": "1-5",
"locale": "en-US"
}),
redirect: "error",
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`Trial stopped: HTTP ${response.status}. Do not automatically retry or pay.`);
if (response.headers.get("x-access-mode") !== "trial" ||
response.headers.get("x-trial-status") !== "charged" ||
response.headers.get("x-trial-accounting-status") !== "confirmed" ||
response.headers.has("payment-response") || response.headers.has("x-payment-response")) {
throw new Error("Trial accounting is unconfirmed. Do not repeat this request or pay.");
}
console.log(await response.json());
// No payment signer, paid fallback, or application retry loop is installed.
Manual authentication protocol
A valid request without payment headers can discover a SIWX challenge. Sign once and resend the identical URL, method, and body with SIGN-IN-WITH-X. Empty requests only discover the API. The canonical challenge is in the PAYMENT-REQUIRED header, not a cached directory entry.
Ready for continued use? Set up explicit paid API calls at the listed price. This quickstart never falls back to payment.
Continue with paid API calls
$0.760 per request, paid in USDC on Base. Use the same API URL and JSON body. Payment is an explicit choice in your own client; this page never pays.
- Prepare your existing EVM payment signer with USDC on the network above.
- Install
@x402/fetchand@x402/evmin your Node.js ES module project. - Review the price cap below and replace the example body with your input before running.
Show a paid integration example
// Explicit paid usage. existingPaymentSigner must support address and signTypedData.
// It must hold USDC on the configured network. This code authorizes a payment.
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
const paidFetch = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(existingPaymentSigner) }],
paymentRequirementsSelector(version, accepts) {
const quote = version === 2 && accepts.find((item) =>
item.scheme === "exact" && item.network === "eip155:8453" &&
item.asset.toLowerCase() === "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" &&
item.payTo.toLowerCase() === "0x9cd3f0d8a73a9a87f752f09d220652dc7de398cc" &&
/^[0-9]+$/.test(item.amount) && BigInt(item.amount) > 0n &&
BigInt(item.amount) <= 760000n);
if (!quote) throw new Error("No payment quote within the displayed price and network.");
return quote;
},
});
const response = await paidFetch("https://manyfish-seller.redcliff-d7368db1.westus2.azurecontainerapps.io/api/v1/content/pdf-to-json", {
method: "POST", redirect: "error",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"pdfBase64": "JVBERi0xLjQKJcTl8uXrCg==",
"pages": "1-5",
"locale": "en-US"
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}. Inspect before retrying.`);
console.log(await response.json());Keep your application's spending limits in place for repeated calls. After an uncertain trial result, resolve its status before issuing another request.
Inspect access requirements (returns 402)
POST /api/v1/content/pdf-to-json
Send the documented JSON body. Invalid input is rejected before payment or upstream execution. An empty request does not execute the API.
This curl example only inspects access requirements. It sends no payment or wallet proof and does not return a business result. HTTP 402 is expected. A paid call requires an explicit x402 payment using a compatible client.
Replace sample inputs with your data. Encoded file samples illustrate the JSON format and may not be complete usable files.
curl --request 'POST' 'https://manyfish-seller.redcliff-d7368db1.westus2.azurecontainerapps.io/api/v1/content/pdf-to-json' \
--header 'Content-Type: application/json' \
--data-raw '{
"pdfBase64": "JVBERi0xLjQKJcTl8uXrCg==",
"pages": "1-5",
"locale": "en-US"
}'
Illustrative response · Not live data
This is a synthetic contract example, not a live result. Actual results depend on the submitted input and upstream availability.
{
"content": "Example document text.",
"contentCharacters": 22,
"pageCount": 1,
"processedPages": [
1
],
"pages": [
{
"pageNumber": 1,
"lines": [],
"selectionMarks": []
}
],
"paragraphs": [],
"tables": [],
"sections": []
}
Schemas & documentation
These schemas come from the same API descriptor used for validation and discovery. Read the complete OpenAPI contract for responses, errors, and access requirements.
Request JSON Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"pdfBase64"
],
"properties": {
"pdfBase64": {
"type": "string",
"minLength": 8,
"maxLength": 13981016,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
},
"pages": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"pattern": "^[1-9]\\d*(?:-[1-9]\\d*)?(?:,[1-9]\\d*(?:-[1-9]\\d*)?)*$"
},
"locale": {
"type": "string",
"minLength": 2,
"maxLength": 32,
"pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"
}
}
}Response JSON Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"content",
"contentCharacters",
"pageCount",
"processedPages",
"pages",
"paragraphs",
"tables",
"sections"
],
"properties": {
"content": {
"type": "string"
},
"contentCharacters": {
"type": "integer",
"minimum": 0
},
"pageCount": {
"type": "integer",
"minimum": 0
},
"processedPages": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
}
},
"pages": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"pageNumber",
"lines",
"selectionMarks"
],
"properties": {
"pageNumber": {
"type": "integer",
"minimum": 1
},
"angle": {
"type": "number"
},
"width": {
"type": "number",
"minimum": 0
},
"height": {
"type": "number",
"minimum": 0
},
"unit": {
"enum": [
"pixel",
"inch"
]
},
"lines": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"content",
"spans"
],
"properties": {
"content": {
"type": "string"
},
"polygon": {
"type": "array",
"items": {
"type": "number"
}
},
"spans": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"offset",
"length"
],
"properties": {
"offset": {
"type": "integer",
"minimum": 0
},
"length": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
},
"selectionMarks": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"state",
"confidence",
"span"
],
"properties": {
"state": {
"enum": [
"selected",
"unselected"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"polygon": {
"type": "array",
"items": {
"type": "number"
}
},
"span": {
"type": "object",
"additionalProperties": false,
"required": [
"offset",
"length"
],
"properties": {
"offset": {
"type": "integer",
"minimum": 0
},
"length": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
}
}
},
"paragraphs": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"content",
"boundingRegions",
"spans"
],
"properties": {
"role": {
"type": "string"
},
"content": {
"type": "string"
},
"boundingRegions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"pageNumber"
],
"properties": {
"pageNumber": {
"type": "integer",
"minimum": 1
},
"polygon": {
"type": "array",
"items": {
"type": "number"
}
}
}
}
},
"spans": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"offset",
"length"
],
"properties": {
"offset": {
"type": "integer",
"minimum": 0
},
"length": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
},
"tables": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"rowCount",
"columnCount",
"boundingRegions",
"cells"
],
"properties": {
"rowCount": {
"type": "integer",
"minimum": 1
},
"columnCount": {
"type": "integer",
"minimum": 1
},
"boundingRegions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"pageNumber"
],
"properties": {
"pageNumber": {
"type": "integer",
"minimum": 1
},
"polygon": {
"type": "array",
"items": {
"type": "number"
}
}
}
}
},
"cells": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"rowIndex",
"columnIndex",
"content",
"boundingRegions",
"spans"
],
"properties": {
"kind": {
"type": "string"
},
"rowIndex": {
"type": "integer",
"minimum": 0
},
"columnIndex": {
"type": "integer",
"minimum": 0
},
"rowSpan": {
"type": "integer",
"minimum": 1
},
"columnSpan": {
"type": "integer",
"minimum": 1
},
"content": {
"type": "string"
},
"boundingRegions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"pageNumber"
],
"properties": {
"pageNumber": {
"type": "integer",
"minimum": 1
},
"polygon": {
"type": "array",
"items": {
"type": "number"
}
}
}
}
},
"spans": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"offset",
"length"
],
"properties": {
"offset": {
"type": "integer",
"minimum": 0
},
"length": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
}
}
}
},
"sections": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"spans",
"elements"
],
"properties": {
"spans": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"offset",
"length"
],
"properties": {
"offset": {
"type": "integer",
"minimum": 0
},
"length": {
"type": "integer",
"minimum": 0
}
}
}
},
"elements": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}How your submitted data is used
Quality review is enabled: executed paid and trial request/response bodies, including uploaded documents and images, are retained in private storage for operator review. Deletion is scheduled after 30 days and runs asynchronously. Authentication and payment headers are not recorded. Do not submit secrets or unnecessary personal data.