Barcode Generator API for Developers

"The simplest Barcode generator API designed to generate 1D Bar codes. Barcode data are important for products inventory, shipment tracking, and storing important information."

About 1D Barcode

A 1D barcode, also known as a linear barcode or a one-dimensional barcode, is a type of barcode that represents data using a series of bars and spaces of varying widths and positions. The data is encoded by the pattern of the bars and spaces, which can be read by a barcode scanner.

1D barcodes are widely used in many industries, including retail, logistics, and healthcare, to encode product information, inventory data, and patient identification, among other things. Common types of 1D barcodes include:

  • UPC (Universal Product Code): Used primarily in North America to encode product information for point-of-sale scanning.
  • EAN (European Article Numbering): Similar to UPC, but used primarily outside of North America.
  • Code 39: A popular alphanumeric barcode used for inventory and tracking applications.
  • Code 128: A high-density barcode used for product labeling, inventory tracking, and shipping.
  • ITF (Interleaved 2 of 5): Used primarily for packaging and distribution applications, such as labeling cartons and pallets.
  • Codabar: Used in library systems, blood banks, and other applications where a small number of characters need to be encoded.

Barcode Generator API Features

Our barcode generator api Contains multiple formats of 1D barcode. Some barcodes encode numbers better whereas some encode letters better. A label can be added to each barcode to help human readability. Easy to decode by hand, you should consider 2D barcodes if you want to obfuscate data.

This 1D barcode generator API supports barcode and tracking code type for: Codabar, Code 11, Code 39 (+Extended), Code 93, Code 128, EAN-8, EAN-13, GS1-128 (EAN-128), ISBN-10 / ISBN-13, Interleaved 2 of 5, Standard 2 of 5, MSI Plessey, UPC-A, UPC-E, UPC Extension 2, UPC Extension 5, PostNet, Intelligent Mail, and Other (Custom).

Your API Authentication Key

We use API keys to authenticate all the requests. You can view and manage your API keys in the My Account -> My APIs Center page. Your API keys can be used to access our all the APIs, So be sure to keep them secure. Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

                                                        XXXX-XXXX-XXXX-XXXX (login to see your free API Key) 
Signup and activate free trial plan to try our APIs. See Trial Plan.

API Base URL and Endpoints

The API Base URL serves as the foundation or root of the API's endpoints. It represents the common prefix shared by all API endpoints. An Endpoint URL represents a specific operation or resource provided by the API. It is appended to the API Base URL to form a complete URL for a particular API call.

Base URL:


Endpoint for Barcode Generator:

                                                    GET /barcode 

API Request Method GET

This API use GET HTTP method to get data from our server. All API requests must be made over HTTPS ("S" stands for secure). Calls made over plain HTTP or without authentication key will not allowed.

Request Parameters

An API endpoint is a URL (Uniform Resource Locator) that is used to access a specific resource on a web server. API endpoints are the URLs that clients use to interact with a web API, and they typically consist of a base URL followed by a path that identifies a specific resource or action.

For barcode request

Parameter Description
This is your authentication api key to get requested data from our servers. This is mandatory parameter otherwise data request will be failed. Go to API Key.
This is barcode type. This is case-sensitive value. You can see the corresponding values for barcode type from this supported barcode type list.
Barcode data in alphanumeric format which you want to convert into barcode. You can refer the following document to see technical specifications of every barcode type with supported datatype see here.
This parameter used to set the Resolution / Scale size of barcode. The value range should be from (1 - 250) times. Default value is 2.

Please note: use this value with caution if value gets higher, the barcode generator API will take time to generate barcode.

This parameter used to set the Thickness / Vertical size of barcode stripes. The value range should be from (10 - 90) pixels. Default value is 30.
This parameter used to set the font size of barcode data label printed on bottom side for barcode stripes. The value range should be from (1 - 30) pixels. Default value is 8.
This parameter used to set the rotation of barcode. The value range should be between (0 - 360) degree clockwise. Default value is 0.
This parameter used to set image format of barcode. The value should be in (PNG, JPEG). This is case-sensitive value. Default value is PNG.
This parameter used to set export type for barcode image. Its either inline image object or base64 image string. The value should be (inline, base64). This is case-sensitive value. Default value is inline.

Example Request URL

                                                        https://zerosack.org/marketplace/apis/v1/barcode?barcode_type=BCGcode39&barcode_data=123-456&key=XXXX-XXXX-XXXX-XXXX (login to see your free API Key) 

Response Format

API response format refers to the format in which data is returned from an API endpoint after a request is made. We use JSON format for API response data. JSON (JavaScript Object Notation): JSON is a lightweight data interchange format that is easy to read and write. It is widely used for API response data because it is easy to parse and manipulate in many programming languages.

Barcode Example Response

Barcode response data in PNG image format (if export parameter value is inline)


Barcode response data in JSON format (if export parameter value is base64) Recommended

