# IsManga API

The API translates one manga image per request.
Most images finish in under 4 seconds, so one call usually returns the finished translation.

Translations are paid from your API balance, which is separate from the Premium subscription and Credits in the IsManga apps.
A translation that fails is refunded.
[Top up your balance](https://ismanga.com/api-service/pricing) any time.

Questions?
Email [support@ismanga.com](mailto:support@ismanga.com).

## Create an API key

1. Open your [API settings](https://ismanga.com/settings/api).
2. Enter a name for the key and select Create Key.
3. Copy the key right away. It is shown only once.

The same page shows your balance and has a Recent Jobs tab with your 20 newest translations: which key made each one, how long it took, what it cost and the image it got.

## Authentication

Send the key on every request, as a bearer token.
Keys are for your own server.
The API sends no CORS headers, so a page in a browser cannot call it with a key.

```
Authorization: Bearer $YOUR_ISMANGA_API_KEY
```

## Quick start

Create the translation with `wait`, and read `result` from the answer.
`wait` holds the call until the image is done, for up to 20 seconds.
Most images finish in under 4 seconds, so the answer is usually the finished job.

**cURL**

```bash
curl -X POST "https://api.ismanga.com/v1/manga/translations?wait=20" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: chapter-12-image-3-en" \
  -d '{"imageUrl": "https://example.com/image.jpg", "sourceLang": "ja-JP", "targetLang": "en-US"}'
```

**Node.js**

```javascript
const response = await fetch("https://api.ismanga.com/v1/manga/translations?wait=20", {
    method: "POST",
    headers: {
        Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}`,
        "Content-Type": "application/json",
        "Idempotency-Key": "chapter-12-image-3-en",
    },
    body: JSON.stringify({
        imageUrl: "https://example.com/image.jpg",
        sourceLang: "ja-JP",
        targetLang: "en-US",
    }),
});
const job = await response.json();
```

**Python**

```python
import os
import requests

response = requests.post(
    "https://api.ismanga.com/v1/manga/translations?wait=20",
    headers={
        "Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}",
        "Idempotency-Key": "chapter-12-image-3-en",
    },
    json={
        "imageUrl": "https://example.com/image.jpg",
        "sourceLang": "ja-JP",
        "targetLang": "en-US",
    },
)
job = response.json()
```

If `status` is still "queued" or "processing", get the job with `wait` until it is "succeeded" or "failed".

**cURL**

```bash
curl "https://api.ismanga.com/v1/manga/translations/<id>?wait=20" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY"
```

**Node.js**

```javascript
const pollResponse = await fetch(`https://api.ismanga.com/v1/manga/translations/${job.id}?wait=20`, {
    headers: { Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}` },
});
const polledJob = await pollResponse.json();
```

**Python**

```python
response = requests.get(
    f"https://api.ismanga.com/v1/manga/translations/{job['id']}?wait=20",
    headers={"Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}"},
)
job = response.json()
```

If you can't keep a request open for 20 seconds, leave out `wait` and get the job again every few seconds until it is done.

## Endpoints

Every path is relative to `https://api.ismanga.com`.

### Create a translation

POST /v1/manga/translations

**Request (cURL, Image URL)**

```bash
curl -X POST "https://api.ismanga.com/v1/manga/translations?wait=20" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"imageUrl": "https://example.com/image.jpg", "sourceLang": "ja-JP", "targetLang": "en-US"}'
```

**Request (Node.js, Image URL)**

```javascript
const response = await fetch("https://api.ismanga.com/v1/manga/translations?wait=20", {
    method: "POST",
    headers: {
        Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}`,
        "Content-Type": "application/json",
    },
    body: JSON.stringify({
        imageUrl: "https://example.com/image.jpg",
        sourceLang: "ja-JP",
        targetLang: "en-US",
    }),
});
console.log(await response.json());
```

**Request (Python, Image URL)**

```python
import os
import requests

