API Referansı
Code 128 ve GS1 barkodlarını programatik olarak oluşturun. JSON yanıtları ve görsel indirmeleri sunan basit REST API.
Free: 100 istek/gün
Business: 50.000 istek/ay
Hızlı Başlangıç
curl"https://www.barcode-code128.com/api/barcode/render?value=HELLO-WORLD&format=PNG&resolution=300"--outputbarcode.png
Uç Noktalar
GET
/api/barcode/render
Barkod görseli indirin
| Parametre | Tür | Varsayılan | Açıklama |
|---|---|---|---|
| value | string | — | Zorunlu. Kodlanacak barkod içeriği. |
| 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 | mm cinsinden çubuk modül genişliği |
| barHeight | decimal | 25.4 | mm cinsinden çubuk yüksekliği |
| showText | bool | true | Barkodun altında okunabilir metni göster |
| foregroundColor | string | #000000 | Çubuk rengi (hex) |
| backgroundColor | string | #FFFFFF | Arka plan rengi (hex) |
| barWidthReduction | decimal | 0 | mm cinsinden baskı düzeltmesi |
POST
/api/barcode/batch
Çoklu barkodları ZIP olarak oluşturun
Değerler dizisi içeren bir JSON gövdesi gönderin. Değer başına bir barkod içeren bir ZIP dosyası döndürür.
{
"values": ["SKU-001", "SKU-002", "SKU-003"],
"symbology": "Code128Auto",
"format": "PNG",
"resolution": 300
}
POST
/api/gs1/render
Yapılandırılmış verilerden GS1 barkodu oluşturun
GS1 Uygulama Tanımlayıcı alanlarını gönderin. API; kodlama, FNC1 ayırıcıları ve kontrol basamaklarını yönetir.
{
"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
Mevcut kullanımınızı kontrol edin
{ "usedToday": 3, "dailyLimit": 5, "remaining": 2, "tier": "Free" }
Deneme Alanı
API'yi canlı deneyin — kayıt gerekmez.
progress_activity
api
Sonucu burada görmek için bir istek gönderin.
Kod Örnekleri
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)
);