Files

Read a file

Read the text Parley extracted from a file, one window at a time. Scanned pages are OCRed, and paged documents mark each page with <document-page number="N" />. When nextOffset is not null there is more text: pass it back as offset to keep reading. Returns 409 FILE_NOT_READY until the text has been extracted, or if it could not be extracted.

get/files/{id}/text

Request

  • Base URL
    https://api.parley.so/v1
  • URL
    https://api.parley.so/v1/files/{id}/text
  • Auth
    HTTP bearer

Path parameters

idstring required

The file or folder ID.

Query parameters

offsetinteger

Where to start reading, in characters. Pass the previous nextOffset to continue.

limitinteger

Maximum number of characters to return, at about 4 characters per token.

toEndboolean

Return everything from offset to the end in one response, ignoring limit. A long file's text can run to millions of characters, far more than fits in a model's context, so leave this false unless the result is written to a file rather than read.

Response

OK

idstring required

The file or folder ID.

namestring required

The file name.

offsetinteger required

Where this window starts, in characters.

nextOffsetinteger nullable required

Pass as offset to read the next window, or null when this window reaches the end.

totalLengthinteger required

The length of the whole text, in characters.

textstring required

The text in this window.

Changes

No recorded changes to this operation across all 2 revisions of this API.