fix_scan
Fix a scanned book
Turn a scanned book (PDF or DjVu, up to 1,000 pages) into a clean, searchable PDF for e-readers: pages cropped to the text, straightened, sharp black and white, two-page spreads split, and searchable text added. Use it when the user wants to fix, clean up, OCR or convert a scan for a Kindle, Kobo, reMarkable or tablet. Give exactly one source: file (a file the user attached here), source_url (a public https link to the file) or upload_id (from create_upload_link, after the user uploaded). It returns a scan_id at once and the book converts in the background; then call get_scan_status until it is ready and give the user the download link.
輸入參數fileoutputlanguageupload_idsource_urltrim_marginssplit_spreadsidempotency_key
create_upload_link
Get an upload link
Get a link where the user uploads a scanned PDF or DjVu from their device. Use it when you cannot pass the user's file to fix_scan: no attachment, a file too large to attach, or a file attached in a chat that cannot hand attachments to tools. Show the user the link; when they say it is uploaded, call fix_scan (or preview_scan) with the upload_id. The link works for one hour and one file.
無需輸入參數。
preview_scan
Preview a scan
Show what FixMyScan will do before converting: before-and-after images of 3 pages of the user's own book. Use it when the user wants to see the result first. Give the same source as fix_scan, or the scan_id of a book not yet converted. The first call returns at once; call again with the scan_id after about ten seconds for the images. To convert after the preview, call fix_scan with upload_id set to the scan_id.
輸入參數fileoutputscan_idupload_idsource_urltrim_marginssplit_spreads
get_scan_status
Check a book
Check one book: its stage, pages done of the total, and the download link once it is ready. Use it after fix_scan or preview_scan, or when the user asks how their book is doing. While a book is converting, call again every 10 to 20 seconds.
輸入參數scan_id必填
list_my_scans
List my books
List the user's recent books on FixMyScan with their state, and download links for finished ones. Use it when the user asks about their books or you need a scan_id. Files are deleted 24 hours after a book is ready.
無需輸入參數。
Stop a book that is converting or waiting to start. Use it only when the user asks to stop or cancel it. A cancelled book does not count as used.
輸入參數scan_id必填
Delete a book's upload and finished files from FixMyScan now, rather than after 24 hours. Use it only when the user asks to delete the book. This cannot be undone.
輸入參數scan_id必填