Get Document Page
Return one document page's OCR text in reading order and, optionally, its layout regions.
Addressed by the document_id returned by List Documents and Query, plus a page_number.
Only works for documents with OCR data (PDFs and similar). For other file types, use Get Document or Get Chunk instead.
Path parameters
>=0Query parameters
falseResponse
Get Document Page response.
The requested page number, echoed back.
The page’s full text in reading order. Empty string when the page exists but has no extractable text (see warnings).
Best-effort total page count, derived from the document’s OCR data. Null when it cannot be determined.
ocrWhere text came from. Always ocr today; a future value would mean reconstructed text, not primary-source OCR.
ocrLayout regions on this page when include_regions is true. Regions of type figure, chart, or image carry a presigned image_url.
Non-fatal conditions on this response, such as document_indexing (content may be incomplete) or page_empty (page exists, no extractable text).
Errors
import json
import requests
BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"
COLLECTION_NAME = "policy_docs"
DOCUMENT_ID = "f4a91c7e8b2d4a0c9e6f13b5a8d02744"
PAGE_NUMBER = 3
headers = {
"Authorization": f"Bearer {API_KEY}",
}
params = {
"include_regions": True
}
response = requests.get(
f"{BASE_URL}/v3/collections/{COLLECTION_NAME}/documents/{DOCUMENT_ID}/pages/{PAGE_NUMBER}",
headers=headers,
params=params,
timeout=30.0
)
print(json.dumps(response.json(), indent=2)){
"collection_name": "policy_docs",
"document_id": "f4a91c7e8b2d4a0c9e6f13b5a8d02744",
"page": 3,
"text": "REMOTE WORK POLICY\nEmployees may work remotely up to three days per week with manager approval. Equipment requests go through IT Support.\n\nEQUIPMENT AND EXPENSES\nThe company provides a laptop and a one-time $500 home office stipend for approved remote employees.",
"page_count": 18,
"text_source": "ocr",
"regions": [
{
"type": "heading",
"text": "REMOTE WORK POLICY",
"page": 3,
"bbox": {
"top": 0.0619,
"left": 0.0662,
"width": 0.3382,
"height": 0.0183
},
"confidence": "high",
"image_url": null,
"description": null
},
{
"type": "text",
"text": "Employees may work remotely up to three days per week with manager approval. Equipment requests go through IT Support.",
"page": 3,
"bbox": {
"top": 0.0862,
"left": 0.0662,
"width": 0.8544,
"height": 0.0445
},
"confidence": "high",
"image_url": null,
"description": null
},
{
"type": "figure",
"text": "Org chart showing IT Support escalation path for equipment requests.",
"page": 3,
"bbox": {
"top": 0.45,
"left": 0.0662,
"width": 0.4013,
"height": 0.0788
},
"confidence": "high",
"image_url": "https://captain-visual-citations.s3.amazonaws.com/crops/org_example/f4a91c7e8b2d4a0c9e6f13b5a8d02744/p3-0.png?AWSAccessKeyId=AKIAEXAMPLE&Expires=1785084004&Signature=EXAMPLESIGNATUREvalue%3D",
"description": "Org chart showing the IT Support escalation path."
}
],
"warnings": [
{
"code": "document_indexing",
"message": "Document 'f4a91c7e8b2d4a0c9e6f13b5a8d02744' is still indexing; page content may be incomplete."
}
]
}