> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> API reference for OCR Web Service: every `ocrwebservice.api.*` operation with input and output types.

Every `ocrwebservice.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

<Info>
  **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).
</Info>

## Account

### getCredentials

`account.getCredentials`

Extract the OCR Web Service username from stored credentials

**Risk:** `read`

```ts theme={null}
await corsair.ocrwebservice.api.account.getCredentials({});
```

**Input:** *empty object*

**Output**

| Name        | Type     | Required | Description |
| ----------- | -------- | -------- | ----------- |
| `user_name` | `string` | Yes      | —           |

***

### getInformation

`account.getInformation`

Retrieve remaining pages, subscription plan, and expiration date

**Risk:** `read`

```ts theme={null}
await corsair.ocrwebservice.api.account.getInformation({});
```

**Input:** *empty object*

**Output**

| Name                 | Type     | Required | Description |
| -------------------- | -------- | -------- | ----------- |
| `ErrorMessage`       | `string` | No       | —           |
| `AvailablePages`     | `number` | No       | —           |
| `MaxPages`           | `number` | No       | —           |
| `LastProcessingTime` | `string` | No       | —           |
| `SubcriptionPlan`    | `string` | No       | —           |
| `ExpirationDate`     | `string` | No       | —           |

***

### log

`account.log`

Retrieve OCR processing logs for a date range

**Risk:** `read`

```ts theme={null}
await corsair.ocrwebservice.api.account.log({});
```

**Input**

| Name        | Type       | Required | Description |
| ----------- | ---------- | -------- | ----------- |
| `from_date` | `string`   | Yes      | —           |
| `to_date`   | `string`   | Yes      | —           |
| `reserved`  | `string[]` | No       | —           |

**Output**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `data` | `string` | Yes      | —           |

***

## Ocr

### recognize

`ocr.recognize`

OCR an image or document via REST processDocument

**Risk:** `write`

```ts theme={null}
await corsair.ocrwebservice.api.ocr.recognize({});
```

**Input**

| Name           | Type      | Required | Description |
| -------------- | --------- | -------- | ----------- |
| `file`         | `custom`  | Yes      | —           |
| `language`     | `string`  | Yes      | —           |
| `pagerange`    | `string`  | No       | —           |
| `tobw`         | `boolean` | No       | —           |
| `zone`         | `string`  | No       | —           |
| `outputformat` | `string`  | No       | —           |
| `gettext`      | `boolean` | No       | —           |
| `getwords`     | `boolean` | No       | —           |
| `newline`      | `boolean` | No       | —           |
| `description`  | `string`  | No       | —           |

**Output**

| Name              | Type         | Required | Description |
| ----------------- | ------------ | -------- | ----------- |
| `ErrorMessage`    | `string`     | No       | —           |
| `AvailablePages`  | `number`     | No       | —           |
| `ProcessedPages`  | `number`     | No       | —           |
| `OCRText`         | `string[][]` | No       | —           |
| `OutputFileUrl`   | `string`     | No       | —           |
| `TaskDescription` | `string`     | No       | —           |
| `Reserved`        | `any[]`      | No       | —           |

***
