The Barcode Company API
One HTTP endpoint that turns a query string into a barcode image. URL-compatible with QuickChart's barcode API — change the hostname and existing code keeps working.
Playground
Build a request, see it render live, copy the URL or the equivalent curl/HTML snippet. Requests hit api.thebarcodecompany.xyz and count against its 60 req/min/IP limit.
Quick start
- 1Open this URL in your browser
https://api.thebarcodecompany.xyz/barcode?type=qrcode&text=hello - 2Use it directly in HTML
<img src="https://api.thebarcodecompany.xyz/barcode?type=code128&text=ABC-12345" /> - 3For production, email us for a dedicated endpoint.
Base URL
All requests are GET requests against:
https://api.thebarcodecompany.xyz
This is the only hostname that serves /barcode. Requests to other hosts (e.g. thebarcodecompany.xyz/barcode) return 410 Gone with a Location header pointing here. Customer-dedicated endpoints, when issued, live at https://<your-slug>.api.thebarcodecompany.xyz.
GET /barcode
Returns the generated barcode as an image. The body is binary PNG (default) or UTF-8 SVG.
GET /barcode?type={type}&text={text}&format={format}&width={width}&height={height}&scale={scale}&includeText={bool}&rotate={N|R|L|I}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| type | enum | yes | One of the 104 supported symbologies. See below. |
| text | string | yes* | The data to encode. URL-encoded. Max 4,096 characters. |
| data | string | yes* | Alias for text — TEC-IT compatibility. Provide either text or data (*at least one is required; text wins if both are set). |
| format | enum | no | png (default) or svg. |
| width | int | no | Output width hint in pixels. 1–4096. |
| height | int | no | Output height hint in pixels. 1–4096. |
| scale | int | no | Pixel-per-module multiplier. 1–20. Higher = sharper but larger files. |
| includeText | bool | no | Render the human-readable text below the bars. Applies to 1D codes only. |
| rotate | enum | no | N normal · R 90° right · L 90° left · I 180° inverted. |
Output formats
<img>. Crisp at the requested scale.Response headers
Content-Type
image/png · image/svg+xml
Cache-Control
public, max-age=31536000, immutable
ETag
SHA-1 of the canonicalised query — stable across identical requests.
X-RateLimit-Limit / X-RateLimit-Remaining
Current per-IP quota window.
Identical URLs are guaranteed to return identical bytes forever. Drop any CDN in front and your repeat traffic is free.
Errors
All errors return a JSON body of the shape:
{ "error": "<short message>" }
type, invalid numeric range, or oversized text.
Rate limiting
The public demo endpoint allows 60 requests per minute per IP. Customer endpoints are quoted with a rate limit matched to your workload (or unlimited, by arrangement). Cached responses served by a CDN don't reach us and don't count against the limit.
Symbologies
Every symbology BWIPP defines is supported. The full list of valid type values:
Examples
- QuickChart →
https://quickchart.io/barcode?type=...&text=... - TEC-IT →
https://barcode.tec-it.com/barcode.ashx?type=...&data=... - Us →
https://api.thebarcodecompany.xyz/barcode?type=...&text=...(`data=` also accepted)
$ curl "https://api.thebarcodecompany.xyz/barcode?type=qrcode&text=hello" -o qr.png
<img src="https://api.thebarcodecompany.xyz/barcode?type=code128&text=ABC-12345&includeText=true" alt="order code" />
const res = await fetch('https://api.thebarcodecompany.xyz/barcode?type=qrcode&text=hi');
const blob = await res.blob();
const url = URL.createObjectURL(blob);
img.src = url;
import requests
res = requests.get("https://api.thebarcodecompany.xyz/barcode",
params={"type": "datamatrix", "text": "hello", "scale": 4})
res.raise_for_status()
open("out.png", "wb").write(res.content)
export function Barcode({ type, text }) {
const q = new URLSearchParams({ type, text }).toString();
return <img src={`https://api.thebarcodecompany.xyz/barcode?${q}`} alt={text} />;
}
Changelog
- v0.1 Initial public docs. Drop-in QuickChart compat, 104 symbologies, PNG + SVG output, immutable cache headers.