response = requests.post(
    "https://api.ismanga.com/v1/manga/translations?wait=20",
    headers={"Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}"},
    json={
        "imageUrl": "https://example.com/image.jpg",
        "sourceLang": "ja-JP",
        "targetLang": "en-US",
    },
)
print(response.json())
```

**Request (cURL, Base64 image)**

```bash
curl -X POST "https://api.ismanga.com/v1/manga/translations?wait=20" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"image\": \"$(base64 < image.jpg | tr -d '\n')\", \"sourceLang\": \"ja-JP\", \"targetLang\": \"en-US\"}"
```

**Request (Node.js, Base64 image)**

```javascript
import { readFile } from "node:fs/promises";

const response = await fetch("https://api.ismanga.com/v1/manga/translations?wait=20", {
    method: "POST",
    headers: {
        Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}`,
        "Content-Type": "application/json",
    },
    body: JSON.stringify({
        image: (await readFile("image.jpg")).toString("base64"),
        sourceLang: "ja-JP",
        targetLang: "en-US",
    }),
});
console.log(await response.json());
```

**Request (Python, Base64 image)**

```python
import base64
import os
import requests

with open("image.jpg", "rb") as file:
    image = base64.b64encode(file.read()).decode()

response = requests.post(
    "https://api.ismanga.com/v1/manga/translations?wait=20",
    headers={"Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}"},
    json={"image": image, "sourceLang": "ja-JP", "targetLang": "en-US"},
)
print(response.json())
```

Translates one manga image.

#### Headers

- `Authorization` string: `Bearer` and your API key.
- `Content-Type` string: `application/json`.
- `Idempotency-Key` string, optional: 1 to 255 visible ASCII characters. A retry with the same key and body within 24 hours returns the original job and is not billed again.

#### Query parameters

- `wait` integer, optional: Seconds to hold the request until the job is done, from 0 to 20.

#### Body

- `imageUrl` string: A public http or https URL of the image, within the [image limits](https://ismanga.com/docs/api#image-limits). Send `imageUrl` or `image`.
- `image` string: The image as raw base64 or a data URL, within the [image limits](https://ismanga.com/docs/api#image-limits). Send `image` or `imageUrl`.
- `sourceLang` string: The language of the text in the image, such as ja-JP.
- `targetLang` string: The language to translate into, such as en-US.

#### Responses

- `200` OK: A [job object](https://ismanga.com/docs/api#job) with `status` "succeeded" or "failed". The job finished within `wait` seconds.
- `202` Accepted: A [job object](https://ismanga.com/docs/api#job) with `status` "queued" or "processing". Get it again with `wait` until it is done.
- `400` Bad Request: A [request error](https://ismanga.com/docs/api#error) with `invalid_request`, `invalid_image` or `image_unavailable`.
- `402` Payment Required: A [request error](https://ismanga.com/docs/api#error) with `insufficient_balance`.

Other answers are in [Errors](https://ismanga.com/docs/api#errors).

**Response 200**

```json
{
    "id": "8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1",
    "status": "succeeded",
    "sourceLang": "ja-JP",
    "targetLang": "en-US",
    "createdAt": "2026-11-03T10:00:00.000Z",
    "completedAt": "2026-11-03T10:00:03.412Z",
    "charged": 0.001,
    "result": {
        "imageWidth": 800,
        "imageHeight": 1200,
        "regions": [
            {
                "x": 10,
                "y": 20,
                "width": 30,
                "height": 40,
                "detectedSourceLang": "ja-JP",
                "sourceText": "こんにちは",
                "translatedText": "Hello",
                "inpaintedImageUrl": "https://example.com/region.jpg",
                "textColor": "rgb(0, 0, 0)",
                "backgroundColor": "rgb(255, 255, 255)"
            }
        ]
    },
    "error": null
}
```

**Response 202**

```json
{
    "id": "8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1",
    "status": "queued",
    "sourceLang": "ja-JP",
    "targetLang": "en-US",
    "createdAt": "2026-11-03T10:00:00.000Z",
    "completedAt": null,
    "charged": 0.001,
    "result": null,
    "error": null
}
```

**Response 400**

```json
{
    "error": {
        "code": "invalid_request",
        "message": "sourceLang: Unsupported source language",
        "requestId": "req_3f9a1c2b7d4e4b8a9c0d1e2f3a4b5c6d"
    }
}
```

**Response 402**

```json
{
    "error": {
        "code": "insufficient_balance",
        "message": "Your API balance is too low for this translation. Top up your balance to keep translating.",
        "requestId": "req_3f9a1c2b7d4e4b8a9c0d1e2f3a4b5c6d"
    }
}
```

### Get a translation

GET /v1/manga/translations/{id}

**Request (cURL)**

```bash
curl "https://api.ismanga.com/v1/manga/translations/8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1?wait=20" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY"
```

**Request (Node.js)**

```javascript
const response = await fetch("https://api.ismanga.com/v1/manga/translations/8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1?wait=20", {
    headers: { Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}` },
});
console.log(await response.json());
```

**Request (Python)**

```python
import os
import requests

response = requests.get(
    "https://api.ismanga.com/v1/manga/translations/8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1?wait=20",
    headers={"Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}"},
)
print(response.json())
```

Returns one job from this account.

#### Headers

- `Authorization` string: `Bearer` and your API key.

#### Path parameters

- `id` string: The job's `id`.

#### Query parameters

- `wait` integer, optional: Seconds to hold the request until the job is done, from 0 to 20.

#### Responses

- `200` OK: A [job object](https://ismanga.com/docs/api#job). With `wait`, it comes once the job is done or after `wait` seconds.
- `404` Not Found: A [request error](https://ismanga.com/docs/api#error) with `not_found`. The job does not exist on this account.

**Response 200**

```json
{
    "id": "8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1",
    "status": "succeeded",
    "sourceLang": "ja-JP",
    "targetLang": "en-US",
    "createdAt": "2026-11-03T10:00:00.000Z",
    "completedAt": "2026-11-03T10:00:03.412Z",
    "charged": 0.001,
    "result": {
        "imageWidth": 800,
        "imageHeight": 1200,
        "regions": [
            {
                "x": 10,
                "y": 20,
                "width": 30,
                "height": 40,
                "detectedSourceLang": "ja-JP",
                "sourceText": "こんにちは",
                "translatedText": "Hello",
                "inpaintedImageUrl": "https://example.com/region.jpg",
                "textColor": "rgb(0, 0, 0)",
                "backgroundColor": "rgb(255, 255, 255)"
            }
        ]
    },
    "error": null
}
```

**Response 404**

```json
{
    "error": {
        "code": "not_found",
        "message": "Not found.",
        "requestId": "req_3f9a1c2b7d4e4b8a9c0d1e2f3a4b5c6d"
    }
}
```

### Balance

GET /v1/manga/balance

**Request (cURL)**

```bash
curl "https://api.ismanga.com/v1/manga/balance" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY"
```

**Request (Node.js)**

```javascript
const response = await fetch("https://api.ismanga.com/v1/manga/balance", {
    headers: { Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}` },
});
console.log(await response.json());
```

**Request (Python)**

```python
import os
import requests

response = requests.get(
    "https://api.ismanga.com/v1/manga/balance",
    headers={"Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}"},
)
print(response.json())
```

Returns your API balance.

#### Headers

- `Authorization` string: `Bearer` and your API key.

#### Responses

- `200` OK: Your balance.
  - `balance` number: Your API balance, in US dollars.
  - `translationPrice` number: The price of one translation, in US dollars.
- `401` Unauthorized: A [request error](https://ismanga.com/docs/api#error) with `unauthorized`. The API key is missing or not valid.

When the balance is lower than `translationPrice`, creating a translation answers 402 until you [top up](https://ismanga.com/api-service/pricing).

**Response 200**

```json
{
    "balance": 12.4975,
    "translationPrice": 0.001
}
```

**Response 401**

```json
{
    "error": {
        "code": "unauthorized",
        "message": "Missing or invalid API key.",
        "requestId": "req_3f9a1c2b7d4e4b8a9c0d1e2f3a4b5c6d"
    }
}
```

### Languages

GET /v1/manga/languages

**Request (cURL)**

```bash
curl "https://api.ismanga.com/v1/manga/languages" \
  -H "Authorization: Bearer $YOUR_ISMANGA_API_KEY"
```

**Request (Node.js)**

```javascript
const response = await fetch("https://api.ismanga.com/v1/manga/languages", {
    headers: { Authorization: `Bearer ${process.env.YOUR_ISMANGA_API_KEY}` },
});
console.log(await response.json());
```

**Request (Python)**

```python
import os
import requests

response = requests.get(
    "https://api.ismanga.com/v1/manga/languages",
    headers={"Authorization": f"Bearer {os.environ['YOUR_ISMANGA_API_KEY']}"},
)
print(response.json())
```

Lists the language codes the API accepts.

#### Headers

- `Authorization` string: `Bearer` and your API key.

#### Responses

- `200` OK: The language codes.
  - `sourceLangs` array: The codes you can send as `sourceLang`.
  - `targetLangs` array: The codes you can send as `targetLang`.
- `401` Unauthorized: A [request error](https://ismanga.com/docs/api#error) with `unauthorized`. The API key is missing or not valid.

**Response 200**

```json
{
    "sourceLangs": ["ja-JP", "ko-KR", "zh-CN", "en-US"],
    "targetLangs": ["en-US", "es-ES", "fr-FR", "de-DE", "pt-PT"]
}
```

**Response 401**

```json
{
    "error": {
        "code": "unauthorized",
        "message": "Missing or invalid API key.",
        "requestId": "req_3f9a1c2b7d4e4b8a9c0d1e2f3a4b5c6d"
    }
}
```

## Objects

### Job

- `id` string: The job's ID.
- `status` string: "queued", "processing", "succeeded" or "failed".
- `sourceLang` and `targetLang` string: The languages you sent.
- `createdAt` and `completedAt` string: ISO 8601 times. `completedAt` is null until the job is done.
- `charged` number: What the job cost from your balance, in US dollars. Null once the job failed.
- `error` object: Set once the job failed. Getting the job still returns 200, so this is not a [request error](https://ismanga.com/docs/api#error). A failed job is refunded.
  - `code` string: "invalid_image" if the image can't be used, or "translation_failed" if you can try again.
  - `message` string: What went wrong.
- `result` object: Set once the job succeeded.
  - `imageWidth` and `imageHeight` integer: The size of the original image.
  - `regions` array: One item per text region. Empty when the image has no text, which is still charged.
    - `x`, `y`, `width` and `height` integer: The region in the original image, in pixels.
    - `sourceText` and `translatedText` string: The text found and its translation.
    - `detectedSourceLang` string: The `sourceLang` you sent.
    - `inpaintedImageUrl` string: The region with its text removed. Place it over the region, then fit `translatedText` into it. Anyone with the URL can open it until it is deleted.
    - `textColor` and `backgroundColor` string: CSS `rgb()` colors.

Any field of `result` can be null, for example `inpaintedImageUrl` when that image could not be saved.
IsManga does not keep your image.

**Response**

```json
{
    "id": "8c6b1d52-4f1e-4a53-9a0f-2c43f3c4f8a1",
    "status": "succeeded",
    "sourceLang": "ja-JP",
    "targetLang": "en-US",
    "createdAt": "2026-11-03T10:00:00.000Z",
    "completedAt": "2026-11-03T10:00:03.412Z",
    "charged": 0.001,
    "result": {
        "imageWidth": 800,
        "imageHeight": 1200,
        "regions": [
            {
                "x": 10,
                "y": 20,
                "width": 30,
                "height": 40,
                "detectedSourceLang": "ja-JP",
                "sourceText": "こんにちは",
                "translatedText": "Hello",
                "inpaintedImageUrl": "https://example.com/region.jpg",
                "textColor": "rgb(0, 0, 0)",
                "backgroundColor": "rgb(255, 255, 255)"
            }
        ]
    },
    "error": null
}
```

### Request error

A request that fails answers with a 4xx or 5xx status and one `error` object.
This is not the `error` of a failed [job](https://ismanga.com/docs/api#job), which comes back with a 200.

- `code` string: One of the codes in [Errors](https://ismanga.com/docs/api#errors).
- `message` string: What went wrong. When the body is not valid, it names every field that failed, separated by "; ".
- `requestId` string: The same value as the `X-Request-Id` header, which is on every response. Include it when you contact support.

**Response**

```json
{
    "error": {
        "code": "insufficient_balance",
        "message": "Your API balance is too low for this translation. Top up your balance to keep translating.",
        "requestId": "req_3f9a1c2b7d4e4b8a9c0d1e2f3a4b5c6d"
    }
}
```

## Errors

When a request fails, its [request error](https://ismanga.com/docs/api#error) has one of these codes.

| Status | Code                | Meaning                                                                                                                         |
| ------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `invalid_request`   | The body, a query parameter or the `Idempotency-Key` header is not acceptable, or `imageUrl` is not a public http or https URL. |
| 400    | `invalid_image`     | The image is not a PNG, JPEG or WebP of at most 5 MB and 2,000 pixels on each side.                             |
| 400    | `image_unavailable` | The image at `imageUrl` could not be fetched. Check that the URL works without signing in.                                      |
| 401    | `unauthorized`      | The API key is missing or not valid.                                                                                            |
| 402 | `insufficient_balance` | Your API balance is lower than the price of a translation, or the balance is below zero. Top up, then try again. |
| 404 | `not_found` | That translation does not exist on this account, or the path is unknown. |
| 409 | `idempotency_conflict` | This Idempotency-Key was already used for a different request. |
| 413 | `payload_too_large` | The request body is over 8 MB. |
| 429 | `rate_limited` | Too many requests. Wait for the time in [`Retry-After`](https://ismanga.com/docs/api#request-limits). |
| 429 | `too_many_concurrent_jobs` | This account already has 8 translations in progress. Wait for one to finish. |
| 500 | `internal_error` | The server failed while handling the request. The request id is in the body. |
| 503 | `service_unavailable` | The translation service did not accept the job, or API pricing is not available. It was not billed. |

## Limits

Limits are for your whole account, shared by all its API keys.

### Translation limits

| Limit | Value |
| ----- | ----- |
| Translations in progress at once | 8 |
| Longest wait on one request | 20 seconds |

### Data retention

| Data | Kept for |
| ---- | -------- |
| Jobs and results | 24 hours |
| Inpainted region images | 1 to 2 days |

### Image limits

| Limit | Value |
| ----- | ----- |
| Format | PNG, JPEG or WebP |
| File size | 5 MB |
| Width and height | 2,000 pixels on each side |
| Image URL | Public http or https on port 80 or 443, up to 2048 characters, 3 redirects and 10 seconds |
| Request body | 8 MB |

### Request limits

Every request counts against the IP address limit.
Creating a translation is also limited by how many translations can be in progress at once.

| Limit | Counts | Per minute |
| ----- | ------ | ---------- |
| IP address | Every request from that IP address, across all accounts and keys, even with a wrong API key | 300 |

A request over the limit gets a 429 `rate_limited` error with a `Retry-After` header, the number of seconds to wait before trying again.
