---
title: "API Docs"
description: "API reference for the free barcode generator: generate, validate, decode and batch endpoints, all 13 symbologies, parameters, and rate limits."
canonical: "https://barcode.donaldmurillo.com/docs"
og_title: "API Docs — Spike & Luna's Barcode Generator"
og_description: "API reference for the free barcode generator: generate, validate, decode and batch endpoints, all 13 symbologies, parameters, and rate limits."
og_image: "https://barcode.donaldmurillo.com/brand/og-image.png"
twitter_card: "summary_large_image"
twitter_title: "API Docs — Spike & Luna's Barcode Generator"
schema_types:
  - "BreadcrumbList"
---

# API Docs

## Route

- **Path:** `/docs`
- **Type:** page

---

## Page Content

# API docs

Five endpoints under https://barcode.donaldmurillo.com/api. The anonymous tier needs no key; errors come back as JSON.

## Generate

GET or POST /api/generate returns the image bytes directly (image/png, image/svg+xml, or application/pdf).

copycopied

```
curl -o barcode.png "https://barcode.donaldmurillo.com/api/generate?type=qr&data=Hello&size=320"
```

| Parameter | Applies to | Description |
| --- | --- | --- |
| `type` | required | One of the thirteen types below. |
| `data` | required | The content to encode. URL-encode it. |
| `format` | all | png (default), svg, or pdf. |
| `size` | matrix types | Edge length in pixels (default 300). |
| `height` | linear types | Bar height in pixels (default 60; 50 for code-39 and codabar). |
| `width` | linear types | Single-bar width in pixels (default 2). |
| `ec` | qr | Error correction: L, M (default), Q, or H. |
| `fg / bg` | all | Bar and background colors as hex; URL-encode the # (%23000000). |
| `show_text` | linear types | 1 renders the human-readable digits under the bars (default on). |
| `bearer_bars` | itf-14 | 1 draws bearer bars (default on). |
| `download` | all | 1 adds an attachment Content-Disposition so browsers save the file. |

POST accepts the same fields as a JSON body.

## Types

| type= | Name | Kind | Content rules |
| --- | --- | --- | --- |
| `qr` | QR Code | matrix | Any text or URL (up to 4296 chars) |
| `ean-13` | EAN-13 | linear | 13 digits incl. check digit (or 12 to auto-complete) |
| `ean-8` | EAN-8 | linear | 8 digits incl. check digit (or 7 to auto-complete) |
| `upc-a` | UPC-A | linear | 12 digits incl. check digit (or 11 to auto-complete) |
| `itf-14` | ITF-14 | linear | 14 digits incl. check digit (or 13 to auto-complete) |
| `code-128` | Code 128 | linear | ASCII; {TAB}, {FNC1}, \t \xHH escapes |
| `code-39` | Code 39 | linear | A-Z, 0-9, space, - . $ / + % |
| `code-93` | Code 93 | linear | A-Z, 0-9, space, - . $ / + % |
| `codabar` | Codabar | linear | 0-9 and - $ : / . + |
| `2of5` | 2-of-5 (standard) | linear | Digits only |
| `datamatrix` | Data Matrix | matrix | Any text (up to ~1500 chars) |
| `aztec` | Aztec | matrix | Any text (up to ~3000 chars) |
| `pdf-417` | PDF417 | matrix | Any text (up to ~1800 chars) |

## Validate

GET or POST /api/validate checks content against a type's rules before you print anything. GS1 types entered with one digit missing come back auto-completed.

copycopied

```
curl "https://barcode.donaldmurillo.com/api/validate?type=ean-13&data=400638133393"
```

```
{"valid": true, "message": "auto-completed check digit", "corrected": "4006381333931", "country_code": "Germany"}
```

## Decode

POST /api/decode reads a code back out of an image: send the raw image as the body, or JSON {"image": "<base64>"} with an optional format hint. Returns the recognized format and text.

copycopied

```
curl -X POST --data-binary @label.png -H "Content-Type: image/png" "https://barcode.donaldmurillo.com/api/decode"
```

```
{"success": true, "format": "ean-13", "text": "4006381333931"}
```

## Batch

POST /api/batch turns a CSV, Excel or JSON list into a ZIP of generated codes — up to 10,000 items per request. Send the file raw, or as a multipart upload in a "file" field. Required columns are type and data; filename and format are optional.

copycopied

```
curl -o barcodes.zip -X POST --data-binary @items.csv "https://barcode.donaldmurillo.com/api/batch"
```

```
[
  {"type":"qr","data":"https://barcode.donaldmurillo.com","filename":"site.png"},
  {"type":"ean-13","data":"4006381333931","filename":"sku-a.png"},
  {"type":"code-128","data":"ORDER-9241","filename":"order.svg","format":"svg"}
]
```

Sample files: [batch.csv](/samples/batch.csv) · [batch.json](/samples/batch.json)

## Keys and rate limits

Anonymous requests are free and rate-limited per IP; every response carries X-RateLimit-* headers so clients can pace themselves. Registered API keys get defined daily quotas — send the key as X-API-Key or Authorization: Bearer on the same endpoints under /api/v1/. GET /api/spec returns the type and format lists as JSON.

Versioning: keyed endpoints carry the API version in the URL path (/v1/). A breaking change ships as /api/v2 while /api/v1 keeps working through a deprecation window; the anonymous /api surface only changes additively.

[Get an API key](/dashboard)

## Machine-readable

For tools and AI agents rather than people: the OpenAPI schema, the llms.txt index, and an MCP endpoint (Streamable HTTP) with generate, validate, decode and spec tools.

[openapi.json](/openapi.json)[llms.txt](/llms.txt)[Ways to use it](/uses)
