NAV Navigation
cURL Node.js C# Python
Barcode Xpress
Web API Reference
Barcode

Overview

Barcode Xpress Web API is a REST-based library that can read over 30 different barcode types with high speed and accuracy. Barcode Xpress Web API is capable of reading barcodes from numerous file formats including BMP, JPG, and multi-page TIFF. See Supported Image Types.

Getting Started

Follow these steps to start reading barcodes:

  1. Subscribe to the Accusoft Cloud Portal. A subscription is required to utilize the Barcode Xpress Web API. See Subscription.
  2. Use your API Key to utilize the API. Your API Key is required for all endpoints. See Authentication.
  3. Begin using the Barcode Xpress API, such as the POST /api/v1/barcodeReader endpoint to read barcodes.

Base URL

The base URL for the Barcode Xpress Web API in the Accusoft Cloud is https://api.accusoft.com/bx/.

Examples

This API reference includes examples in several programming languages. You can switch to your preferred language by selecting it from the top of the right column.

Examples for cURL

The cURL examples work on the command line of many operating systems, including Windows, macOS, and Linux, though you may need to install the cURL program.

Examples for Node.js

The examples for Node.js use the request library. As an alternative, you can also make requests with any JavaScript HTTPS request library.

Examples for Python

The examples for Python use the requests library. As an alternative, you can also make requests with any Python HTTPS request library.

Subscription

To access the API, you need an Accusoft Cloud subscription. To subscribe to Accusoft Cloud, visit https://cloud.accusoft.com/.

  1. Sign In to the Accusoft Cloud Portal.
  2. Select Billing then Plan at the top of the screen.
  3. Choose the number of transactions you would like to subscribe to each month and click Subscribe.

If you have issues obtaining an Accusoft Cloud subscription, please contact us.

Authentication

All endpoints in the Barcode Xpress Web API require authentication. The API authenticates via a header token sent on all requests.

Before you authenticate to the API, you need an Accusoft Cloud subscription. See Subscription.

Header authentication

Include the Acs-Api-Key header in your requests:

curl -X POST https://api.accusoft.com/bx/api/v1/barcodeReader \
  -H 'Acs-Api-Key: YOUR_API_KEY'
const request = require('request');

