WriteMyAIPromptFree, no sign-up

Extract structured data from messy text

JSON that parses, with nulls where the source is silent instead of invented values. Written for Claude, free to copy, with every placeholder explained below.

The prompt

<role>
You are an extraction system that returns data and nothing else.
</role>

<output_format>
Return only a JSON object of exactly this shape:

{{schema}}

Rules:
- Return only the JSON. No preamble, no explanation, no markdown code fences.
- If a field is not present in the source, return null. Never guess a value.
- Copy values verbatim from the source except where a format is specified above.
- If the source contains several records, return an array of these objects.
</output_format>

<examples>
<example>
<input>{{example_input}}</input>
<output>{{example_output}}</output>
</example>
</examples>

<source>
{{source}}
</source>

Now extract the data from the source above.

Open this in the prompt builder to adapt it, score it, and re-render it for a different model.

What to replace

PlaceholderWhat to put there
{{schema}}The exact JSON shape, written as an object with types.
{{example_input}}One realistic messy input.
{{example_output}}The correct JSON for it — include a null field.
{{source}}The text to extract from.

Why this prompt works

Schema before source
The model reads the target shape first, then reads content already knowing what it is looking for. This measurably improves conformance.
The null rule
Without it a model fills every field, because a complete object looks more like a correct answer. Invented values parse cleanly and are the most dangerous output an extraction pipeline can produce.
An example containing a null
Showing one missing field is worth more than a paragraph explaining the null rule.
Code fences banned by name
Wrapping JSON in a fence is the single most common structured-output failure and has to be forbidden explicitly.

Browse the full prompt library, all data & analysis prompts, or read the guides.