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"
Generate parameters
ParameterApplies toDescription
typerequiredOne of the thirteen types below.
datarequiredThe content to encode. URL-encode it.
formatallpng (default), svg, or pdf.
sizematrix typesEdge length in pixels (default 320).
heightlinear typesBar height in pixels (default 100).
widthlinear typesSingle-bar width in pixels (default 2).
ecqrError correction: L, M (default), Q, or H.
fg / bgallBar and background colors as hex; URL-encode the # (%23000000).
show_textlinear types1 renders the human-readable digits under the bars (default on).
bearer_barsitf-141 draws bearer bars (default on).
downloadall1 adds an attachment Content-Disposition so browsers save the file.

POST accepts the same fields as a JSON body.

Types

Supported symbologies
type=NameKindContent rules
qrQR CodematrixAny text or URL (up to 4296 chars)
ean-13EAN-13linear13 digits incl. check digit (or 12 to auto-complete)
ean-8EAN-8linear8 digits incl. check digit (or 7 to auto-complete)
upc-aUPC-Alinear12 digits incl. check digit (or 11 to auto-complete)
itf-14ITF-14linear14 digits incl. check digit (or 13 to auto-complete)
code-128Code 128linearAny ASCII text
code-39Code 39linearA-Z, 0-9, space, - . $ / + %
code-93Code 93linearA-Z, 0-9, space, - . $ / + %
codabarCodabarlinear0-9 and - $ : / . +
2of52-of-5 (standard)linearDigits only
datamatrixData MatrixmatrixAny text (up to ~1500 chars)
aztecAztecmatrixAny text (up to ~3000 chars)
pdf-417PDF417matrixAny 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.