Welcome to Candybar. Our easy-to-use APIs offer seamless integration for generating various types of barcodes and decoding barcode images. This documentation will introduce you to the available endpoints and guide you on how to utilize these APIs effectively.
The base URL for all Candybar endpoints is:
https://{rapidApi}/v1
To access the Candybar APIs, you need an API key from {rapidApi}. Please obtain your API key from {rapidApi} and include it in the request headers as follows:
Authorization: YOUR_RAPID_API_KEY
Generates a Code128 barcode, which is a high-density linear barcode used for encoding alphanumeric data. It supports all 128 ASCII characters.
Endpoint:
GET /v1/code128
Parameters:
data
(required): The text or data to be encoded in the barcode.Example Request:
GET /v1/code128?data=Hello123
Example Response:
The API will return a PNG image of the generated Code128 barcode:
Creates a Code39 barcode, a variable-length, discrete barcode symbology that supports alphanumeric characters.
Endpoint:
GET /v1/code39
Parameters:
data
(required): The text or data to be encoded in the barcode.Example Request:
GET /v1/code39?data=World456
Example Response:
The API will return a PNG image of the generated Code39 barcode:
Generates a PDF417 barcode, a stacked linear barcode symbol format used mainly for 2D barcode applications like identification cards and transport tickets.
Endpoint:
GET /v1/pdf417
Parameters:
data
(required): The text or data to be encoded in the barcode.Example Request:
GET /v1/pdf417?data=SamplePDF417
Example Response:
The API will return a PNG image of the generated PDF417 barcode:
Creates a QR Code (Quick Response Code) barcode, a popular type of 2D barcode often used for URLs, product information, and various applications.
Endpoint:
GET /v1/qrcode
Parameters:
data
(required): The text or data to be encoded in the barcode.Example Request:
GET /v1/qrcode?data=https://www.example.com
Example Response:
The API will return a PNG image of the generated QR Code barcode:
Decodes a barcode image and returns the decoded data along with the barcode type.
Endpoint:
POST /v1/decode
Parameters:
file
(required): The barcode image file to be decoded. (Multipart form)Example Request:
POST /v1/decode
Headers:
Authorization: YOUR_RAPID_API_KEY
Content-Type: multipart/form-data
Body:
{
"file": (barcode_image_file)
}
Example Response:
[
{
"code_type": "CODE39",
"contents": "123123"
}
]
If an error occurs while processing your request, you will receive an error response with a corresponding HTTP status code and a message describing the issue.
Example Error Response:
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "Invalid data. Data must be alphanumeric."
}
Congratulations! You now have an overview of our Candybar APIs, and you are ready to start integrating barcoding functionality into your applications. Don’t forget to obtain your API key from Rapid API to access the APIs securely.
If you have any further questions or need assistance, feel free to reach out to our support team through the Candybar forum on Rapid API.
Happy barcoding!