API-Referenz
Code 128- und GS1-Barcodes programmatisch erstellen. Einfache REST-API mit JSON-Antworten und Bild-Downloads.
Free: 100 Anfr./Tag
Business: 50.000 Anfr./Monat
Schnellstart
curl"https://www.barcode-code128.com/api/barcode/render?value=HELLO-WORLD&format=PNG&resolution=300"--outputbarcode.png
Endpunkte
GET
/api/barcode/render
Barcode-Bild herunterladen
| Parameter | Typ | Standard | Beschreibung |
|---|---|---|---|
| value | string | — | Erforderlich. Der zu codierende Barcode-Inhalt. |
| symbology | string | Code128Auto | Code128Auto, Code128A, Code128B, Code128C, GS1_128, GS1_DataMatrix, GS1_QR |
| format | string | PNG | PNG, SVG, PDF, EPS |
| resolution | int | 300 | DPI: 150, 300, 600, 1200 |
| xDimension | decimal | 0.33 | Modulbreite in mm |
| barHeight | decimal | 25.4 | Strichhöhe in mm |
| showText | bool | true | Klarschriftzeile unter dem Barcode anzeigen |
| foregroundColor | string | #000000 | Strichfarbe (hex) |
| backgroundColor | string | #FFFFFF | Hintergrundfarbe (hex) |
| barWidthReduction | decimal | 0 | Druckkorrektur in mm |
POST
/api/barcode/batch
Mehrere Barcodes als ZIP erstellen
Senden Sie einen JSON-Body mit einem Array von Werten. Gibt eine ZIP-Datei mit einem Barcode pro Wert zurück.
{
"values": ["SKU-001", "SKU-002", "SKU-003"],
"symbology": "Code128Auto",
"format": "PNG",
"resolution": 300
}
POST
/api/gs1/render
GS1-Barcode aus strukturierten Daten erstellen
Senden Sie Felder mit GS1-Datenbezeichnern. Die API übernimmt Codierung, FNC1-Trennzeichen und Prüfziffern.
{
"fields": [
{ "ai": "01", "value": "05412345000013" },
{ "ai": "10", "value": "LOT-A23" },
{ "ai": "17", "value": "260731" }
],
"symbology": "GS1_128",
"format": "PNG",
"resolution": 300
}
GET
/api/barcode/quota
Aktuelle Nutzung abfragen
{ "usedToday": 3, "dailyLimit": 5, "remaining": 2, "tier": "Free" }
Playground
API live testen – keine Registrierung erforderlich.
progress_activity
api
Senden Sie eine Anfrage, um das Ergebnis hier zu sehen.
Code-Beispiele
cURL
curl "https://www.barcode-code128.com\ /api/barcode/render\ ?value=SKU-4711\ &format=PNG\ &resolution=300" \ --output barcode.png
Python
import requests
resp = requests.get(
"https://www.barcode-code128.com"
"/api/barcode/render",
params={
"value": "SKU-4711",
"format": "PNG",
"resolution": 300
}
)
with open("barcode.png", "wb") as f:
f.write(resp.content)
Node.js
const fs = require('fs');
const url = new URL(
"https://www.barcode-code128.com"
+ "/api/barcode/render"
);
url.searchParams.set("value", "SKU-4711");
url.searchParams.set("format", "PNG");
url.searchParams.set("resolution", "300");
const resp = await fetch(url);
const buf = await resp.arrayBuffer();
fs.writeFileSync(
"barcode.png",
Buffer.from(buf)
);