The Barcode Company Contact us
API Reference

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.

Open in new tab ↗
Click Generate to render

Quick start

  1. 1
    Open this URL in your browser
    https://api.thebarcodecompany.xyz/barcode?type=qrcode&text=hello
  2. 2
    Use it directly in HTML
    <img src="https://api.thebarcodecompany.xyz/barcode?type=code128&text=ABC-12345" />
  3. 3
    For 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

format=png
Default. Binary PNG body. Best for web embedding via <img>. Crisp at the requested scale.
format=svg
UTF-8 SVG string. Best for print and large displays — scales to any resolution losslessly.

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>" }
400 Missing required param, unknown type, invalid numeric range, or oversized text.
429 Per-IP rate limit exceeded.
500 Unexpected render failure. Logged on our side — feel free to email us with the failing URL.

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

Migrating from another service?
Change only the hostname. Our parameter vocabulary covers both QuickChart and TEC-IT shapes:
  • 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
$ curl "https://api.thebarcodecompany.xyz/barcode?type=qrcode&text=hello" -o qr.png
HTML <img>
<img src="https://api.thebarcodecompany.xyz/barcode?type=code128&text=ABC-12345&includeText=true" alt="order code" />
JavaScript (fetch)
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;
Python
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)
React
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.