Primitive
Extract
Name the fields you want and say in plain words what each one asks for. Wity returns every value it finds, as it is written in the document, with its exact position and a confidence. A field can have one value, several or none. Set a field's type to get dates, durations or numbers back normalised.
Signature
extract(text, fields)
Returns
each field's values, with where they are
Use it for
One document → the facts you need from it.
New in wity-1
Try it in the console's Split & extract page: a resume, an NDA, a receipt and a support email are ready to run.
One call#
curl https://api.wity.alphanimble.com/v1/extract \-H "Authorization: Bearer $WITY_API_KEY" \-H "Content-Type: application/json" \-d '{"text": "MUTUAL NON-DISCLOSURE AGREEMENT ... made as of the fourteenth day of March, 2025 ... between Kestrel Foods Ltd. ... and Brightmart Inc. ...","fields": {"party": "a company or person that signs the agreement","effective date": "the date the agreement takes effect","term": "how long the confidentiality obligations last","governing law": "the state or country whose law governs the agreement"},"types": { "effective date": "date", "term": "duration" }}'
{"fields": {"party": ["Kestrel Foods Ltd.", "Brightmart Inc."],"effective date": ["2025-03-14"],"term": ["three (3) years"],"governing law": ["New York"]},"entities": [{ "field": "party", "text": "Kestrel Foods Ltd.", "start": 174, "end": 192, "confidence": 0.9929 },{ "field": "party", "text": "Brightmart Inc.", "start": 267, "end": 282, "confidence": 0.9903 },{ "field": "effective date", "text": "2025-03-14", "start": 134, "end": 135, "confidence": 0.9883 },{ "field": "term", "text": "three (3) years", "start": 697, "end": 703, "confidence": 0.9985 },…],"timing_ms": 407,"usage": { "input_tokens": 428, "output_tokens": 0 }}
fieldslists each field's values in the order you asked for them.entitieshas the same values with their character offsets (text[start:end]) and a confidence from 0 to 1.- Values are the document's own words: spacing is tidied, nothing is rephrased. A field with nothing in the document comes back as
[]. - Typed fields (
date,duration,number) come back normalised:"the fourteenth day of March, 2025"becomes2025-03-14. Theirstartandendpoint at where in the document the value was read, as evidence.
Writing good fields#
- Say what the field is, not where it is. “the total amount to pay” works better than “the number at the bottom”.
- One kind of value per field. Ask for “a company that signs the agreement” and “the person who signs for a company” as two fields, not one.
- Name the role when the same kind of value plays several. On a receipt, “cash paid”, “change given back” and “tax amount” are all amounts: describe each one.
- Type anything you want normalised. Dates and terms were right much more often once typed.
- Ask for what you need. Each extra field adds a little time, and a field that has no answer in most documents tends to collect wrong ones.
How good it is#
Measured on the live API (20 October 2026) on public test sets we never tuned on, against hand-labelled values. A value counts as right when it shares at least half its words with the labelled one. Times are for one request at a time; requests running together share the server.
| test set | documents | right (F1) | server time, median |
|---|---|---|---|
| Receipts (CORD) | 100 | 0.87 | 0.4 s |
| Wikipedia entities, 5 domains (CrossNER) | 200 | 0.77 | 0.8 s |
| NDAs, dates and terms typed (Kleister-NDA) | 83 | 0.87 | 1.5 s |
| Contract facts, up to 60,000 characters (CUAD) | 50 | 0.57 | 1.8 s (the longest 4.4 s) |
Where it is weaker
- Values that need reasoning rather than reading, unless the field is typed (a term written as an end date, for instance).
- Two roles of the same kind in one document: signatories taken for parties, or cash for change.
- Very long lists: at most 30 values per field.
- Conventions: whether a value includes its clause, or “Consac LLC” versus “Consac, LLC”.
- The confidence is a good ranking of values, but it has not been calibrated as a probability.
Good to know#
- Limits: up to 60,000 characters and 16 fields per request; field names up to 64 characters, descriptions up to 300.
- Billing:
usage.input_tokensis the document and the field list, counted once, at the usual $0.042 per million. Requests that fail cost nothing. - Extract after split: cut a bundle into items with split, then extract the same fields from every item.
- Full reference: POST /v1/extract.
