Extract messy text into clean structured JSON

code & data

// what it does

Give ChatGPT the raw text and the exact JSON schema you want — field names, types, and how to handle missing values — and it returns parseable output instead of prose. Specifying the schema explicitly and telling it to emit only JSON (no commentary) is what makes the result safe to feed into another program.

// prompt

> Extract the details below into JSON with keys name (string), email (string), company (string), and signup_date (YYYY-MM-DD). Use null for anything not present. Return only the JSON. Text: [paste text]

// gotcha

The model may hallucinate a plausible value for a field that is not in the source. Instruct it to use null (not a guess) for anything missing, and to return only the JSON with no surrounding text so your parser does not choke.

// resources