Welcome to BarcodeAPI.org,
By simply hitting our HTTP/S endpoint you can quickly add barcodes to virtually any
application using an intuitive and easy to use barcode generation API, no signup required!
Our API supports a wide array of barcode formats and offers extensive customization
options to meet your specific needs.
Join the thousands of businesses who rely on BarcodeAPI.org!
The BarcodeAPI server can generate barcodes for virtually any content passed to the API endpoint. As a RESTful HTTP service, you can make requests using a web browser, command line tools, or other methods, depending on your application’s needs.
HTML
Embed barcode images directly in an HTML page:
<img src="https://barcodeapi.org/api/auto/test" />
JavaScript
Use fetch to request a barcode and display it on the current page, while printing
the remaining token count to the console:
let url = 'https://barcodeapi.org/api/auto/Try%20Me'
fetch(url, { cache: "no-store" })
.then(response => {
var tokens = response.headers.get('X-RateLimit-Tokens');
console.log("Tokens remaining: " + tokens);
response.blob().then(blob => {
var img = document.createElement("img");
img.src = URL.createObjectURL(blob);
document.body.appendChild(img);
});
});
Excel
Render barcode images directly into Excel, referencing data which exists in the document:
Using: https://barcodeapi.org/api/
Config: fg=ff0000&bg=0000ff
Barcode Text Type
TryMe 128 =IMAGE(B1&B4&"/"&A4&"?"&B2)
TryMe qr =IMAGE(B1&B5&"/"&A5&"?"&B2)
TryMe dm =IMAGE(B1&B6&"/"&A6&"?"&B2)
=IMAGE("https://barcodeapi.org/api/TryMe")
Markdown
Add barcode images to markdown documents:

curl / wget
Download barcodes in a linux command line environment:
curl https://barcodeapi.org/api/A_Barcode > test.png wget -o test.png https://barcodeapi.org/api/A_Barcode
PowerShell
Generate barcodes using Windows PowerShell automation:
Invoke-WebRequest ` https://barcodeapi.org/api/auto/test -OutFile test.png
Python
Request and save a barcode to disk using Python:
import shutil
import requests
url = 'https://barcodeapi.org/api/auto/Try%20Me'
response = requests.get(url, stream=True)
with open('test.png', 'wb') as out_file:
shutil.copyfileobj(response.raw, out_file)
BarcodeAPI supports a wide range of barcode types, allowing you to generate barcodes for different use cases, such as inventory tracking, product labeling, or QR codes for marketing. For a complete list of available types, please refer to Barcode Types
You have two methods for selecting the barcode format: manual type selection and automatic type detection. Each approach offers distinct benefits, with manual selection giving you precise control over the format, while automatic detection offers convenience and flexibility by letting the API choose the most appropriate format for your data.
If you know exactly which barcode format you need, you can specify it directly in the
URL. This gives you full control over the barcode type, ensuring that you get the format that best
fits your requirements.
/api/128/abc123
/api/qr/abc123
If you don’t want to specify a barcode format, you can let the API automatically
determine the best format based on the data you provide. The API will analyze the content and choose
the most suitable format.
/api/auto/abc123
BarcodeAPI allows you to customize various aspects of your barcodes to fit your specific needs. Whether you're adjusting the size, color, or other visual properties, the API provides a range of customization options for each barcode type. For a full list of available options, check the Barcode Types page.
Customization options are added to your request as GET parameters. By appending these
parameters to your request URL, you can modify the appearance and behavior of the generated barcode.
These options can include things like barcode foreground color, background color, height, width, and
more.
Example
/api/128/RED?fg=ff0000&bg=ffffff&height=12
Some barcodes support the encoding of NonPrinting ASCII characters. With a supported barcode type selected, click to open the character keyboard which will assist in inserting non-printing characters.
Visit NonPrinting
Some users need to generate a lot of barcodes; for this we provide two different tools.
Users wishing to generate a large number of barcodes may wish to use the Bulk Barcode generator. This utility will allow the upload of a CSV containing the barcode requests, and will return a ZIP file containing each of the barcodes.
Visit Bulk Generator
Some users may wish to generate a large number of barcodes with one request - a basic JavaScript utility is provided at /multi.html which will generate as many images as requested then prepare the file to be printed.
Visit Multi Generator
The server makes a number of headers available which describe the result of the request.
The server will add several headers related to the barcode including the type and encoded contents.
$ curl --head https://barcodeapi.org/api/auto/abc123 ... Content-Type: image/png X-Barcode-Type: Code128 X-Barcode-Content: abc123 Content-Disposition: filename=abc123.png
In an attempt to minimize the number of requests, barcodes requested outside of the webapp will have a cache expiration time set.
$ curl --head https://barcodeapi.org/api/auto/abc123 ... Access-Control-Max-Age: 86400 Cache-Control: max-age=86400, public Expires: Sat, 04 Jan 2025 06:57:14 GMT
The server will add several headers related to the rate limiter applied to the client.
$ curl --head https://barcodeapi.org/api/auto/abc123 ... X-RateLimit-Cost: 2 X-RateLimit-Tokens: 2032.40
Should a client become rate limited, requests will result in a 429. Users must wait until new tokens are generated before additional requests will be served.
$ curl --head https://barcodeapi.org/api/auto/abc123 HTTP/1.1 429 Too Many Requests ... X-Error-Message: Client is rate limited, try again later.
The server provides a set of static resources served from the root url of the server, in the event a request is made which is not targeted directly at the API nor references a known resources, a 403 redirect will be provided to send the send request to the API handler.
$ curl --head https://barcodeapi.org/abc123 HTTP/1.1 302 Found ... Location: https://barcodeapi.org/api/auto/abc123
In the event of a render error, an additional header [X-Error-Message] will be available containing details about the exception.
$ curl --head https://barcodeapi.org/api/8/00000009 HTTP/1.1 409 Conflict ... X-Error-Message: Expected checksum: 0
Each type of application failure will result in a unique error code.
400 EMPTY The request was empty. 400 INVALID Invalid data for selected code type. 403 BLACKLIST The request was rejected. 409 CHECKSUM Expected checksum: # 429 LIMITED Client is rate limited, try again later. 500 FAILED Failed to render barcode. 503 BUSY Server is busy, please try again.
To ensure optimal service for all users, we implement rate limiting and offer tiered pricing plans for high-volume users. While the FREE tier should meet basic usage needs, some users may require higher limits for larger volumes of barcode requests.
If you need higher rate limits, you can upgrade to one of our paid plans. Each plan is flexible and can accommodate varying token usage levels to suit your needs.
Don't worry, none of the barcodes we show you in the docs count against your rate limit!
For additional details, visit Rate Limits
Rate limits are enforced based on the IP address of the client making the request. If you plan to generate a large number of barcodes from a central server or location, you will need an API key to manage your rate limits effectively.
This key should be included in your requests when numerous IP addresses will be making requests to the API.
If you have an API key, include it in the Authorization header with each request. The token should be passed as follows:
Authorization: Token=xxxxxxxxxxxx
Note: When embedding barcodes in an application accessed by end users, do not include the API key in client-side requests. Rate limits will be managed at the IP level instead, so no API key is needed for each user.
Users of the web interface are assigned a session token for basic history tracking. By
default, your browser will pass this token along with each request. Sessions will generally expire
several days after last use, but may also be deleted from the server cache on request.
To view the details of your current session, visit Session Info
Still looking for additional information or support?
Send us an email! Our team will respond as soon as possible.
Please refer to Contact & Support
support@barcodeapi.org