BarcodeAPI.org API
Free barcode generator API with no key: Code128, EAN, UPC, QR, Code39, ITF and more as PNG or base64 JSON from a plain URL. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the BarcodeAPI.org API?
BarcodeAPI.org is a free, key-free barcode generation API. Requesting a path made of a symbology and the data to encode renders that data as a barcode image, supporting Code128, Code39, EAN-8, EAN-13, UPC-A, ITF, QR and several other symbologies.
Generating barcodes in-process means pulling in a rendering library, and the good ones tend to be Java or C. This API turns the whole job into a URL: the symbology is one path segment, the data is the next, and the response is the barcode. That is enough for labels, packing slips, inventory tags and internal tooling with no dependency at all.
The endpoint has two output modes worth knowing about. Request it with `Accept: image/png` and you get raw image bytes suitable for an `<img>` tag; request JSON, as the example below does, and you get an object with the PNG already base64-encoded plus the decoded text and the symbology that was used. The JSON form is the better fit for server-side templating and for embedding directly into an HTML data URI or a PDF.
Quick facts
- Base URL
https://barcodeapi.org/api- Authentication
- No API key or account. The service is open source and self-hostable via Docker for high-volume or offline use.
- Rate limit
- Per-IP throttling with a token bucket; limits are reported in `X-RateLimit-*` response headers.
- Pricing
- Free. Open source, with a Docker image for self-hosting.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the BarcodeAPI.org API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Generate a Code128 barcode for the text 'ByteTools'
GET https://barcodeapi.org/api/128/ByteTools
curl 'https://barcodeapi.org/api/128/ByteTools'const res = await fetch("https://barcodeapi.org/api/128/ByteTools");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://barcodeapi.org/api/128/ByteTools", timeout=20)
res.raise_for_status()
print(res.json()){
"base64": "iVBORw0KGgoAAAANSUhEUgAAAWwAAACoAQAAAADs6ukCAAAACXBIWXMAABcSAAAXEgFnn9JSAAAAEnRFWHRTb2Z0d2FyZQBCYXJjb2RlNEryjnYuAAABZklEQVR4Xu3TP07DMBQGcFcesiB5ZeINXKAnIIfpBWBjqORIDF0QWRm4C6k6eOEQQZXKiLMZyfLDgILi54g0A0Ol9y1J3vcbIv8RiOFsjfWbarfNuZUXyzXeibBy8jGIg3rCe9G1xcttWR0UohXMmTNnzpw5c+bMmTNnzpw5c+bMmTNnzpw58//gM8K8jyHflAtA9Do+v16O4GoeL2Zx2P1whO/PSb6fyfdhKb2KvMK2NBaSOuedv5ZWRi50A6ZRST3O2wVCEGWlTDXBjXVrvXtF8FegNmbzntSUC+Wc18ZFrgGMqdM64+Cs13XkDh/K/SQv/I3Xleh5k9aUwy7lLSR1xju/GvIwsTJduIz/jj0n+zrC5TxexIXEfiGfJ/gWI99+9NtUb5KaciFR+eMPQbwedZB2ceQRi5dIofTF7wEuk5ryGKCDQXIegE4Gybkv6WSQnJO/TTPCNZ0MMsLpYJic/5mT5p/fNciVDul5GAAAAABJRU5ErkJggg==",
"text": "ByteTools",
"type": "Code128",
"encoded": "ByteTools"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | path segment | Required | Symbology: `128` (Code128), `39`, `ean8`, `ean13`, `upca`, `itf`, `qr`, `codabar`, `auto` and others. 128 |
data | path segment | Required | The value to encode, URL-encoded. Fixed-length symbologies validate this — EAN-13 needs exactly 12 or 13 digits. ByteTools |
text | query | Optional | Override the human-readable text printed beneath the barcode. SKU-1234 |
height | query | Optional | Output height in pixels. Pairs with `width`. 200 |
dpi | query | Optional | Render density, which matters when the barcode is destined for print rather than a screen. 300 |
Response fields
base64string- The barcode PNG, base64-encoded. Prefix it with a PNG data-URI header to use it directly as an image source.
textstring- The human-readable text rendered beneath the barcode.
typestring- The symbology actually used — worth checking when you request `auto`, which picks a format based on the data.
encodedstring- The data as encoded into the symbol, after any padding or check digit the symbology requires.
(image mode)image/png- With `Accept: image/png` the response body is the raw PNG instead of this JSON object.
What you can build with the BarcodeAPI.org API
- Print barcode labels for warehouse or inventory items
- Add scannable SKUs to packing slips and invoices
- Generate EAN-13 codes for a retail product catalogue
- Embed a barcode in a server-rendered PDF via the base64 output
Common errors and how to fix them
400
The data does not fit the requested symbology.
Fix: Fixed-length formats are strict: EAN-13 requires 12 or 13 digits, UPC-A requires 11 or 12, and Code39 accepts a restricted character set. Use `128` or `auto` for arbitrary text.
429
Rate limited.
Fix: Read the `X-RateLimit-*` headers, cache generated barcodes — the same SKU always produces the same image — or self-host the Docker container.
404
Unknown symbology in the type segment.
Fix: Check the supported list; the path uses short codes such as `128` and `ean13`, not full names.
BarcodeAPI.org API — frequently asked questions
Is the barcode API free and does it need a key?
Yes, BarcodeAPI.org is free with no API key or account. It is open source and ships a Docker image, so you can self-host it for high-volume or offline generation.
Which barcode types are supported?
Code128, Code39, EAN-8, EAN-13, UPC-A, UPC-E, ITF, Codabar, QR and several others. An `auto` type is also available, which selects a symbology based on the data you pass.
How do I get a PNG instead of JSON?
Send `Accept: image/png` and the response body is the raw image, which means the URL works directly in an `<img>` tag. Requesting JSON instead returns the same image base64-encoded alongside the decoded text and symbology.
Can I use these barcodes for retail products?
The rendering is standards-compliant and scannable, but a retail EAN or UPC number must be assigned by GS1 — the API encodes whatever digits you give it and cannot allocate a legitimate product code for you.
Tools that pair with this API
Barcode Generator
Generate Code 128 barcodes online with checksum, adjustable bar width and height, optional text label, and PNG download. Free and fully private.
QR Code Generator
Create QR codes for URLs, Wi-Fi, email, phone and SMS. Pick size, colors and error correction, then download a crisp PNG — free and private.
Image to Base64 Converter
Convert an image to a Base64 data URL online. Get copy-ready HTML img tags and CSS background-image snippets. Free, instant and fully private.
BarcodeAPI.org is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.