{"uid":"cap_Spu_uLMUoEzU-bRc_5_AN","slug":"agent-data-tools-extract-json-fields-from-text-eec9030d","name":"Agent Data Tools: Extract JSON Fields from Text","description":"Pull named fields out of unstructured text (emails, invoices, listings, bios) and get them back as a JSON object, with null for anything not present. Use to turn messy text into structured data for an agent.","url":"https://agent-data-tools.revmesh2074.workers.dev/ai/extract-json?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["text","fields"],"properties":{"text":{"type":"string","description":"Source text, up to 12,000 characters"},"fields":{"type":"string","description":"Comma-separated field names to extract (1-30)"}}},"responseSchema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"number"},"company":{"type":"string"},"currency":{"type":"string"},"due_date":{"type":"string"},"invoice_number":{"type":"string"}}},"model":{"type":"string"},"missing":{"type":"array","items":{}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USD","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_092ndHhyJfDq41iN8teCW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts specific named fields from unstructured text and returns them as a structured JSON object using an LLM","exampleAgentPrompt":"Can you pull out the invoice number, company name, total amount, currency, and due date from this invoice text: 'Invoice #1043 from Acme AB, dated Oct 1 2026. Total due: 2,450 SEK by November 1, 2026.'","exampleUseCases":[{"title":"Invoice data extraction for accounting","prompt":"I have this raw invoice email text and I need to extract the invoice number, company, total, currency, and due date from it as structured data — can you do that? Here's the text: 'Dear client, please find invoice INV-2091 from Nordic Supplies AB. Amount due: €3,200.00. Payment due by 2026-12-15.'"},{"title":"Contract term parsing for legal review","prompt":"Pull out the start date, end date, party names, and contract value from this contract snippet: 'This agreement is entered into on January 1, 2026 between Acme Corp and Beta LLC for a total value of $120,000, expiring December 31, 2026.'"},{"title":"Lead enrichment from email signatures","prompt":"Extract the name, company, title, phone, and email fields from this email signature text: 'Jane Doe | VP of Sales | TechCorp Inc. | jane.doe@techcorp.com | +1-415-555-0192'"}],"resultDescription":"Returns a JSON object with a 'data' key containing the extracted field values keyed by the requested field names, a 'model' string identifying the LLM used, and a 'missing' array listing any fields that could not be found in the source text.","failureModes":["Text exceeds 12,000 character limit — truncated or rejected input","More than 30 fields requested — validation error","Field names are ambiguous or not present in text — fields appear in 'missing' array","LLM hallucination — field values may be inaccurate if text is unclear","GET request with missing required query params (text or fields) — 400 error","Payment failure — call not charged if x402 payment fails"],"whenToPreferThis":"Use this endpoint when you need to extract a specific, named set of fields from unstructured or semi-structured text (invoices, contracts, emails, documents) and want a structured JSON response. It is ideal for document automation, data entry pipelines, and any scenario where you already know the field names you need. Prefer this over generic LLM calls when you want a lightweight, pay-per-call approach with no API key or account setup, and when the source text fits within 12,000 characters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T07:17:31.954Z","isFirstParty":false,"canonicalSlug":"agent-data-tools-extract-json-fields-from-text-eec9030d"}