AAAPIS.COM - Free APIs for developers

Barcode Generator API

This free barcode generator API enables the creation of barcodes in a variety of formats and offers customization options for the barcode's background and foreground colors, as well as its size dimensions.

Note: We DON'T store the queries you may send to our APIs.
Your barcode file is automatically removed from its temporary hosting 24 hours after its creation.

Barcode generator API request example

Method: POST
Content Type: application/json
Endpoint: https://aaapis.com/api/v1/generate/barcode/

curl --L --X POST 'https://aaapis.com/api/v1/generate/barcode/' \ 
--H 'Authorization: Token YOUR_TOKEN' \ 
--H 'Content-Type: application/json' \ 
--data-raw '{ 
    "format": "ean13",
    "content": "100000902922"
}'
Barcode generator API response

A successful request will return a temporary, signed URL that points to the generated barcode SVG (Scalable Vector Graphics) file.

Note: The barcode image file will be available for 1 hour. After that, the file will be automatically deleted after 24 hours.

Barcode generator API Parameters

ParameterTypeOptionnalDescription
formatstringNoUsed to specify the format of barcode. The following formats are supported:
  • code39
  • code128
  • ean
  • ean8
  • ean13
  • ean14
  • gs1
  • gs1_128
  • gtin
  • isbn
  • isbn10
  • isbn13
  • issn
  • itf
  • jan
  • pzn
  • upc
  • upca
contentstringNoUsed to specify the text or url that will be encoded into the barcode.
widthfloatYesUsed to specify the width of one barcode module in millimetres. The default value is 0.2.
heightfloatYesUsed to specify the height of one barcode module in millimetres. The default value is 15.0.
background_colorstringYesUsed to specify the background color of the barcode. The default value is "white".
foreground_colorstringYesUsed to specify the foreground color of the barcode. The default value is "black".
quiet_zonefloatYesThe distance from the left and right borders to the first (last) barcode module, measured in millimeters. The default value is 6.5.
text_distancefloatYesGap between the barcode and the underlying text, measured in millimeters. The default value is 5.0.
font_sizeintegerYesThe font size of the text beneath the barcode, specified in points as an integer. Setting the font size to zero will suppress the text. The default value is 10.

HTTP Response Status Codes

Aaapis employs standard HTTP response codes to signify the outcome, whether successful or unsuccessful, of an API request.Typically, codes falling within the 2xx range signify success. Codes within the 4xx range indicate an error attributable to inadequate information provided (e.g., a missing required parameter). Codes in the 5xx range denote an error related to Aaapis' servers.

CodeDescription
200This status code indicates that the request was successful. The server successfully processed the request and is sending back the requested data. In the context of the QR Code generation API, this status code would be returned when a QR code is successfully generated.
401This status code indicates that the request requires user authentication. The server received the request, but it needs authentication to fulfill it. This could mean that the Authorization header is missing or invalid.
400This status code indicates that the server could not understand the request due to invalid syntax. This could mean that the JSON object in the request is malformed or missing required fields. The client must modify the request and try again.
500This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This could be due to a problem with the server itself. The client should not modify the request and can try again later.

Unlock the power of our barcode API with our comprehensive guides: