JSON Extractor

Extract structured JSON from unstructured text reliably.

2 min read 6.7K views 262 likes
The Prompt
Extract structured data from the text below into valid JSON.

Schema:
```json
{
  "entities": [
    {"name": string, "type": "person|company|org|product", "mention_count": number}
  ],
  "dates": [string],
  "amounts": [{"value": number, "currency": string}],
  "key_facts": [string]
}
```

Examples:
Input: "Acme Corp bought 20 servers from TechInc for $40k on March 3. Sarah negotiated the deal."
Output: {"entities": [{"name": "Acme Corp", "type": "company", "mention_count": 1}, {"name": "TechInc", "type": "company", "mention_count": 1}, {"name": "Sarah", "type": "person", "mention_count": 1}], "dates": ["March 3"], "amounts": [{"value": 40000, "currency": "USD"}], "key_facts": ["Acme Corp bought 20 servers", "Sarah negotiated the deal"]}

Output ONLY valid JSON, no markdown fences, no commentary.

Text:
{text}

Customize This Prompt

Fill in the variables and the prompt updates automatically.

Example Input

text: "Invoice #2031 from BrightLabs for $1,250 due January 15th. Mike approved the purchase."

Example Output

Valid JSON with entities (BrightLabs, Mike), the date, the amount, and key facts — parseable programmatically.

Why This Prompt Works

The exact schema plus a worked example produces reliable, parseable output. "No markdown fences" is critical for direct JSON.parse().

Tips for Best Results

  • Keep the schema narrow — wide schemas cause misses.
  • Add an example with the edge case you care about.
  • Validate output by running JSON.parse before use.

Common Mistakes

  • Asking for open-ended extraction without a schema.
  • Accepting markdown-wrapped JSON.

Frequently Asked Questions

Can I use this prompt for free?

Yes. Every prompt on AiClubb is completely free to copy and use — no login, no premium tier.

Which AI models work best with this prompt?

This prompt is optimized for Claude, but it works on any modern model. Test it across models and keep the output you like best.

How do I customize the variables?

Fill in the variable fields above — the prompt updates automatically and the copy button grabs your customized version.

Can I save this prompt?

Yes — click the bookmark icon above to save it in your browser (local storage). Your saved prompts are private to your device.

Skip to content