analysis

Structured data extraction

Pull structured fields out of unstructured text — invoice numbers, amounts, dates, names, addresses, order ids, anything the document actually states — by describing the fields you want. Returns data (a {field: value} map, null where the text does not state the field), fields (per-field value, the verbatim evidence span it came from, and whether it was found) and missing (the fields the text did not yield). Values are returned in the type you declare (string, number, integer, boolean, date as YYYY-MM-DD, or list of strings) and a value that will not convert is reported missing rather than returned in the wrong type. This is EXTRACTION, not summarization or inference: except for boolean fields, a value must be traceable to a span of the text or it is dropped. Use context to say what the document is. 1-20 fields.

post/api/v1/extract

Request

  • Base URL: https://api.sapling.ai
  • URL: https://api.sapling.ai/api/v1/extract
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.sapling.ai/oauth/authorize, token URL https://api.sapling.ai/oauth/token, scopes: sapling:api)
    • none

Request body

OR

Response

Successful response. Field-level schemas and examples: https://sapling.ai/docs/api/extract/ A batch (texts) request answers {"results": [...]} instead: one single-text response per input text, in input order.

resultsobject[]

Present only for a batch (texts) request: one entry per input text, in input order, each shaped exactly like the single-text response.

Changes

No recorded changes to this operation across all 1 revision of this API.