Barcode Generator
Generate barcodes in multiple industry-standard formats. Returns a raw PNG image or base64-encoded JSON, supporting Code 128, Code 93, Code 39, EAN-8, and EAN-13.
Vue d'ensemble
Cas d'utilisation
- Product labeling and inventory management
- Retail point-of-sale systems
- Shipping and logistics labels
- Library and asset tracking systems
- Event ticketing and check-in workflows
Fonctionnalités
Points de terminaison de l'API
Generate Barcode (PNG)
Returns a raw PNG image of the barcode. Ideal for direct embedding or file download.
https://requiems.xyz/v1/technology/barcode
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| data | string |
Requis | The text or numeric string to encode in the barcode |
| type | string |
Requis | Barcode format: code128, code93, code39, ean8, ean13 |
Essayez-le
Démo en directRequête
The text or numeric string to encode in the barcode
Barcode format: code128, code93, code39, ean8, ean13
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| (binary) | bytes |
Raw PNG image bytes. Content-Type is image/png. |
Exemples de code
# Save a Code 128 barcode as PNG
curl "https://requiems.xyz/v1/technology/barcode?data=123456789&type=code128" \
-H "requiems-api-key: YOUR_API_KEY" \
--output barcode.png
# Save an EAN-13 barcode (12 digits, checksum auto-calculated)
curl "https://requiems.xyz/v1/technology/barcode?data=123456789012&type=ean13" \
-H "requiems-api-key: YOUR_API_KEY" \
--output barcode.png
import requests
url = "https://requiems.xyz/v1/technology/barcode"
headers = {"requiems-api-key": "YOUR_API_KEY"}
params = {"data": "123456789", "type": "code128"}
response = requests.get(url, headers=headers, params=params)
with open("barcode.png", "wb") as f:
f.write(response.content)
const params = new URLSearchParams({
data: '123456789',
type: 'code128'
});
const response = await fetch(
`https://requiems.xyz/v1/technology/barcode?${params}`,
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const blob = await response.blob();
const imgUrl = URL.createObjectURL(blob);
require 'net/http'
uri = URI('https://requiems.xyz/v1/technology/barcode')
uri.query = URI.encode_www_form(data: '123456789', type: 'code128')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
File.write('barcode.png', response.body, mode: 'wb')
Réponses d'erreur
bad_request
Missing or invalid parameters (e.g. data not provided, unsupported type)
unprocessable_entity
Data is invalid for the chosen barcode type (e.g. wrong digit count for EAN-8/EAN-13, non-numeric EAN data)
Generate Barcode (Base64 JSON)
Returns a JSON envelope containing the barcode as a base64-encoded PNG string, along with its type and dimensions.
https://requiems.xyz/v1/technology/barcode/base64
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| data | string |
Requis | The text or numeric string to encode in the barcode |
| type | string |
Requis | Barcode format: code128, code93, code39, ean8, ean13 |
Essayez-le
Démo en directRequête
The text or numeric string to encode in the barcode
Barcode format: code128, code93, code39, ean8, ean13
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| image | string |
Base64-encoded PNG image data |
| type | string |
The barcode format that was used |
| width | integer |
Width of the generated image in pixels |
| height | integer |
Height of the generated image in pixels |
Exemples de code
curl "https://requiems.xyz/v1/technology/barcode/base64?data=123456789&type=code128" \
-H "requiems-api-key: YOUR_API_KEY"
import requests
url = "https://requiems.xyz/v1/technology/barcode/base64"
headers = {"requiems-api-key": "YOUR_API_KEY"}
params = {"data": "123456789", "type": "code128"}
response = requests.get(url, headers=headers, params=params)
result = response.json()["data"]
print(f"Image (base64): {result['image'][:40]}...")
const params = new URLSearchParams({
data: '123456789',
type: 'code128'
});
const response = await fetch(
`https://requiems.xyz/v1/technology/barcode/base64?${params}`,
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const { data } = await response.json();
// Use as an <img> src
document.getElementById('barcode').src = `data:image/png;base64,${data.image}`;
require 'net/http'
require 'json'
uri = URI('https://requiems.xyz/v1/technology/barcode/base64')
uri.query = URI.encode_www_form(data: '123456789', type: 'code128')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)['data']
puts data['image'][0..39] + '...'
Réponses d'erreur
bad_request
Missing or invalid parameters (e.g. data not provided, unsupported type)
unprocessable_entity
Data is invalid for the chosen barcode type (e.g. wrong digit count for EAN-8/EAN-13, non-numeric EAN data)
Generate Barcodes (Batch)
Generate up to 20 barcodes in a single request. Each barcode is processed independently and results are returned in the same order as the input. Invalid items do not fail the entire request.
https://requiems.xyz/v1/technology/barcode/batch
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| items | array<object> |
Requis | Array of barcode generation requests. Min: 1, Max: 20. |
Essayez-le
Démo en directRequête
Array of barcode generation requests. Min: 1, Max: 20.
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| results | array<object> |
List of barcode generation results preserving input order |
| results[].image | string |
Base64-encoded PNG image |
| results[].type | string |
Barcode format used |
| results[].width | integer |
Image width in pixels |
| results[].height | integer |
Image height in pixels |
| results[].success | boolean |
Whether barcode generation succeeded |
| results[].error | string |
Error message when generation fails |
| total | integer |
Number of items processed |
Exemples de code
curl -X POST https://requiems.xyz/v1/technology/barcode/batch \
-H "requiems-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"data": "123456789",
"type": "code128"
},
{
"data": "HELLO",
"type": "code93"
}
]
}'
import requests
url = "https://requiems.xyz/v1/technology/barcode/batch"
response = requests.post(
url,
headers={
"requiems-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"items": [
{
"data": "123456789",
"type": "code128"
},
{
"data": "HELLO",
"type": "code93"
}
]
}
)
print(response.json())
const response = await fetch(
'https://requiems.xyz/v1/technology/barcode/batch',
{
method: 'POST',
headers: {
'requiems-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
data: '123456789',
type: 'code128'
},
{
data: 'HELLO',
type: 'code93'
}
]
})
}
);
const { data } = await response.json();
console.log(data.results);
require 'net/http'
require 'json'
uri = URI('https://requiems.xyz/v1/technology/barcode/batch')
request = Net::HTTP::Post.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
items: [
{
data: '123456789',
type: 'code128'
},
{
data: 'HELLO',
type: 'code93'
}
]
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
Réponses d'erreur
Valid request body that fails validation (empty items array, more than 20 items, missing data field, or unsupported barcode type).
Invalid JSON or malformed request body.
Unexpected server error.