API-referentie
Genereer programmatisch Code 128- en GS1-barcodes. Eenvoudige REST API met JSON-antwoorden en downloads van afbeeldingen.
Free: 100 req/dag
Business: 50.000 req/maand
Snelstart
curl"https://www.barcode-code128.com/api/barcode/render?value=HELLO-WORLD&format=PNG&resolution=300"--outputbarcode.png
Endpoints
GET
/api/barcode/render
Een barcodeafbeelding downloaden
| Parameter | Type | Standaard | Beschrijving |
|---|---|---|---|
| value | string | — | Vereist. De inhoud die in de barcode wordt gecodeerd. |
| 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 | Breedte van de barcodemodule in mm |
| barHeight | decimal | 25.4 | Streephoogte in mm |
| showText | bool | true | Voor mensen leesbare tekst onder de barcode tonen |
| foregroundColor | string | #000000 | Kleur van de streepjes (hex) |
| backgroundColor | string | #FFFFFF | Achtergrondkleur (hex) |
| barWidthReduction | decimal | 0 | Drukcorrectie in mm |
POST
/api/barcode/batch
Meerdere barcodes genereren als ZIP
Verstuur een JSON-body met een array van waarden. Retourneert een ZIP-bestand met één barcode per waarde.
{
"values": ["SKU-001", "SKU-002", "SKU-003"],
"symbology": "Code128Auto",
"format": "PNG",
"resolution": 300
}
POST
/api/gs1/render
GS1-barcode genereren uit gestructureerde data
Verstuur GS1 Application Identifier-velden. De API verzorgt de codering, FNC1-scheidingstekens en controlecijfers.
{
"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
Controleer uw huidige verbruik
{ "usedToday": 3, "dailyLimit": 5, "remaining": 2, "tier": "Free" }
Playground
Probeer de API live — registratie niet nodig.
progress_activity
api
Verstuur een verzoek om het resultaat hier te zien.
Codevoorbeelden
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)
);