ocr-software.com OCR
v0.3.1Read PDFs and images with ocr-software.com: page count, job, text, Markdown, JSON, hOCR.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_pipelines
List what the service offers (no key needed): per pipeline one line (summary: what it delivers, price per page in euros, when to choose another one), formats and features, and default_pipeline: the fastest and cheapest available one, used when no pipeline is named. Show the available ones to the human with the default; you are asked to let the human pick and not to choose a pipeline yourself. detail=true adds descriptions, capabilities, measurements and hardware (long, rarely needed).
| Parameter | Type | Description |
|---|---|---|
detail | boolean | true adds descriptions, capabilities, measurements and hardware (long) |
quote
Dry run: nothing runs, nothing is billed. Returns quote_id, the page count and say_to_human, one sentence with the price: you are asked to show it to the human word for word and get a yes before submit_job. pipeline is name@version from list_pipelines; if the human named none, leave it out: the default (fastest and cheapest available) is used and the sentence names it. The quote_id is for one document, one pipeline and one job.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | absolute path of one PDF, PNG, JPEG or TIFF file |
dpi | render resolution for PDF pages; leave out for the default | |
pipeline | name@version from list_pipelines; leave out if the human named none |
submit_job
Start the job of a quote (document, pipeline and price are bound to the quote_id; the budget is the quoted price). You are asked to set human_confirmed=true only after the human saw say_to_human and really agreed (the server cannot check it); if the client can ask the human itself it asks when you leave it false. With wait_seconds and format the result is saved like get_result. Without wait_seconds it returns at once: use job_status, keep the job_id.
| Parameter | Type | Description |
|---|---|---|
quote_id * | string | from quote; valid for one job, one hour |
client_ref | your own reference, kept with the job | |
format | json, text, md, hocr or pdf: save the result when done (needs wait_seconds) | |
human_confirmed | boolean | true only after the human saw say_to_human and agreed |
out_dir | folder for the result file; not allowed if the human set OCR_OUT_DIR | |
wait_seconds | integer | 0 to 300: hold until the job is done; 0 returns at once |
job_status
State and counts of a job. Holds until the job is done or wait_seconds (0 to 300) are over, and reports progress meanwhile: one call is enough, do not poll in a loop; if state is still running call again. When state is done, check problem (pages failed or not run) and tell the human. format (json, text, md, hocr, pdf) saves the result when done.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | from submit_job |
format | json, text, md, hocr or pdf: save the result when done | |
out_dir | folder for the result file; not allowed if the human set OCR_OUT_DIR | |
wait_seconds | integer | 0 to 300: hold until the job is done |
get_result
Result of a finished job. Default: write it to a file and return path, size and check: words, mean confidence and uncertain words per page, notes such as probably several columns. The content stays out of the chat. pages ('3', '1-5') returns those pages' text here, search the matching lines with page numbers; neither writes a file. The file goes to ocr-results next to the document by default; pdf is searchable. Results expire after about 24 hours. In the json: confidence is 0 to 1, box is [x0,y0,x1,y1] in pixels of the page image (page width, height). verified (per word) is…
| Parameter | Type | Description |
|---|---|---|
job_id * | string | from submit_job |
format | json (default), text, md, hocr or pdf; file output only | |
out_dir | folder for the file; not allowed if the human set OCR_OUT_DIR | |
pages | like 3 or 1-5 or 2,4,7-9: return the text of these pages here, no file | |
search | return the lines containing this text with page numbers, no file | |
source_path | original document, needed for pdf after a restart of this server |
cancel_job
Stop a running job, or delete the result of a finished one (DELETE /v1/jobs/{id}). You are asked to set human_confirmed=true only after the human agreed (the server cannot check it). Pages already read stay charged; check job_status afterwards.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | from submit_job |
human_confirmed | boolean | true only after the human agreed to cancel |
uncertain_words
Words the OCR read with low confidence (below max_confidence, default 0.9: the words of the gold set that were really wrong sat at about 0.83) or flagged as differing readings (scan-vlm-ctc), least sure first: page, word, confidence, other_reading if there is a second one, and box [x0,y0,x1,y1] in pixels of the page image (page_size: width and height per page). Check these against the image of the page, do not trust them blindly, and tell the human what you corrected. limit 1 to 100, max_confidence 0 to 1. Needs a finished job.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | from submit_job |
limit | integer | 1 to 100: most words returned |
max_confidence | number | 0 to 1: list words below this confidence |
pages | like 3 or 1-5: only these pages |