request.post({
  uri: 'https://api.accusoft.com/bx/api/v1/barcodeReader',
  headers: {
    'Acs-Api-Key': 'YOUR_API_KEY'
  }
}, (err, res) => {};
static readonly System.Net.Http.HttpClient httpClient = new HttpClient()
{
    DefaultRequestHeaders = {
        { "Acs-Api-Key", "YOUR_API_KEY" }
    }
};
import requests

url = 'https://api.accusoft.com/bx/api/v1/barcodeReader'
headers = {
  'Acs-Api-Key': 'YOUR_API_KEY'
}

response = requests.post(url=url, headers=headers)

The API accepts an API key header with your API requests. Follow these steps to use header authentication:

  1. Sign In to the Accusoft Cloud Portal.
  2. Select API Key at the top of the screen to obtain your API Key.
  3. Pass the Acs-Api-Key header in your API request with your API Key as the value.

Barcode Reader

Read

Read barcodes from image

POST /api/v1/barcodeReader

This endpoint analyzes a source image for the presence of readable barcodes. By default, the image will be searched for all types of Supported Barcodes. However, you may specify a specific barcode type to search for as well.

curl -X POST https://api.accusoft.com/bx/api/v1/barcodeReader?types=all \
  -H 'Acs-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: image/bmp' \
  --data-binary "@path/to/image.bmp"
const fs = require('fs');
const request = require('request');

const inputStream = fs.createReadStream('path/to/image.bmp');

const apiRequest = request.post({
  uri: 'https://api.accusoft.com/bx/api/v1/barcodeReader?types=all',
  method: 'POST',
  headers: {
    'Acs-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'image/bmp'
  }
}, (err, res, body) => {
  if (err) {
    console.error(err);
    return;
  }

  console.log(JSON.parse(body));
});

inputStream.pipe(apiRequest);
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace Example
{
    class Program
    {
        static readonly HttpClient httpClient = new HttpClient()
        {
            DefaultRequestHeaders = {
                { "Acs-Api-Key", "YOUR_API_KEY" }
            }
        };

        static void Main(string[] args)
        {
            MainAsync().GetAwaiter().GetResult();
        }

        static async Task MainAsync()
        {
            using (FileStream file = File.OpenRead("path/to/image.bmp"))
            {
                var request = new HttpRequestMessage(HttpMethod.Post, "https://api.accusoft.com/bx/api/v1/barcodeReader?types=all");
                request.Content = new StreamContent(file);
                request.Content.Headers.ContentType = new MediaTypeHeaderValue("image/bmp");

                using (var response = await httpClient.SendAsync(request))
                {
                    response.EnsureSuccessStatusCode();

                    var body = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(body);
                }
            }
        }
    }
}
import requests
import json

url = 'https://api.accusoft.com/bx/api/v1/barcodeReader'
headers = {
  'Acs-Api-Key': 'YOUR_API_KEY',
  'Content-Type': 'image/bmp'
}
data = open('path/to/image.bmp', 'rb').read()

response = requests.post(url=url, headers=headers, data=data)
print(response.json())

Headers

Header Type Description
Content-Type string The MIME type of the supplied image. See Supported Image Types.

Parameters

Parameter Type Description
types string Optional comma-separated string of specific barcode types to read in the image. See Supported Barcodes.

Body

A binary image. Maximum file size is 10MB.

See Supported Image Types.

Example response
OK

{
  "status": "success",
  "processingTime": 17844,
  "results": [
    ...
  ]
}

Responses

Status Meaning Description Schema
200 OK Barcode read successful BarcodeReadResults
401 Unauthorized Valid Acs-Api-Key header is missing None
413 MaxRequestBodySizeExceeded Supplied input is larger than 10MB None
480 InvalidInput Supplied input is invalid None
480 MissingInput Required input is missing None

Schemas

BarcodeReadResults

Barcode read results

Properties

{
  "status": "success",
  "processingTime": 17844,
  "results": [
    {
      "type": "Code 128",
      "value": {
        "text": "60172421400",
        "base64": "Q09ERSAzOQ=="
      },
      "confidence": "98",
      "boundingBox": {
        "top": 85,
        "bottom": 268,
        "left": 353,
        "right": 483
      },
      "points": {
        "topLeft": {
          "x": 353,
          "y": 110
        },
        "topRight": {
          "x": 435,
          "y": 85
        },
        "bottomRight": {
          "x": 483,
          "y": 243
        },
        "bottomLeft": {
          "x": 401,
          "y": 268
        }
      },
      "page": 1
    },
    ...
  ]
}
Name Type Description
status string success or error.
processingTime integer Total processing time in milliseconds.
results array Collection of all discovered barcodes in the source image.
type string Barcode type.
value.text string ASCII value of the barcode.
value.base64 string Base-64 encoded value of the barcode.
confidence integer Confidence level that the result is accurate. Values less than 30 indicate the barcode could not be determined accurately.
boundingBox object Specifies a rectangular area on the image containing the barcode.
points object Specifies the x/y coordinates of each point of the barcode.
page integer Specifies the page the barcode was found on. (Multi-page TIFFs only)

Reference

Supported Barcode Types

Format Type
All Barcode Types all
All 1D Barcodes 1d
All 2D Barcodes 2d
Additional 2 Digit Code add2
Additional 5 Digit Code add5
Australian Post 4-State australianpost4state
Aztec aztec
Code BCD Matrix bcdmatrix
Codabar 2 / ABC-Codabar codabar
Code 128 code128
Code 32 code32
Code 39 code39
Code 39 Extended code39ext
Code 93 code93
Code 93 Extended code93ext
Code 2/5 Datalogic datalogic2of5
DataMatrix datamatrix
EAN 128 ean128
EAN 13 ean13
EAN 8 ean8
GS1 DataBar Extended gs1databar
Code 2/5 IATA iata2of5
Code 2/5 Industry industrial2of5
Intelligent Mail intelligentmail
Code 2/5 Interleaved interleaved2of5
Code 2/5 Invert inverted2of5
Code 2/5 Matris matris2of5
Patch Code patchcode
PDF417 pdf417
Post Net postnet
QR Code qrcode
Royal Post 4-State royalpost4state
UPC Version A Code upca
UPC Version E Code upce

Supported Image Types

Format MIME Type
BMP image/bmp
GIF image/gif
JPG/JPEG image/jpeg
PNG image/png
TIF/TIFF image/tiff

Release Notes

This section contains information on new features, improvements, enhancements, fixes, and known issues for each release.

Release Notes v13.0 Beta

New Features

Legal

© 2019 Accusoft Corporation. All rights reserved.

Information in this document is subject to change without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Accusoft® Corporation.

This manual and the software described in it are both products of the USA.

Accusoft Corporation
4001 North Riverside Drive
Tampa, FL 33603
Sales: 813-875-7575
www.accusoft.com

Accusoft Trademarks

Visit our website for a complete list of trademarks (™) and registered marks (®) of Accusoft Corporation.

Accusoft and/or its agents use these marks and brand names in connection with its goods and/or services, in the United States and other countries.

Node.js is a trademark of Joyent, Inc. and is used with its permission. We are not endorsed by or affiliated with Joyent.

Python is a registered trademark of the Python Software Foundation.

All other product and brand names are the property of their respective owners.

Accusoft Patents

Barcode Xpress Web API utilizes technology owned by Accusoft Corporation that is protected by U.S. Patents 8,351,699; 8,634,651; 9,734,550 and U.S. Patents Pending.