You can use the Barcode Image API to generate barcode images from a single URL. Pass a barcode value and optional parameters, and it returns a ready-to-use barcode image (QR, Code 128, EAN, Data Matrix) in SVG, PNG, JPG, or PDF. No API key or SDK required.
How does the Barcode Image API work?
Send a GET request to barcode.orcascan.com with the query parameters data (value to encode) and optional type (barcode symbology, defaults to qr). For example https://barcode.orcascan.com?data=example&text=Hello
Query parameters
You can use the following parameters to generate the exact barcode you need:
| Parameter | Required | Details |
|---|---|---|
data |
yes | Value to encode in the barcode |
type |
no | Barcode type qr, datamatrix, upca, upce, ean8, ean13, code39, code93, code128, itf, pdf417, aztec (default qr) |
format |
no | Image format svg, png, jpg, pdf, gif, webp, tiff (default svg) |
text |
no | Label text shown below barcode |
fontsize |
no | Font size in px or fit (default fit) |
padding |
no | Whitespace around barcode in px |
background |
no | Background hex colour or none |
layout |
no | Orientation portrait or landscape (default portrait) |
How do I use the Barcode Image API?
As a quick example, you can use the following curl command:
# run this in your terminal
curl -o barcode.png "https://barcode.orcascan.com?data=example&text=Hello"
Or copy one of the code snippets below:
<!-- save as index.html -->
<!-- open in a browser -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<img src="https://barcode.orcascan.com?data=Hello" alt="QR code" />
</body>
</html>
// save as barcode.js
// run: node barcode.js
const https = require('https');
const fs = require('fs');
https.get('https://barcode.orcascan.com?data=Hello', function (res) {
res.pipe(fs.createWriteStream('barcode.png'));
});
# save as barcode.py
# run: python barcode.py
from urllib.request import urlopen
url = 'https://barcode.orcascan.com?data=Hello'
with urlopen(url) as response:
with open('barcode.png', 'wb') as f:
f.write(response.read())
// use in a .NET 6+ console app
// run: dotnet run
using System.Net.Http;
using System.IO;
var url = "https://barcode.orcascan.com?data=Hello";
var client = new HttpClient();
var bytes = await client.GetByteArrayAsync(url);
File.WriteAllBytes("barcode.png", bytes);
// save as main.go
// run: go run main.go
package main
import (
"io"
"net/http"
"os"
)
func main() {
resp, _ := http.Get("https://barcode.orcascan.com?data=Hello")
defer resp.Body.Close()
file, _ := os.Create("barcode.png")
defer file.Close()
io.Copy(file, resp.Body)
}
<?php
// save as barcode.php
// run: php barcode.php
$image = file_get_contents('https://barcode.orcascan.com?data=Hello');
file_put_contents('barcode.png', $image);
// save as Barcode.java
// run:
// javac Barcode.java
// java Barcode
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Barcode {
public static void main(String[] args) throws Exception {
try (InputStream in = new URL("https://barcode.orcascan.com?data=Hello").openStream()) {
Files.copy(in, Paths.get("barcode.png"));
}
}
}
Which barcodes can I generate using this API?
You can generate barcode images either by specifying a barcode symbology using the type parameter, or by providing a label design ID created in the Orca Scan web app. The following barcode symbologies are supported:
| Type | Description | Typical use case |
|---|---|---|
qr |
QR code | URLs, text, general-purpose data |
datamatrix |
Data Matrix | Compact product or asset identifiers |
upca |
UPC-A | Retail products (US, Canada) |
upce |
UPC-E | Compact retail barcodes |
ean8 |
EAN-8 | Small retail products |
ean13 |
EAN-13 | Retail products (international) |
code39 |
Code 39 | Simple inventory and labels |
code93 |
Code 93 | Compact inventory codes |
code128 |
Code 128 | Inventory, logistics, internal systems |
itf |
Interleaved 2 of 5 | Shipping and warehouse labels |
pdf417 |
PDF417 | IDs, tickets, large data payloads |
aztec |
Aztec Code | Tickets and transport systems |
Using a custom label design
You can also generate barcode images using a label design created in the Orca Scan web app. This allows you to reuse the same layout, fonts, and spacing without rebuilding URLs.

- Log in to the Orca Scan web app
- Open the Labels tab
- Create or edit a label
- Copy the Label ID from the URL
- Use the Label ID as the
typeparameter
Example: https://barcode.orcascan.com?data=example&type={labelId}
When using a label design, the label defines the barcode type, layout, and formatting.
API Rate Limits
You can send up to 15 requests per second. If you exceed this limit, the API returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait before retrying. To handle rate limits correctly:
- Check for
429responses - Read the
Retry-Afterheader - Wait, then retry the request
Barcode Image API FAQs
How do I detect and handle errors?
The API always returns an image. When an error occurs, the image shows the error instead of a barcode, preventing broken images.
To detect errors programmatically, check the HTTP status code.
| Status | Message | Description |
|---|---|---|
200 |
Ok | Request successful |
400 |
Bad request | Invalid parameter value |
500 |
Unexpected error | Something went wrong |
What image formats does the Barcode Image API support?
You can generate the following formats by setting the format parameter:
| Format | Description |
|---|---|
svg |
SVG (Scalable Vector Graphics) ← default |
png |
PNG (Portable Network Graphics) |
jpg |
JPG (Joint Photographic Experts Group) |
tiff |
TIFF (Tagged Image File Format) |
pdf |
PDF (Portable Document Format) |
gif |
GIT (Graphics Interchange Format) |
webp |
WebP (Web Picture Format) |
Can I add text to the barcode image?
Yes. Use the text query parameter to display text below the barcode:
https://barcode.orcascan.com/?data=example&text=hello
Can I change the font size of the barcode text?
Yes. Use the fontsize query parameter (in pixels) to control the text size:
https://barcode.orcascan.com/?data=example&text=hello&fontsize=100
If omitted, fontsize=fit is used to keep the text within the barcode width.
Can I adjust the whitespace around the barcode?
Yes. Use the padding query parameter (in pixels) to control the whitespace:
https://barcode.orcascan.com/?data=example&padding=10
Can I change the background color of the barcode image?
Yes. Use the background query parameter with a hex color value:
https://barcode.orcascan.com/?data=example&background=333333
For a transparent background, use background=none
https://barcode.orcascan.com/?data=example&background=none
Can I rotate the barcode to landscape?
Yes. Use layout=landscape to rotate the barcode:
https://barcode.orcascan.com/?data=example&layout=landscape
Do I need an API key to use this service?
No. The Barcode Image API does not require an API key and can be used freely
Is the Barcode Image API free to use?
Yes. The Barcode Image API is free to use.
How many barcode images can I generate per day?
The API allows up to 15 requests per second, which means you can generate up to ~1.3 million barcode images per day.
How reliable is the Barcode Image API?
The API is highly reliable, used in production by the Orca Scan application, and generates 10M+ barcode images per day. You can view live status and uptime history at https://status.orcascan.com
Need help using the Barcode Image API?
As with everything at Orca Scan, our Barcode Image API will evolve based on your feedback. So if you have any issues, or need help, chat with us live or drop us an email hello@orcascan.com