Production-Ready Utility APIs

Fast, reliable APIs for email validation, IP geolocation, IBAN verification, and code generation. Free to use. No authentication required.

← Back to all APIs

Barcode Generator API

POST /api/v1/generate/barcode

Generate 1D barcodes as PNG or SVG images. Supports UPC-A, EAN-13, and Code128 formats with configurable dimensions and optional human-readable text below the barcode. Checksums are automatically generated or validated.

Request Body

data string required

The content to encode into the barcode

type string required

One of: UPC-A, EAN-13, Code128

format string required

Output format: png or svg

includeText boolean

Render human-readable value below the barcode. Default: false

width integer

Image width in pixels (50–1024). Default: 300

height integer

Image height in pixels (50–1024). Default: 150

Type-Specific Validation

UPC-A

Numeric only. 11 digits (checksum auto-generated) or 12 digits (checksum validated).

EAN-13

Numeric only. 12 digits (checksum auto-generated) or 13 digits (checksum validated).

Code128

Full ASCII support. No fixed length. Max 500 characters.

Example Request

{ "data": "012345678905", "type": "UPC-A", "format": "png", "includeText": true, "width": 300, "height": 150 }

Response

On success: returns image/png or image/svg+xml binary data.
On error: returns JSON with {"error": "message"} and appropriate HTTP status code.

Try it out