Extract structured data as JSON

A strict extraction prompt that returns valid JSON only, with nulls for missing fields instead of invented values.

AI Place Hub 0
PromptCopied
Extract the fields listed below from the text and return JSON only.

Fields:
{{fields}}

Rules:
- Return a single JSON object, no markdown fences, no commentary before or after.
- If a field is not present in the text, set it to null. Never infer it.
- Keep the original wording for text fields. Do not normalise, translate or tidy.
- If the text contains several records, return an array of objects instead.

--- text ---
{{text}}

Fill these in

PlaceholderWhat goes hereExample
{{fields}} Field list invoice_number (string), issued_on (ISO date), total_eur (number), supplier_name (string)
{{text}} Source text OCR output, an email body, a scraped page

Notes from the author

Run this at temperature 0. The no-fences rule is worth keeping even on models with a JSON mode, because it makes the same prompt portable. Validate the output against a schema on your side - a prompt is not a guarantee.

Fork

Did this work for you?

Sign in to flag it

Related