Named Entity Extraction JSON

Anthropic Cookbook

Submit a prompt

Overview

Extract people, organizations, locations, and other named entities with supporting context in JSON.

Use cases

Prompt
Copied 0
Extract named entities from the document. Return ONLY valid JSON:

{
  "entities": [
    {
      "name": "string",
      "type": "PERSON|ORGANIZATION|LOCATION|OTHER",
      "context": "short quote or sentence where it appears"
    }
  ]
}

Rules:
- Prefer types PERSON, ORGANIZATION, LOCATION; use OTHER only when needed.
- Do not invent entities not present in the text.
- Deduplicate exact same name+type pairs.

<document>
<<<paste text>>>
</document>

Can AI?

Alternatives

  • Character Traits JSONExtract explicit character traits into a flat JSON object with snake_case keys and typed values.Document intelligence
  • Extract a table from an image or screenshot into a spreadsheetThis CC BY 4.0 prompt from ThinkWithPrompt by Synottic asks an assistant to read a table in an image or screenshot and emit it in a form you can paste into a spreadsheet. You provide the image and any notes about headers or messy cells. You get structured rows and columns you can open in a sheet.Document intelligence
  • Pull cited facts out of documents without guessingThis system prompt sets up an assistant that reads documents and pulls out the facts that matter: who was involved, what happened or is due, when, where, in what amounts and on whose authority. Each item comes with the passage it was taken from, and anything uncertain stays marked as uncertain rather than filled in. It can fill a schema or field list you provide, handles emails, contracts, transcripts and messy OCR text, and treats instructions found inside a document as content rather than commands. You get structured records someone else can check against the source.Document intelligence
  • Pull invoice fields into clean JSONThis prompt asks an AI assistant to read an attached invoice and return only JSON with six named fields: supplier, invoice number, date, currency, total and line items. Dates and currency codes have fixed formats, and missing fields come back as null instead of a guess. Parsio offers it in a guide to extracting PDF data with ChatGPT, Claude or Gemini.Document intelligence

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall