The Barcode Parser API lets you parse, validate, and extract data from raw barcode values using a simple HTTP request. Send a barcode value and receive structured JSON with parsed fields, validation results, and the matching barcode data standard. It supports GS1, UDI, HIBC, VIN, ISBN, and other common barcode data formats.
How does the Barcode Parser API work?
Send a GET request to parser.orcascan.com with a barcode query parameter. The barcode value must be URL encoded. You can also add type to restrict parsing to a specific barcode data standard. For example https://parser.orcascan.com/?barcode=0190076338838502320100062111210518217103001192&type=gs1&case=human&schema=true
Barcode Parser API query parameters
You can use the following query parameters to control parsing:
| Parameter | Required | Description |
|---|---|---|
barcode |
yes | Raw barcode value to parse (must be URL encoded) |
type |
no | Force parsing as a specific barcode standard |
data |
no | Include parsed barcode data (default true) |
schema |
no | Include JSON schema for parsed data (default false) |
regex |
no | Parse only the value matched by a regex capture group |
To make it easier to consume in your applications, you can use the following query parameters to alter the shape of the JSON response:
| Parameter | Required | Description |
|---|---|---|
first |
no | Return only the first matching result |
case |
no | Format keys as: human, upper, lower, title, camel, pascal |
flat |
no | Flatten the response: true, false, full |
include |
no | Comma separated list of fields to include |
exclude |
no | Comma separated list of fields to exclude |
rename |
no | Comma separated list of fields to rename fromName:toName |
Formatting parameters are applied in order. Each one can change the JSON response before the next parameter runs.
How do I call the Barcode Parser API?
As a quick example, you can run the following curl command in your terminal:
curl "https://parser.orcascan.com/?barcode=0190076338838502320100062111210518217103001192"
Or copy and run one of the code snippets below:
<!-- save as barcode-parser.html -->
<!-- open in a browser -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Barcode Parser API example</title>
</head>
<body>
<pre id="result">Loading...</pre>
<script>
var barcode = '0190076338838502320100062111210518217103001192';
var url = 'https://parser.orcascan.com?barcode=' + encodeURIComponent(barcode);
fetch(url).then(function (res) {
return res.json();
})
.then(function (json) {
document.getElementById('result').textContent = JSON.stringify(json, null, 4);
})
.catch(function (err) {
document.getElementById('result').textContent = 'Request failed: ' + err.message;
});
</script>
</body>
</html>
// save as barcode-parser.js
// run: node barcode-parser.js
var barcode = '0190076338838502320100062111210518217103001192';
var url = 'https://parser.orcascan.com?barcode=' + encodeURIComponent(barcode);
fetch(url).then(function (res) {
return res.json();
})
.then(function (json) {
console.log(json);
})
.catch(function (err) {
console.error('Request failed:', err);
});
# save as barcode_parser.py
# run: python barcode_parser.py
import requests
barcode = '0190076338838502320100062111210518217103001192'
url = 'https://parser.orcascan.com?barcode=' + barcode
try:
response = requests.get(url)
response.raise_for_status()
print(response.json())
except requests.RequestException as err:
print('Request failed:', err)
// save as BarcodeParser.cs
// run: dotnet run
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var barcode = "0190076338838502320100062111210518217103001192";
var url = "https://parser.orcascan.com?barcode=" + Uri.EscapeDataString(barcode);
try
{
using var client = new HttpClient();
var json = await client.GetStringAsync(url);
Console.WriteLine(json);
}
catch (Exception err)
{
Console.WriteLine("Request failed: " + err.Message);
}
}
}
// save as barcode-parser.go
// run: go run barcode-parser.go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
barcode := "0190076338838502320100062111210518217103001192"
apiUrl := "https://parser.orcascan.com?barcode=" + url.QueryEscape(barcode)
response, err := http.Get(apiUrl)
if err != nil {
fmt.Println("Request failed:", err)
return
}
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil {
fmt.Println("Request failed:", err)
return
}
fmt.Println(string(body))
}
<?php
// save as barcode-parser.php
// run: php barcode-parser.php
$barcode = '0190076338838502320100062111210518217103001192';
$url = 'https://parser.orcascan.com?barcode=' . urlencode($barcode);
$json = file_get_contents($url);
if ($json === false) {
echo 'Request failed';
exit;
}
echo $json;
// save as BarcodeParser.java
// run: javac BarcodeParser.java && java BarcodeParser
import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
public class BarcodeParser {
public static void main(String[] args) {
String barcode = "0190076338838502320100062111210518217103001192";
String url = "https://parser.orcascan.com?barcode=" + URLEncoder.encode(barcode, StandardCharsets.UTF_8);
try {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
catch (Exception err) {
System.out.println("Request failed: " + err.getMessage());
}
}
}
Example response
The API returns the original barcode, whether it is valid, and each barcode standard that matched the value. Some values can match more than one standard. Use the type field to choose the result your application expects.
{
"barcode": "0190076338838502320100062111210518217103001192",
"valid": true,
"matches": [
{
"type": "FMD",
"data": {
"productCode": "90076338838502",
"serial": "7103001192"
}
},
{
"type": "GS1",
"data": {
"11": "2021-05-18T00:00:00Z",
"21": "7103001192",
"3201": 62.1,
"gtin": "90076338838502",
"gtin14": "90076338838502",
"digitalLink": "https://id.gs1.org/01/90076338838502/21/7103001192?3201=000621&11=210518",
"humanReadable": "(01)90076338838502(3201)000621(11)210518(21)7103001192",
"machineReadable": "\u001d0190076338838502320162.111210518217103001192",
"01": "90076338838502"
}
},
{
"type": "UDI",
"data": {
"deviceIdentifier": "90076338838502",
"serial": "7103001192",
"productionDate": "2021-05-18T00:00:00Z",
"issuingAgency": "GS1"
}
}
]
}
What barcode data standards are supported?
The Parser API validates and parses the following barcode data standards:
| Type | Description |
|---|---|
gs1 |
GS1 barcodes used in retail, logistics, healthcare and supply chains |
hibc |
HIBC barcodes used in healthcare |
isbt |
ISBT barcodes used to track blood products |
udi |
UDI barcodes used to track medical devices |
isbn |
ISBN barcodes used to identify books |
fmd |
FMD barcodes used in the EU to track prescription medicines |
bcbp |
BCBP barcodes used by airlines for boarding passes |
vin |
VIN barcodes used to identify vehicles |
wifi |
WiFi QR codes used to share network connection details |
vcard |
vCard QR codes used to share contact details |
tel |
Telephone QR codes used to start a call |
ical |
iCalendar QR codes used to share events and invites |
json |
JSON payloads used to encode structured data |
upc |
UPC barcodes used for retail products, mainly in the US and Canada |
ean |
EAN barcodes used for retail products and GTIN-13 or GTIN-8 identifiers |
psv |
Pipe separated values used for tabular data |
tsv |
Tab separated values used for tabular data |
csv |
Comma separated values used for tabular data |
url |
URL QR codes used to open web links in a browser |
- Without
type, the API checks every supported standard - With
type, the API only checks that barcode data standard
What is the API rate limit?
The Barcode Parser API allows up to 15 requests per second. If you exceed this limit, the API returns 429 Too Many Requests with a Retry-After header. Wait for the number of seconds in Retry-After, then try the request again.
Barcode Parser API FAQs
What is a Barcode Parser API?
A Barcode Parser API takes the raw text decoded from a barcode and converts it into structured data your application can use, such as serial numbers, expiry dates, lot numbers and product identifiers. Because it is a hosted HTTP API, developers can send barcode values from any application and get structured data back without writing or maintaining barcode parsing logic.
Is this a barcode scanner API or a barcode parser API?
The Barcode Parser API does not scan images or read barcodes from a camera. It parses barcode data after it has already been scanned or decoded by a barcode scanner, mobile app or barcode reading library.
Do I need an API key to use this service?
No. The Barcode Parser API does not require an API key and can be used freely.
Can the API parse GS1 Application Identifiers?
Yes. The Barcode Parser API can parse GS1 barcode values and return structured data such as GTIN, expiry date, lot number, serial number and other GS1 Application Identifier data. To limit the parser to only parse GS1 barcodes, set the type=gs1.
Can the API parse HIBC barcodes?
Yes. The Barcode Parser API can parse HIBC barcode values and return structured data such as labeler identification code, product or catalogue number, lot number, serial number, expiry date and quantity. To limit the parser to only parse HIBC barcodes, set type=hibc.
Can the API parse UDI barcodes?
Yes. The Barcode Parser API can parse UDI barcode values and return structured medical device data such as device identifier, production identifier, lot number, serial number, expiry date and manufacture date. To limit the parser to only parse UDI barcodes, set type=udi.
Can the API parse VIN barcodes?
Yes. The Barcode Parser API can parse VIN barcode values and return structured vehicle data such as manufacturer, model year, plant code, vehicle attributes and serial number. To limit the parser to only parse VIN barcodes, set type=vin.
Can the API parse ISBN, UPC and EAN barcodes?
Yes. The Barcode Parser API can parse ISBN, UPC and EAN barcode values and return structured data such as book identifiers, product identifiers, check digits and GTIN values. To limit the parser to one of these barcode types, set type=isbn, type=upc or type=ean.
Can the API parse QR code data like URLs, WiFi, vCards and calendar events?
Yes. The Barcode Parser API can parse common QR code payloads and return structured data for URLs, WiFi connection details, vCards, telephone numbers and calendar events. To limit the parser to one of these data types, set type=url, type=wifi, type=vcard, type=tel or type=ical.
How do I detect errors?
The Barcode Parser API returns two types of errors.
A valid response with no barcode match:
{
"barcode": "0190076338838502320100062111210518217103001192",
"valid": false,
"matches": []
}
An HTTP error for a failed request:
{
"status": 400,
"error": "Missing Query Parameter",
"message": "The required barcode parameter is missing"
}
| Status | Meaning |
|---|---|
400 |
The request is missing a required parameter |
404 |
The endpoint was not found |
429 |
The rate limit was exceeded |
500 |
The server could not process the request |
503 |
The service is temporarily unavailable |
Can I use the Barcode Parser API from a browser?
Yes, the endpoint is CORS-enabled, so you can call it from a web browser using fetch. For production applications, call the API from your server if you need to control access, hide business logic or apply your own rate limits.
Do I need to specify the barcode type?
No, the Barcode Parser API will auto-detect the type if you don’t specify it. You can provide a type as a query parameter to restrict parsing to a specific parser. If you don’t specify a barcode type, you may get multiple matches, but you can use the ?first=true parameter to ensure you only get the first result. Be sure to check all matches first before deciding if the “first” one is the one you want.
How do I send GS1 barcodes with FNC1 separators?
Send GS1 barcode data using the GS character, also known as ASCII 29 or Group Separator, where FNC1 separators are required. In JSON, this character is escaped as \\u001d. This is expected and means the GS separator was preserved.
How do I send multiline QR payloads like vCard, vCalendar or JSON?
Always URL-encode the full barcode before calling the Barcode Parser API. This is crucial for line breaks, plus signs (+) and special characters. Correct encoding ensures the Parser API reads the barcode successfully.
What is the benefit of using ?schema=true?
Use ?schema=true when building dynamic forms, field mapping or validation logic. The API returns the schema used to structure the response, so your application can understand which fields may be returned for each barcode data standard.
Need help using the Barcode Parser API?
As with everything at Orca Scan, our Barcode Parser API will evolve based on your feedback. If you have any issues, need help parsing a barcode standard, or want us to add support for a new format, chat with us live or email hello@orcascan.com.