# Image to text (OCR)

Read the printed text in a photo, scan or screenshot and get it back as plain text, in 12 languages.

Finds the printed text in a picture and returns it as text and as a .txt file. Small pictures are enlarged and dark pictures are inverted first, because that makes the letters easier to read.

- Endpoint: `POST https://setget.net/v1/tools/ocr-image` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `ocr-image`
- Page: https://setget.net/tools/ocr-image

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `image` (required, file, a file reference such as `DROP_ID/f1`, accepts image): A picture that shows printed or on-screen text: PNG, JPEG, WebP, TIFF, BMP or GIF.
- `language` (optional, string, one of `eng`, `deu`, `fra`, `spa`, `ita`, `por`, `nld`, `nor`, `swe`, `dan`, `pol`, `rus`, default `"eng"`): Language of the text: eng (English), deu (German), fra (French), spa (Spanish), ita (Italian), por (Portuguese), nld (Dutch), nor (Norwegian), swe (Swedish), dan (Danish), pol (Polish), rus (Russian).
- `format` (optional, string, one of `text`, `paragraphs`, `words`, default `"text"`): text keeps the lines as they are in the picture. paragraphs puts each paragraph on one line. words also lists every word with its position and confidence.
- `layout` (optional, string, one of `auto`, `single_column`, `single_block`, `single_line`, `sparse`, default `"auto"`): How the text is arranged: auto works it out, single_column is one column of text, single_block is one even block, single_line is one line, sparse is scattered words such as labels on a photo or diagram.
- `invert` (optional, string, one of `auto`, `yes`, `no`, default `"auto"`): Swap light and dark before reading. auto does it when the picture is mostly dark, such as a dark-mode screenshot.

## Example 1: Read a scanned note

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample-scan.png](https://setget.net/static/samples/sample-scan.png).

```json
{"input":{"image":"DROP_ID/f1"},"wait":30}
```

## Example 2: Get every word with its position

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample-scan.png](https://setget.net/static/samples/sample-scan.png).

```json
{"input":{"image":"DROP_ID/f1","format":"words","layout":"single_block"},"wait":30}
```

**Which languages can it read?** English, German, French, Spanish, Italian, Portuguese, Dutch, Norwegian, Swedish, Danish, Polish, Russian. Choose the language of the text: accented and special letters are only read correctly with the right one.

**How do I get the best result?** Use a sharp, straight, evenly lit picture in which the letters are at least 20 pixels tall. Crop away everything that is not text. Screenshots and flat scans read best; photos taken at an angle read worst.

**Can it read handwriting?** No. It reads printed and on-screen text. Handwriting usually comes out as nonsense.

**What does the confidence number mean?** How sure the reader is, from 0 to 100, averaged over all words. Above 85 is usually almost error-free. Below 60, check the text carefully.

**What does the "words" format give me?** A JSON file listing every word with its position in the picture in pixels (left, top, width, height), its line number and its confidence, as well as the plain text.

**Is my picture kept?** No. It is read on our server and removed with the result when the download link expires.
