HTTP API
Read the text
GET
/v1/documents/{document_id}/chunks
const url = 'https://sergo.example.com/v1/documents/example/chunks?page=1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://sergo.example.com/v1/documents/example/chunks?page=1' \ --header 'Authorization: Bearer <token>'The chunks that start on one page, in order — the text search looks in. To read the whole document, go page by page up to page_count.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”document_id
required
Document Id
string
Query Parameters
Section titled “Query Parameters”page
Page
Page number, from 1. Files without pages of their own have estimated pages
integer
Page number, from 1. Files without pages of their own have estimated pages
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Chunks
object
page
required
Page
The page these chunks start on
integer
page_count
required
Page Count
integer
chunk_count
required
Chunk Count
Chunks in the whole document
integer
offset
required
Offset
Chunks before this page
integer
pages_to_view
required
Pages To View
Pages whose text may miss a figure, chart or table
Array<integer>
pages_estimated
required
Pages Estimated
The page numbers are estimates
boolean
items
required
Items
Array<object>
ChunkItemExample
{ "pages_to_view": [], "pages_estimated": false}Validation Error
Media typeapplication/json
RequestError
object
code
required
Code
string
message
required
Message
What was wrong, field by field
string
Example
{ "code": "invalid_request"}