{"openapi":"3.1.0","info":{"title":"Image to Text OCR API (receipts, documents, screenshots, many languages)","version":"1.0.0","description":"Extract the text from any image: receipts and invoices, scanned or photographed documents, screenshots, signs, labels and menus, in many languages and scripts, 20+ tested (Latin, Cyrillic, Greek, Chinese, Japanese, Korean, Thai and more). Output as plain text, Markdown (tables kept as Markdown tables) or a list of lines, with a language guess. Send an image URL, a base64 image or a file upload (JPEG, PNG, WebP, GIF up to 6 MB). An AI vision model reads the image with a strict transcribe-verbatim instruction: nothing is translated, summarized or corrected. Images without text return `noText: true`.\n\nAll endpoints accept GET (query string) or POST (JSON body). Errors use one shape: `{\"success\": false, \"error\": {\"code\", \"message\", \"retryable\"}}`. When a numeric `Retry-After` header is present, `error.retryAfterSeconds` is included.","contact":{"name":"TidyTools","url":"https://apify.com/tidytools"}},"servers":[{"url":"https://webcapture-api.yukailin.workers.dev","description":"Origin (reachable only through the marketplace gateway)"}],"tags":[{"name":"OCR"}],"paths":{"/api/v1/ocr":{"get":{"operationId":"ocrGet","summary":"Extract text from an image (OCR) (GET)","description":"Reads all text in a photo, scan or screenshot (receipts, invoices, documents, signs, labels, menus, screenshots; many languages and scripts (20+ tested) including Chinese, Japanese and Korean) with an AI vision model (Llama 4 Scout) instructed to transcribe verbatim: nothing is translated, summarized or corrected. Send an image URL (GET or POST), a base64 image (POST JSON), a file upload (POST multipart/form-data, field `image`) or the raw image bytes (POST with `Content-Type: image/*`, options in the query string). Images without text return `noText: true`. Identical images are served from a 24-hour cache.","tags":["OCR"],"parameters":[{"name":"url","schema":{"type":"string"},"description":"Public image URL (JPEG, PNG, WebP or GIF, up to 6 MB). Google Drive, Dropbox and OneDrive share links work. Private, local and cloud-metadata addresses are refused on every redirect. Alias: `imageUrl`. For POST you can send `image` instead.","required":false,"example":"https://upload.wikimedia.org/wikipedia/commons/0/08/China_nutrition_facts_label.png","in":"query"},{"name":"format","schema":{"type":"string","default":"text","enum":["text","markdown","lines"]},"description":"`text` (default): plain text, tables as tab-separated rows. `markdown`: Markdown with headings, lists and tables. `lines`: plain text plus a `lines` array (one string per non-empty line; no coordinates).","required":false,"in":"query"},{"name":"language","schema":{"type":"string"},"description":"Optional hint for the main language of the text, as a name (`Japanese`, `German`, `Traditional Chinese`). Helps with small or stylized script. The text is never translated.","required":false,"example":"Japanese","in":"query"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"source":{"type":"string","enum":["url","upload"]},"url":{"type":"string","nullable":true,"description":"The image URL you sent (null for uploads)."},"finalUrl":{"type":"string","nullable":true,"description":"The URL after redirects (null for uploads)."},"image":{"type":"object","properties":{"format":{"type":"string","enum":["jpeg","png","webp","gif"]},"width":{"type":"integer"},"height":{"type":"integer"},"bytes":{"type":"integer"},"sha256":{"type":"string","description":"SHA-256 of the image bytes (results are cached by it for 24 hours)."}}},"format":{"type":"string","enum":["text","markdown","lines"]},"noText":{"type":"boolean","description":"true: the image holds no readable text (`text` is empty)."},"text":{"type":"string"},"lines":{"type":"array","items":{"type":"string"},"description":"Only with `format=lines`: the non-empty lines of `text`."},"lineCount":{"type":"integer"},"charCount":{"type":"integer"},"language":{"type":"object","nullable":true,"description":"Main language guessed from the text (`code` ISO 639-1 or `und`, `name`); null when there is no text.","properties":{"code":{"type":"string"},"name":{"type":"string"}}},"truncated":{"type":"boolean","description":"true: the text was longer than the output limit (about 1,500 words) and was cut, or the model repeated itself and the repeats were removed."},"warnings":{"type":"array","items":{"type":"string","enum":["low_resolution","output_limit_reached","repetition_trimmed","model_declined"]},"description":"`low_resolution`: under about 450x450 pixels, small print may be misread (send a larger image). `output_limit_reached` / `repetition_trimmed`: see `truncated`. `model_declined`: the model refused to read the image (returned as noText)."},"model":{"type":"string"},"durationMs":{"type":"integer"},"fileName":{"type":"string","nullable":true,"description":"File name of a multipart upload."}}},"example":{"success":true,"source":"url","url":"https://upload.wikimedia.org/wikipedia/commons/0/08/China_nutrition_facts_label.png","finalUrl":"https://upload.wikimedia.org/wikipedia/commons/0/08/China_nutrition_facts_label.png","image":{"format":"png","width":1201,"height":906,"bytes":107051,"sha256":"807236cee974518fa7bb881c44c8c62eb2687c596f059431db59e321fdd84e03"},"format":"markdown","noText":false,"text":"# 营养成分表\n\n| 项目 | 每100ml | NRV% |\n| --- | --- | --- |\n| 能量 | 284kJ | 3% |\n| 蛋白质 | 3.1g | 5% |\n| 脂肪 | 3.7g | 6% |\n| 碳水化合物 | 4.8g | 2% |\n| 钠 | 62mg | 3% |\n| 钙 | 100mg | 13% |","lineCount":9,"charCount":170,"language":{"code":"zh","name":"Chinese"},"truncated":false,"warnings":[],"model":"llama-4-scout-17b-16e-instruct","durationMs":2235}}}},"400":{"description":"Invalid parameter (`invalid_request`) or a private/local target (`url_not_allowed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"url_not_allowed","message":"private, local and reserved hosts are not allowed"}}}}},"413":{"description":"Request body or target document too large (`too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Not a supported image (`unsupported_content`: a web page, PDF, SVG, BMP, TIFF, HEIC/AVIF or an unreadable file), the image server refused (`target_blocked`), could not be reached (`target_unreachable`) or the image does not exist (`target_error`, HTTP 404/410).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"unsupported_content","message":"the URL returned a web page, not an image: link to the image file itself"}}}}},"502":{"description":"Temporary failure on our side (`upstream_error`); safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The target did not respond in time (`timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"ocr","summary":"Extract text from an image (OCR)","description":"Reads all text in a photo, scan or screenshot (receipts, invoices, documents, signs, labels, menus, screenshots; many languages and scripts (20+ tested) including Chinese, Japanese and Korean) with an AI vision model (Llama 4 Scout) instructed to transcribe verbatim: nothing is translated, summarized or corrected. Send an image URL (GET or POST), a base64 image (POST JSON), a file upload (POST multipart/form-data, field `image`) or the raw image bytes (POST with `Content-Type: image/*`, options in the query string). Images without text return `noText: true`. Identical images are served from a 24-hour cache.\n\nPOST accepts a JSON body (`url` or base64 `image`), a multipart/form-data upload (field `image`) or raw image bytes.","tags":["OCR"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public image URL (JPEG, PNG, WebP or GIF, up to 6 MB). Google Drive, Dropbox and OneDrive share links work. Private, local and cloud-metadata addresses are refused on every redirect. Alias: `imageUrl`. For POST you can send `image` instead."},"image":{"type":"string","description":"The image itself as base64 or a data URL (`data:image/png;base64,...`), up to 6 MB decoded. POST only. Aliases: `imageBase64`, `base64`."},"format":{"type":"string","default":"text","enum":["text","markdown","lines"],"description":"`text` (default): plain text, tables as tab-separated rows. `markdown`: Markdown with headings, lists and tables. `lines`: plain text plus a `lines` array (one string per non-empty line; no coordinates)."},"language":{"type":"string","description":"Optional hint for the main language of the text, as a name (`Japanese`, `German`, `Traditional Chinese`). Helps with small or stylized script. The text is never translated."}}},"example":{"url":"https://upload.wikimedia.org/wikipedia/commons/0/08/China_nutrition_facts_label.png","format":"markdown"}},"multipart/form-data":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","format":"binary","description":"The image file (JPEG, PNG, WebP or GIF, up to 6 MB). Alias: `file`."},"format":{"type":"string","default":"text","enum":["text","markdown","lines"],"description":"`text` (default): plain text, tables as tab-separated rows. `markdown`: Markdown with headings, lists and tables. `lines`: plain text plus a `lines` array (one string per non-empty line; no coordinates)."},"language":{"type":"string","description":"Optional hint for the main language of the text, as a name (`Japanese`, `German`, `Traditional Chinese`). Helps with small or stylized script. The text is never translated."}}}},"image/*":{"schema":{"type":"string","format":"binary","description":"Raw image bytes (up to 6 MB); put `format` and `language` in the query string."}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"source":{"type":"string","enum":["url","upload"]},"url":{"type":"string","nullable":true,"description":"The image URL you sent (null for uploads)."},"finalUrl":{"type":"string","nullable":true,"description":"The URL after redirects (null for uploads)."},"image":{"type":"object","properties":{"format":{"type":"string","enum":["jpeg","png","webp","gif"]},"width":{"type":"integer"},"height":{"type":"integer"},"bytes":{"type":"integer"},"sha256":{"type":"string","description":"SHA-256 of the image bytes (results are cached by it for 24 hours)."}}},"format":{"type":"string","enum":["text","markdown","lines"]},"noText":{"type":"boolean","description":"true: the image holds no readable text (`text` is empty)."},"text":{"type":"string"},"lines":{"type":"array","items":{"type":"string"},"description":"Only with `format=lines`: the non-empty lines of `text`."},"lineCount":{"type":"integer"},"charCount":{"type":"integer"},"language":{"type":"object","nullable":true,"description":"Main language guessed from the text (`code` ISO 639-1 or `und`, `name`); null when there is no text.","properties":{"code":{"type":"string"},"name":{"type":"string"}}},"truncated":{"type":"boolean","description":"true: the text was longer than the output limit (about 1,500 words) and was cut, or the model repeated itself and the repeats were removed."},"warnings":{"type":"array","items":{"type":"string","enum":["low_resolution","output_limit_reached","repetition_trimmed","model_declined"]},"description":"`low_resolution`: under about 450x450 pixels, small print may be misread (send a larger image). `output_limit_reached` / `repetition_trimmed`: see `truncated`. `model_declined`: the model refused to read the image (returned as noText)."},"model":{"type":"string"},"durationMs":{"type":"integer"},"fileName":{"type":"string","nullable":true,"description":"File name of a multipart upload."}}},"example":{"success":true,"source":"url","url":"https://upload.wikimedia.org/wikipedia/commons/0/08/China_nutrition_facts_label.png","finalUrl":"https://upload.wikimedia.org/wikipedia/commons/0/08/China_nutrition_facts_label.png","image":{"format":"png","width":1201,"height":906,"bytes":107051,"sha256":"807236cee974518fa7bb881c44c8c62eb2687c596f059431db59e321fdd84e03"},"format":"markdown","noText":false,"text":"# 营养成分表\n\n| 项目 | 每100ml | NRV% |\n| --- | --- | --- |\n| 能量 | 284kJ | 3% |\n| 蛋白质 | 3.1g | 5% |\n| 脂肪 | 3.7g | 6% |\n| 碳水化合物 | 4.8g | 2% |\n| 钠 | 62mg | 3% |\n| 钙 | 100mg | 13% |","lineCount":9,"charCount":170,"language":{"code":"zh","name":"Chinese"},"truncated":false,"warnings":[],"model":"llama-4-scout-17b-16e-instruct","durationMs":2235}}}},"400":{"description":"Invalid parameter (`invalid_request`) or a private/local target (`url_not_allowed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"url_not_allowed","message":"private, local and reserved hosts are not allowed"}}}}},"413":{"description":"Request body or target document too large (`too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Not a supported image (`unsupported_content`: a web page, PDF, SVG, BMP, TIFF, HEIC/AVIF or an unreadable file), the image server refused (`target_blocked`), could not be reached (`target_unreachable`) or the image does not exist (`target_error`, HTTP 404/410).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"unsupported_content","message":"the URL returned a web page, not an image: link to the image file itself"}}}}},"502":{"description":"Temporary failure on our side (`upstream_error`); safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The target did not respond in time (`timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"format","schema":{"type":"string","default":"text","enum":["text","markdown","lines"]},"description":"For raw image bodies: `text` (default): plain text, tables as tab-separated rows. `markdown`: Markdown with headings, lists and tables. `lines`: plain text plus a `lines` array (one string per non-empty line; no coordinates).","required":false,"in":"query"},{"name":"language","schema":{"type":"string"},"description":"For raw image bodies: Optional hint for the main language of the text, as a name (`Japanese`, `German`, `Traditional Chinese`). Helps with small or stylized script. The text is never translated.","required":false,"example":"Japanese","in":"query"}]}}},"components":{"schemas":{"Error":{"type":"object","required":["success","error"],"properties":{"success":{"const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["not_configured","unauthorized","not_found","method_not_allowed","invalid_request","rate_limited","url_not_allowed","target_blocked","target_unreachable","target_error","unsupported_content","too_large","timeout","upstream_error","board_not_found","app_not_found"]},"message":{"type":"string"},"retryable":{"type":"boolean","description":"true for rate_limited, timeout, upstream_error and browser_busy; false for other errors."},"retryAfterSeconds":{"type":"integer","description":"Seconds to wait before retrying, when a numeric Retry-After header is present."},"details":{"type":"object","additionalProperties":true}}}}}}}}