The recommended approach is to utilize the base64 export type for safeguarding your API key. By doing so, you enhance the security of your API key, preventing its exposure in client-side code. It is advisable to employ your API key within server-side language code, such as PHP, rather than using it in client-side languages like JavaScript.

                                                            "status": 1,
                                                            "status_message": "success",
                                                            "body": {
                                                                "barcode_base64_image": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOoAAABICAIAAAB3Iv78AAAATHRFWHRDb3B5cmlnaHQAR2VuZXJhdGVkIHdpdGggQmFyY29kZSBCYWtlcnkgZm9yIFBIUCBodHRwOi8vd3d3LmJhcmNvZGViYWtlcnkuY29txX9QoQAAAAlwSFlzAAAuIwAALiMBeKU\/dgAAA81JREFUeJzt2DtI61Acx\/HTiwiKIKY+aqcOioovBBGRKB0KatFNBN0UFCyCDxREFKGIQx0sDhVBpJQOoUNRXKWDOIkU7aBSSsgQX1G6OJqSO4QbClqJcq385feZkpPDIaf9Ug61MMYYY5qmsX8sFosxol9nz8k1YuZprvW\/tvLXVvt4xMya\/2tfH+\/07crmPxnz34KZdzD\/LXx2tVyfm\/m9\/GEAZCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmHIFwhDvkAY8gXCkC8QhnyBMOQLhCFfIAz5AmEWTdN++h0Avgi\/vkAY8gXCkC8QhnzNenl5aWxsfHx81G\/n5uYqKiqsVuvMzIw+sra2ZrVaq6qqtra2ci0yNja2urqqXw8ODlr+OTw8ZIwdHR3V1dWVlpZOTU19825+Cw1MODs7a2lpKSwsfHh40DQtEok4nU5FUe7u7trb28Ph8PHxcUdHhyRJoijabLZkMvl2EUEQOI5bWVnRb+12u6IoxlNJkjiOi8Vi6XSa5\/loNJqfrZGGfE2ZnJw8OTlxOBx6vtmWl5d9Pp9xe35+\/u40SZI6Ozs3Njb0fBVFqayszJ6wvb3t8Xi+5\/V\/LRweTNnd3e3u7n47\/vT0JAjCwMCAfru4uMjzfE9PT3l5efa0TCYzPj4eCASKi4v1kXg8XlBQ0NraWlZWNjEx8fr6KoqiqqrNzc364SGTyXz3pn4B5Pt19\/f3fX19Xq+3oaFBH9nc3Eyn07IsBwKB7Jnr6+tut7utrc0Y6e3tvb29vby8vLq6EkXR7\/erqhqLxaLRaCqVurm5CQaD+dwLUQU\/\/QJUXV9fDw8P+3y+\/v7+7PGioiK3251MJkdGRgRBYIwdHByEw+FUKrWwsKDPeX5+3tnZ0a+rq6tHR0dPT09rampcLldtbS1jbGhoKJFI5HdDNP306YUS41CrKEp9fX0ikTAeBYNBl8sly7Ioik1NTZFI5N0V\/H6\/fvbd29tzOp2SJMmy3NXVtb+\/f3FxYbfb4\/G4oig8z4dCofxsijTk+wlGvvPz89k\/AUtLS5qmzc7Ochxns9m8Xm+uFYx8VVX1eDz6fOO\/iFAo5HA4SkpKpqen87Ih8v4CcLN2BdeMp\/EAAAAASUVORK5CYII=",
                                                                "barcode_size": "1.1123046875 KB"

Barcode response data in JSON format (if failed)

                                                            "status": 0,
                                                            "status_message": "failed, one or more required parameters is missing. Please see the api documentation and try again later.",
                                                            "body": null

In this response barcode image means your data request response received successfully. In this case your APIs credit call/request count as 1, Otherwise in fail condition or any other condition you will receive "status": 0, In this case API credit calls/request count as 0.

Sample Code

You can use our api with any programming language as well which can handle http GET requests. Here are some sample code snippets for making a GET request to an API endpoint in multiple programming languages:

JavaScript PHP Python C#
                                                                    fetch('YOUR API REQUEST URL WITH REQUIRED PARAMETERS')
                                                                    .then(response => response.json())
                                                                    .then(data => console.log(data))
                                                                    .catch(error => console.error(error));
                                                                    $response = file_get_contents("YOUR API REQUEST URL WITH REQUIRED PARAMETERS");
                                                                    if ($response !== false) {
                                                                        $data = json_decode($response, true);
                                                                    } else {
                                                                        echo "Error: Request failed";
                                                                    import requests

                                                                    url = 'YOUR API REQUEST URL WITH REQUIRED PARAMETERS'
                                                                    response = requests.get(url)
                                                                    if response.status_code == requests.codes.ok:
                                                                        data = response.json()
                                                                        print('Error: Request failed with status code ' + str(response.status_code))
                                                                    var client = new HttpClient();
                                                                    var request = new HttpRequestMessage(HttpMethod.Get, "YOUR API REQUEST URL WITH REQUIRED PARAMETERS");
                                                                    var response = await client.SendAsync(request);
                                                                    Console.WriteLine(await response.Content.ReadAsStringAsync());                                                                

Also you can use Postman platform which enables you to create mock servers to assist with API development and testing. A mock server simulates the behavior of a real API server by accepting requests and returning responses. By adding a mock server to your collection and adding examples to your requests, you can simulate the behavior of a real API.

Do you Need Help? Contact us.

Disclaimers: This APIs is provided "as is" without warranty of any kind. If you have issue / feedback / bug report regarding the same, You can reach out to us.

Supported Barcode Types Close
Barcode Name barcode_type Parameter Value
Code 11BCGcode11
Code 39BCGcode39
Code 39 (+Extended)BCGcode39extended
Code 93BCGcode93
Code 128BCGcode128
GS1-128 / EAN-128BCGgs1128
ISBN-10 / ISBN-13BCGisbn
Interleaved 2 of 5BCGi25
Standard 2 of 5BCGs25
MSI PlesseyBCGmsi
UPC Extension 2 DigitsBCGupcext2
UPC Extension 5 DigitsBCGupcext5
Intelligent MailBCGintelligentmail
Other Barcode (Custom)BCGothercode
Barcode Specifications Close