The heart of our system is an intuitive barcode generation API that prioritizes ease of use and
flexibility. With a straightforward HTTP endpoint, you can quickly integrate our barcodes into
virtually any application, requiring nothing more than an internet connection.
Our API supports a wide array of barcode formats and offers extensive customization options to meet
your specific needs. To ensure fair usage and reliable performance, we implement rate limits based
on the complexity of your requests.
Join the thousands who rely on BarcodeAPI.org for their barcode generation needs.
To ensure that we are able to provide the best service for all users we have implemented Rate
Limiting and tiered pricing plans for our power users.
Our FREE tier should be sufficient for basic use, however some users may not find this limit
sufficient for their needs. Please visit Rate Limits
for additional details on our pricing plans.
API tokens are granted to our paying customers and are used when demand exceedes our FREE tier.
To upgrade your account, visit Usage Contracts
If you have been issued an API token, it should be attached to each request as an Authorization header.
Authorization: Token=xxxxxxxxxxxx
The server will generate a barcode for nearly any content passed to the API
endpoint.
Based on a RESTful HTTP server, requests can be made using a web browser, on the command
line, or a number of other methods depending on the needs of your application.
curl https://barcodeapi.org/api/A_Barcode > test.png
wget -o test.png https://barcodeapi.org/api/A_Barcode
Invoke-WebRequest ` https://barcodeapi.org/api/auto/test -OutFile test.png
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)
<img src="https://barcodeapi.org/api/auto/test" />
let url = 'https://barcodeapi.org/api/auto/Try%20Me' fetch(url, { cache: "no-store" }) .then(response => { var tokens = response.headers.get('x-ratelimit-tokens'); document.getElementById("token_count").innerHTML = tokens; response.blob().then(blob => { var imgBlob = URL.createObjectURL(blob); document.getElementById('barcode_image').src = imgBlob; }); });
A detailed list of barcode formats available to be rendered by this server can
be viewed at the Barcode Types page. This
page is a graphical representation of the [/types] API endpoint.
Each barcode type will provide it's token cost for both basic and custom barcodes
generated in the given format.
The API offers two types of barcode type selection, automatic or manual; users of the web-based interface might prefer the barcode type be selected based on what they type, while direct callers of the API might want to have control over which barcode format they will receive back from the server.
A specific barcode type may be requested by using the type string in the request URL.
https://barcodeapi.org/api/128/abc123 https://barcodeapi.org/api/qr/abc123
When calling the API endpoint without specifying an explicit code type the server will make its best judgment as to which code type will be best suited for the supplied data.
https://barcodeapi.org/api/abc123 https://barcodeapi.org/api/auto/abc123
Each barcode type provides a number of customization options that may be passed along with the request. The supported options for each barcode can be viewed on the associated Types page.
Barcode options are simply added to each request as a GET parameter.
/api/dm/test?fg=ff0000
Some barcodes support the encoding of NonPrinting ASCII 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.
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
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 ... Location: https://barcodeapi.org/api/auto/abc123
The server will add several headers related to the rate limit.
$ curl --head https://barcodeapi.org/api/auto/abc123 ... X-RateLimit-Cost: 2 X-RateLimit-Tokens: 2032.40
In an attempt to minimize the number of requests, barcodes requested outside of the webapp will have a cache expiration time set.
Cache-Control: max-age=86400, public
In the event of a render error, an additional header will be available containing details about the exception.
X-Error-Message: (exception.toString())
Did we miss something?
Please send us an email.
We will respond as soon as possible.
support@barcodeapi.org