API குறிப்பு
நிரல்வழியாக Code 128 மற்றும் GS1 பார்கோடுகளை உருவாக்கலாம். JSON பதில்கள் மற்றும் படங்களைப் பதிவிறக்கும் வசதியுடன் கூடிய எளிய REST API.
Free: 100 req/நாள்
Business: 50,000 req/மாதம்
விரைவு தொடக்கம்
curl"https://www.barcode-code128.com/api/barcode/render?value=HELLO-WORLD&format=PNG&resolution=300"--outputbarcode.png
எண்ட்பாயிண்ட்கள்
GET
/api/barcode/render
பார்கோடு படத்தை பதிவிறக்கவும்
| அளவுரு | வகை | இயல்புநிலை | விளக்கம் |
|---|---|---|---|
| value | string | — | கட்டாயம். என்கோட் செய்ய வேண்டிய பார்கோடு உள்ளடக்கம். |
| 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 இல்) |
| barHeight | decimal | 25.4 | பார் உயரம் (mm இல்) |
| showText | bool | true | பார்கோடின் கீழ் வாசிக்கக்கூடிய உரையைக் காட்டு |
| foregroundColor | string | #000000 | பார் நிறம் (hex) |
| backgroundColor | string | #FFFFFF | பின்னணி நிறம் (hex) |
| barWidthReduction | decimal | 0 | அச்சு திருத்தம் (mm இல்) |
POST
/api/barcode/batch
பல பார்கோடுகளை ZIP ஆக உருவாக்கவும்
மதிப்புகளின் வரிசையைக் கொண்ட JSON கோரிக்கை உடலை அனுப்பவும். ஒவ்வொரு மதிப்புக்கும் ஒரு பார்கோடு உள்ள ZIP கோப்பை API வழங்கும்.
{
"values": ["SKU-001", "SKU-002", "SKU-003"],
"symbology": "Code128Auto",
"format": "PNG",
"resolution": 300
}
POST
/api/gs1/render
கட்டமைப்புத் தரவிலிருந்து GS1 பார்கோடை உருவாக்கவும்
GS1 Application Identifier புலங்களை அனுப்பவும். என்கோடிங், FNC1 பிரிப்பான்கள் மற்றும் சரிபார்ப்பு இலக்கங்களை API கையாளும்.
{
"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
தற்போதைய பயன்பாட்டைச் சரிபார்க்கவும்
{ "usedToday": 3, "dailyLimit": 5, "remaining": 2, "tier": "Free" }
பிளேகிரவுண்ட்
API-ஐ நேரலையில் சோதிக்கவும் — பதிவு தேவையில்லை.
progress_activity
api
முடிவை இங்கே காண கோரிக்கையை அனுப்பவும்.
குறியீடு எடுத்துக்காட்டுகள்
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)
);