# Barcode API
> Generate barcodes as PNG images — EAN-13, EAN-8, UPC-A/E, Code 128, Code 39, ITF-14, ISBN and 2D codes (QR, Data Matrix, PDF417, Aztec) — returned as base64 or a raw image, with adjustable size and human-readable text. Fully server-side. Perfect for retail, inventory, shipping labels, ticketing and asset tracking.

## 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/barcode-api/..."
```

## Pricing
- **Free** (Free) — 8,000 calls/Mo, 3 req/s
- **Basic** ($6/Mo) — 120,000 calls/Mo, 12 req/s
- **Pro** ($19/Mo) — 650,000 calls/Mo, 40 req/s
- **Mega** ($54/Mo) — 3,000,000 calls/Mo, 120 req/s

## Endpoints

### Barcode

#### `GET /v1/generate` — Barcode as base64 PNG

**Parameters:**
- `text` (query, required, string) — Barcode value Example: `4006381333931`
- `type` (query, optional, string) — code128 ean13 upca qrcode … Example: `ean13`
- `scale` (query, optional, string) — Scale 1-8
- `height` (query, optional, string) — Bar height 1-60

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/barcode-api/v1/generate?text=4006381333931&type=ean13"
```

**Response:**
```json
{
    "data": {
        "text": "4006381333931",
        "type": "ean13",
        "bytes": 4828,
        "base64": "iVBORw0KGgoAAAANSUhEUgAAAR4AAAB+CAYAAADySn44AAAAHnRFWHRTb2Z0d2FyZQBid2lwLWpzLm1ldGFmbG9vci5jb21Tnbi0AAASeUlEQVR4nO2cB8gsxRKFf8WMmDAhZsxgQMyICTNmzBhBFMWAgqJiVswYQcEEBkyYFRNmUQSzYs45Ys5pHme4Pczdf2e2ZqtO3e19VbC8593Z76+ZOnWmp7t3JyYmJor0qkfTvzdF/fiuTMnfauJr/paGaZWP5Hy7HiPJp+vxjJpqzisXppU2PPOUcLR6mGA0CkOkVsW0Mg+GuDTXRJJn12vb9W9pzndcmVba8MxTwtHqIYwnjIdSO3aj5MK00oZnnhKOVg9hPGE8lNqxGyUXppU2PPOUcLR6COMJ46HUjt0ouTCttOGZp4Sj1UMYTxgPpXbsRsmFaaUNzzwlHK0ewnjCeCi1YzdKLkwrbXjmKeFo9RDGE8ZDqR27UXJhWmnDM08JR6uHMJ4wHkrt2I2SC9NKG555SjhaPYTxhPFQasdulFyYVtrwzFPC0eohjCeMh1I7dqPkwrTShmeeEo5WD2E8YTyU2rEbJRemlTY885RwtHoI4wnjodSO3Si5MK204ZmnhKPVQxhPGA+lduxGyYVppQ3PPCUcrR7CeMJ4KLVjN0ouTCtteOYp4Wj1EMYTxkOpHbtRcmFaacMzTwlHq4cwnjAeSu3YjZIL00obnnlKOFo9hPGE8VBqx26UXJhW2vDMU8LR6iGMJ4yHUjt2o+TCtNKGZ54SjlYPYTxhPJTasRslF6aVNjzzlHC0egjjCeOh1I7dKLkwrbThmaeEo9VDGE8YD6V27EbJhWmlDc88JRytHsJ4wngotWM3Si5MK2145inhaPUQxhPGQ6kdu1FyYVppwzNPCUerhzCeMB5K7diNkgvTShueeUo4Wj2E8YTxUGrHbpRcmFba8MxTwtHqIYwnjIdSO3aj5MK00oZnnhKOVg9hPGE8lNqxGyUXppU2PPOUcLR6COMJ46HUjt0ouTCttOGZp4Sj1UMYTxgPpXbsRsmFaaUNzzwlHK0ewnjCeCi1YzdKLkwrbXjmKeFo9RDGE8ZDqR27UXJhWmnDM08JR6uHMJ4wHkrt2I2SC9NKG555SjhaPYTxhPFQasdulFyYVtrwzFPC0eohjCeMh1I7dqPkwrTShmeeEo5WD2E8YTyU2rEbJRemlTY885RwtHoI4wnjodSO3Si5MK204ZmnhKPVQxhPGA+lduxGyYVppQ3PPCUcrR7CeMJ4KLVjN0ouTCtteOYp4Wj1EMYTxkOpHbtRcmFaacMzTwlHq4cwnjAeSu3YjZIL00obnnlKOFo9hPGE8VBqx26UXJhW2vDMU8LR6iGMJ4yHUjt2
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/image` — Raw PNG image

**Parameters:**
- `text` (query, required, string) — Barcode value Example: `OANOR-001`
- `type` (query, optional, string) — Symbology Example: `code128`
- `scale` (query, optional, string) — Scale 1-8
- `height` (query, optional, string) — Bar height 1-60

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/barcode-api/v1/image?text=OANOR-001&type=code128"
```

#### `GET /v1/types` — Supported symbologies

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

**Response:**
```json
{
    "data": {
        "count": 13,
        "types": [
            {
                "id": "code128",
                "description": "Code 128 (general purpose, any ASCII)"
            },
            {
                "id": "code39",
                "description": "Code 39 (alphanumeric)"
            },
            {
                "id": "ean13",
                "description": "EAN-13 (retail, 12-13 digits)"
            },
            {
                "id": "ean8",
                "description": "EAN-8 (small retail, 7-8 digits)"
            },
            {
                "id": "upca",
                "description": "UPC-A (US retail, 11-12 digits)"
            },
            {
                "id": "upce",
                "description": "UPC-E (compressed UPC, 6-8 digits)"
            },
            {
                "id": "itf14",
                "description": "ITF-14 (shipping cartons, 13-14 digits)"
            },
            {
                "id": "interleaved2of5",
                "description": "Interleaved 2 of 5 (even-length digits)"
            },
            {
                "id": "isbn",
                "description": "ISBN (books)"
            },
            {
                "id": "qrcode",
                "description": "QR Code (2D)"
            },
            {
                "id": "datamatrix",
                "description": "Data Matrix (2D)"
            },
            {
                "id": "pdf417",
                "description": "PDF417 (2D, do
…(truncated, see openapi.json for full schema)
```


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