---
title: "Read the text in a picture or PDF"
method: POST
path: "/v1/ocr"
tags: ["OCR"]
---

# Read the text in a picture or PDF

`POST /v1/ocr`

## Request

- Base URL: `https://api.dharun.dev`
- URL: `https://api.dharun.dev/v1/ocr`
- Auth: none declared

Returns the text, Tesseract's confidence and, with words=true, every word with its box. A PDF is read up to 10 pages at a time at 300 dpi; a PDF that already holds text is read faster by /v1/pdf/text. Options go in the query string, or as form fields when the file is sent as multipart/form-data.

## Query parameters

- `lang` string
- `words` 'true' | 'false'
- `first` integer
- `last` integer

## Response `200`

Success

- Envelope
  - `data` unknown, required
  - `meta` object, required
    - `limit` integer
    - `note` string
    - `offset` integer
    - `source` object: Where the data came from and the credit its licence asks for.
      - `attribution` string
      - `licence` string
      - `name` string
      - `retrieved` string
      - `url` string
      - `version` string
    - `total` integer

## Other responses

- `400`: Error
- `404`: Error
- `413`: Error
- `429`: Error

---

[API](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data.md) · [All operations](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/llms.txt) · [OpenAPI document](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/revisions/ecd8b0ec7863?raw)
