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).
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 320). |
height | linear types | Bar height in pixels (default 100). |
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 | Any ASCII text |
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.
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.
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.
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 · 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.
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.