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
| Parameter | Type | Optionnal | Description |
|---|---|---|---|
| format | string | No | Used to specify the format of barcode. The following formats are supported:
|
| content | string | No | Used to specify the text or url that will be encoded into the barcode. |
| width | float | Yes | Used to specify the width of one barcode module in millimetres. The default value is 0.2. |
| height | float | Yes | Used to specify the height of one barcode module in millimetres. The default value is 15.0. |
| background_color | string | Yes | Used to specify the background color of the barcode. The default value is "white". |
| foreground_color | string | Yes | Used to specify the foreground color of the barcode. The default value is "black". |
| quiet_zone | float | Yes | The distance from the left and right borders to the first (last) barcode module, measured in millimeters. The default value is 6.5. |
| text_distance | float | Yes | Gap between the barcode and the underlying text, measured in millimeters. The default value is 5.0. |
| font_size | integer | Yes | The 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.
| Code | Description |
|---|---|
| 200 | This 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. |
| 401 | This 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. |
| 400 | This 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. |
| 500 | This 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:
- Barcode Basics and Beyond: A Comprehensive Guide
A barcode is an optically machine-readable representation of data that provides information about the object to which it is attached. Originally, barcodes…