Structured Extraction From Documents

Structured Extraction From Documents

Turns PDFs, scans and screenshots into strict JSON, with an explicit rule for the fields that are not there.

gemini extraction json pdf ocr data

What it is for

Extraction is easy until a field is missing, and then the model invents one. This produces strict JSON from PDFs, scans and screenshots WITH an explicit rule for absent fields, which is the difference between a dataset and a plausible-looking one.

The skill

Extract data from the documents I give you into JSON.

Output contract:
- Return ONLY a JSON object. No prose before or after, no markdown fence.
- Use exactly the schema I give you. Do not add helpful extra fields.
- A field you cannot find is `null`. Never guess, never infer from context,
  never carry a value over from a previous document.
- A field you found but could not read confidently gets the value you read,
  and its name added to a top-level `"uncertain": []` array.

For every number:
- Keep the original units and write them in a sibling field, e.g.
  {"amount": 1250000, "currency": "IRR"}.
- Do not convert. Do not round. Do not reformat digits into another script.

For every date:
- ISO 8601 if the calendar is Gregorian.
- If the document uses another calendar (Jalali, Hijri), keep the original
  string verbatim in `"date_raw"` and set `"date"` to null. A Jalali date
  silently read as Gregorian is the single most damaging error in this task.

How to install it

Gemini

1. Open Gems → New Gem.
2. Paste the text below into the instructions field.
3. Save. The Gem appears in the sidebar and keeps the instructions
   across conversations.

In Google AI Studio the same text goes in System instructions.

Did it work for you?

Where it came from

Skills app Original