Extract document fields
Extract a schema's fields (schema, fields or prompt) from a document.
POST
/docs/v1/extractcurl --request POST \
--url 'https://factget.dev/docs/v1/extract' \
--header "Authorization: Bearer $FACTGET_DOCS_KEY" \
--header 'Content-Type: application/json' \
--data '{
"fileId": "YOUR_FILE_ID",
"prompt": "Extract the company name, reporting period, and total revenue."
}'Replace IDs and sample values with your own. Examples are not executed in your browser.
Request body
application/jsonmaxItems: 5000minLength: 1maxLength: 200maxLength: 2000Default: maxLength: 200maxLength: 100maxItems: 200
fileIdstring | nullA file from POST /v1/files
urlstring | nullA public URL of the document
pagesstring | nullPages to read, e.g. "1-10" or "3,7,12-15"
timeoutintegerms to wait before 202
Default:120000minimum: 1000maximum: 300000schemaobject | nullA JSON Schema
fieldsobject[] | nullShow item properties
namestringrequireddescriptionstring | nulltypestring"string"Allowed: "string", "number", "integer", "boolean", "date"sectionstring | nullunitstring | nullenumstring[] | nullpromptstring | nullWhat to extract, in words (a schema is designed)
maxLength: 20000generateOnlybooleanWith prompt: return the schema, do not extract
Default:falseProvide either a fileId from an upload or a public document URL. For extraction, also supply schema, fields, or prompt.
Responses
200Successful Response
application/json
The published schema does not define individual response fields for this endpoint. Inspect the returned JSON in your integration.
422Validation Error
application/json
detailobject[]Show item properties
locstring | integer[]requiredmsgstringrequiredtypestringrequiredinputobjectctxobjectThe API schema lists the responses above. Long-running operations can also return 202; see async jobs. For application errors, see errors & retries.