Barcode Generator API
Integrate barcode generation directly into your applications with our powerful API.
API Overview
Our RESTful API allows you to generate barcodes programmatically with simple HTTP requests. The API supports all major barcode formats and customization options.
Base URL
https://api.rootgamez.site/barcode
Authentication
All API requests require an API key sent in the header:
Authorization: Bearer YOUR_API_KEY
API Endpoints
Generate Barcode
POST
/v1/generate
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
text | string | Yes | The data to encode in the barcode |
format | string | No | Barcode format (default: CODE128) |
width | integer | No | Width of bars (default: 2) |
height | integer | No | Height of barcode (default: 100) |
displayValue | boolean | No | Show text below barcode (default: true) |
fontSize | integer | No | Font size of text (default: 16) |
margin | integer | No | Margin around barcode (default: 10) |
background | string | No | Background color (default: #ffffff) |
lineColor | string | No | Barcode color (default: #000000) |
output | string | No | Output format (svg or png, default: svg) |
Example Request
cURL
curl -X POST https://api.rootgamez.site/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"API-EXAMPLE-123","format":"CODE128","width":2,"height":100}'
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"API-EXAMPLE-123","format":"CODE128","width":2,"height":100}'
Example Response
{
"success": true,
"data": {
"image": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAgMTAwIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMCAyMC4uLiIgc3Ryb2tlPSIjMDAwIi8+PHRleHQgeD0iMTAwIiB5PSI5MCIgZm9udC1mYW1pbHk9IkFyaWFsIiBmb250LXNpemU9IjE2IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5BUEktRVhBTVBMRS0xMjM8L3RleHQ+PC9zdmc+",
"download_url": "https://api.rootgamez.site/download/abc123.svg"
}
}
"success": true,
"data": {
"image": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAgMTAwIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMCAyMC4uLiIgc3Ryb2tlPSIjMDAwIi8+PHRleHQgeD0iMTAwIiB5PSI5MCIgZm9udC1mYW1pbHk9IkFyaWFsIiBmb250LXNpemU9IjE2IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5BUEktRVhBTVBMRS0xMjM8L3RleHQ+PC9zdmc+",
"download_url": "https://api.rootgamez.site/download/abc123.svg"
}
}
Rate Limits
To ensure fair usage and maintain service quality, the following rate limits apply:
Plan | Requests/Min | Requests/Day | Concurrent |
---|---|---|---|
Free | 10 | 1,000 | 2 |
Basic | 30 | 10,000 | 5 |
Pro | 100 | 50,000 | 20 |
Enterprise | Custom | Custom | Custom |
Exceeding these limits will result in 429 Too Many Requests responses. Upgrade your plan for higher limits.
API Quick Start
1. Get Your API Key
Sign up for an account and generate your API key in the dashboard.
Get API Key2. Make Your First Request
Test the API with this simple example:
fetch('https://api.rootgamez.site/v1/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'TEST-123',
format: 'CODE128'
})
})
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'TEST-123',
format: 'CODE128'
})
})
3. Handle the Response
The API returns the barcode as base64-encoded SVG or PNG data, along with a direct download URL.
Client Libraries
Available for popular languages:
API Status
All systems operational