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 ఫైల్ను అందిస్తుంది.
{
"values": ["SKU-001", "SKU-002", "SKU-003"],
"symbology": "Code128Auto",
"format": "PNG",
"resolution": 300
}
POST
/api/gs1/render
స్ట్రక్చర్డ్ డేటా నుండి GS1 బార్కోడ్ రూపొందించండి
GS1 Application Identifier ఫీల్డ్లను పంపండి. API ఎన్కోడింగ్, FNC1 సెపరేటర్లు మరియు చెక్ డిజిట్లను నిర్వహిస్తుంది.
{
"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)
);