{"uid":"cap_qFIb3q67jx3TLi9Arp9EX","slug":"x402-text-to-structure-extraction-api-b6d78577","name":"x402 Text-to-Structure Extraction API","description":"USDC pay-per-call APIs for AI agents via the x402 protocol (v2, exact, Base mainnet). Send a request, receive HTTP 402 with payment requirements, pay with @x402/fetch or any x402 client, retry with the PAYMENT-SIGNATURE header.","url":"https://call402.com/api/text-to-structure?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input text, max 20000 chars"},"fields":{"type":"array","items":{"type":"string"},"description":"Optional field names to extract"},"schema":{"type":"object","description":"Optional JSON-schema-like object with properties to fill"}}},"responseSchema":{"type":"json","example":{"meta":{"chars":108,"extractor":"deterministic-v1"},"entities":{"urls":[],"dates":[{"iso":"2026-11-01","raw":"2026-11-01"}],"money":[{"raw":"$250.00","amount":250,"currency":"USD"}],"emails":["alice@example.com"],"phones":[],"tx_hashes":[],"key_values":{},"percentages":[{"raw":"2.5%","value":2.5}],"evm_addresses":[]},"structured":{"date":"2026-11-01","email":"alice@example.com","amount":250}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1lHCJNRuLgvnrrTI_Mbe0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts structured entities and key-value pairs from free-form text, including dates, emails, money amounts, URLs, EVM addresses, and custom fields","exampleAgentPrompt":"Pull out all the dates, dollar amounts, and email addresses from this text and return them as structured JSON: 'Please remit $250.00 to alice@example.com by 2026-11-01, noting the 2.5% early payment discount.'","exampleUseCases":[{"title":"Invoice data extraction for accounting","prompt":"I have this invoice email body — can you extract the amount due, due date, and vendor email address from it as structured fields? Here's the text: 'Your invoice for $1,200.00 is due on 2025-08-15. Please contact billing@vendor.com with questions.'"},{"title":"Crypto transaction log parsing","prompt":"Parse this transaction log and pull out any Ethereum wallet addresses, transaction hashes, and USD amounts: '0xAbC...sent 0.5 ETH ($1,500.00) in tx 0x1a2b...'"},{"title":"Custom field extraction from user notes","prompt":"From this freeform note, extract the fields 'client_name', 'deadline', and 'budget': 'Need to deliver the redesign for Acme Corp by March 3rd 2026, budget is capped at $8,000.'"}],"resultDescription":"A JSON object containing an 'entities' map with arrays for recognized entity types (dates with ISO format, money with amount and currency, emails, URLs, phone numbers, EVM addresses, tx_hashes, percentages, key_values), plus a 'structured' object with values mapped to any requested schema fields or named fields, and a 'meta' object with character count and extractor version.","failureModes":["Text exceeds 20,000 character limit — request rejected","Invalid JSON schema provided in the 'schema' field — parsing error returned","No entities found matching requested fields — structured object returned empty","x402 payment not attached or invalid PAYMENT-SIGNATURE header — HTTP 402 returned with payment requirements","Malformed request body — HTTP 400 with validation error"],"whenToPreferThis":"Choose this endpoint when you need to extract structured entities or named fields from unstructured text without building a custom NLP pipeline. It is especially useful for AI agents that receive natural language inputs and need to feed downstream systems with typed data. The deterministic extraction engine is fast and cheap ($0.01 USDC) for high-frequency, low-latency extraction tasks. Prefer it over LLM-based extraction when you want predictable, schema-defined outputs and cost control.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:38:18.260Z","isFirstParty":false,"canonicalSlug":"x402-text-to-structure-extraction-api-b6d78577"}