This documentation aims to provide all the information you need to work with our API.
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can enable API access and generate your token by visiting the settings page in the account dashboard.
APIs for managing documents
Get a paginated list of the authenticated user's documents.
The page number. Default: 1
The number of items per page. Default: 50
curl --request GET \
--get "https://www.handwritingocr.com/api/v1/documents?page=20&per_page=6" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"current_page": 1,
"data": [
{
"document_id": "abc123",
"status": "processed",
"created_at": "2023-05-01T12:00:00Z",
"updated_at": "2023-05-01T12:30:00Z",
"automatically_deleted_at": "2023-05-08T12:00:00Z",
"page_count": 5,
"original_file_name": "example.pdf",
"action": "transcribe"
}
],
"first_page_url": "http://www.handwritingocr.com/api/v1/documents?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://www.handwritingocr.com/api/v1/documents?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://www.handwritingocr.com/api/v1/documents?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://www.handwritingocr.com/api/v1/documents",
"per_page": 50,
"prev_page_url": null,
"to": 1,
"total": 1
}
Upload a new document for processing.
curl --request POST \
"https://www.handwritingocr.com/api/v1/documents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "action=id"\
--form "extractor_id=19"\
--form "delete_after=14"\
--form "file=@/private/var/folders/xt/b28shz4965d33r0h9hpysjzh0000gn/T/phpKIyKgK"
{
"document_id": "abc123",
"status": "queued"
}
Retrieve details of a specific document.
The document's id.
curl --request GET \
--get "https://www.handwritingocr.com/api/v1/documents/aut" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"id": "abc123",
"status": "processed",
"action": "transcribe",
"created_at": "2023-05-01T12:00:00Z",
"updated_at": "2023-05-01T12:30:00Z",
"results": {
"txt": "https://www.handwritingocr.com/api/v1/documents/abc123/download/token123/transcribe.txt",
"docx": "https://www.handwritingocr.com/api/v1/documents/abc123/download/token123/transcribe.docx",
"json": "https://www.handwritingocr.com/api/v1/documents/abc123/download/token123/transcribe.json"
}
}
Delete a specific document and its associated file.
The document's id.
curl --request DELETE \
"https://www.handwritingocr.com/api/v1/documents/laborum" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
[Empty response]
Download a processed document in the specified format.
The document's id.
The download token.
The processing action. Must be one of: transcribe, tables, extractor.
The download format. Available formats depend on the action.
curl --request GET \
--get "https://www.handwritingocr.com/api/v1/documents/vel/download/harum/quo.eligendi" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"binary_file_content"
}