# ISBN Validator API
> ISBN validation and conversion as an API, computed locally and deterministically. The validate endpoint detects whether a code is an ISBN-10 or an ISBN-13, ignores hyphens and spaces, and verifies the check digit — ISBN-10 with the mod-11 scheme whose last character may be the letter X (for 10), and ISBN-13 with the weighted 1-3-1-3 mod-10 scheme — so 0-306-40615-2 and 978-0-306-40615-7 both validate while a wrong check digit is rejected. The checkdigit endpoint computes the trailing check digit for a 9-digit ISBN-10 stem or a 12-digit ISBN-13 stem (and recomputes it for a full code). The convert endpoint converts between the two forms: an ISBN-10 becomes an ISBN-13 by prefixing 978 and recomputing the check, and a 978-prefixed ISBN-13 converts back to ISBN-10 (979-prefixed codes have no ISBN-10 equivalent). Everything is computed locally and deterministically, so it is instant and private. Ideal for publishing, library, bookstore, catalogue, e-commerce and metadata app developers, ISBN-validation and barcode tools, and inventory systems. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is ISBN-specific validation and conversion; for generic Luhn/Verhoeff check digits use a check-digit API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/isbn-api/..."
```

## Pricing
- **Free** (Free) — 8,500 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 85,000 calls/Mo, 6 req/s
- **Pro** ($10/Mo) — 370,000 calls/Mo, 15 req/s
- **Mega** ($32/Mo) — 1,900,000 calls/Mo, 40 req/s

## Endpoints

### ISBN

#### `GET /v1/checkdigit` — Compute check digit

**Parameters:**
- `isbn` (query, required, string) — 9-digit or 12-digit stem (or full ISBN) Example: `030640615`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isbn-api/v1/checkdigit?isbn=030640615"
```

**Response:**
```json
{
    "data": {
        "note": "ISBN-10 check digit (X means 10).",
        "type": "ISBN-10",
        "inputs": {
            "stem": "030640615"
        },
        "full_isbn": "0306406152",
        "check_digit": "2"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:13.991Z",
        "request_id": "29bf195d-e8c8-48e5-8d34-acba0b52b6d6"
    },
    "status": "ok",
    "message": "Compute check digit",
    "success": true
}
```

#### `GET /v1/convert` — Convert ISBN-10 ↔ 13

**Parameters:**
- `isbn` (query, required, string) — ISBN-10 or ISBN-13 Example: `0306406152`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isbn-api/v1/convert?isbn=0306406152"
```

**Response:**
```json
{
    "data": {
        "from": "ISBN-10",
        "note": "ISBN-10 → ISBN-13: prefix 978, drop the old check digit, recompute the mod-10 check.",
        "inputs": {
            "isbn": "0306406152"
        },
        "isbn10": "0306406152",
        "isbn13": "9780306406157"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:14.093Z",
        "request_id": "10db5505-5401-4764-b79e-5142db213495"
    },
    "status": "ok",
    "message": "Convert ISBN-10/13",
    "success": true
}
```

#### `GET /v1/validate` — Validate an ISBN

**Parameters:**
- `isbn` (query, required, string) — ISBN-10 or ISBN-13 (hyphens ok) Example: `978-0-306-40615-7`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isbn-api/v1/validate?isbn=978-0-306-40615-7"
```

**Response:**
```json
{
    "data": {
        "note": "ISBN-10 uses a mod-11 check (last char may be X); ISBN-13 uses a weighted mod-10 check. Hyphens and spaces are ignored.",
        "type": "ISBN-13",
        "valid": true,
        "inputs": {
            "isbn": "978-0-306-40615-7"
        },
        "normalized": "9780306406157"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:15.963Z",
        "request_id": "784ec90b-d813-46ab-9029-16dff202b2f5"
    },
    "status": "ok",
    "message": "Validate ISBN",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/isbn-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Hyphens and spaces are ignored. ISBN-10 check digit may be 'X' (=10). Only 978-prefixed ISBN-13 codes convert back to ISBN-10. For other check-digit schemes (Luhn, Verhoeff) use a check-digit API.",
        "service": "isbn-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/convert": "Convert between ISBN-10 and ISBN-13.",
            "GET /v1/validate": "Validate an ISBN-10 or ISBN-13.",
            "GET /v1/checkdigit": "Compute the check digit for a 9- or 12-digit stem."
        },
        "description": "ISBN-10 / ISBN-13 validation, check-digit calculation and conversion."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:16.059Z",
        "request_id": "24ff6315-98e1-43d5-9501-1efb358872d9"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/isbn-api
OpenAPI spec: https://www.oanor.com/api/isbn-api/openapi.json
