API reference

Extract text

Read text out of a scan, photo or screenshot, with per-word confidence.

POST /v1/ocr/extract1 operation per image

The programmatic form of Read text in the dashboard — same models, same allowance.

Request

multipart/form-data, with your key as a bearer token.

FieldTypeDefaultDescription
imagerequiredfileJPEG, PNG or WebP.
languagestringenISO 639-1 language hint. Only the first two characters are used.

Example

curl -X POST https://api.quantilence.com/v1/ocr/extract \
  -H "Authorization: Bearer $QUANTILENCE_API_KEY" \
  -F "image=@photo.jpg" \
  -F "language=en"

Response

200 OK with this shape. Values below are illustrative; the keys and types are not.

{
  "success": true,
  "full_text": "INVOICE\nAcme Ltd\nTotal: $1,240.00",
  "blocks": [
    {
      "block_id": 1,
      "text": "INVOICE",
      "confidence": 0.976,
      "words": [
        {
          "text": "INVOICE",
          "confidence": 0.976,
          "bbox": [
            0.081,
            0.052,
            0.243,
            0.094
          ]
        }
      ]
    }
  ],
  "language": "en",
  "processing_time_ms": 412.7
}
FieldTypeDescription
successbooleanAlways true on a 200.
full_textstringEvery block joined with newlines.
blocksBlock[]Text grouped as the page lays it out.
blocks[].block_idintegerStable within one response.
blocks[].textstringThe block's words, space-joined.
blocks[].confidencefloatMean word confidence, 0–1.
blocks[].wordsWord[]Individual words with boxes.
blocks[].words[].textstringOne word.
blocks[].words[].confidencefloat0–1.
blocks[].words[].bboxfloat[4][x1, y1, x2, y2], normalised 0–1 against the image.
languagestringThe hint that was applied.
processing_time_msfloatModel time, excluding transfer.

Worth knowing

  • Boxes are normalised 0–1, so they map onto any rendered size by multiplying by width and height.
  • A page with no readable text returns 200 with an empty `blocks` array, not an error.