---
title: Generate Barcode API
slug: generate-barcode
url: https://apyhub.com/apyhub/service/generate-barcode
provider: ApyHub
categories: [Smart Generation]
auth: api_key
---

# Generate Barcode API

Generate Code128 barcodes from a text string and download them or get a pre-signed cloud URL. Useful for labels, inventory, and ticketing.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `/generate/barcode/file` | What it does Generates a Code128 barcode from the provided text content and returns the result as a… | 30 |
| POST | `/generate/barcode/url` | What it does Generates a Code128 barcode from the provided content and returns a pre-signed cloud s… | 30 |

## About

## What it does
Barcode Generator turns a text value into a Code128 barcode and gives you the result as either a downloadable file or a cloud link. Send the `content` string in the request body, and choose whether you want a binary download or a pre-signed JPEG URL.

Use `POST /download` when you want the barcode file returned directly. Use `POST /link` when your workflow needs a hosted asset instead of a file response. Both endpoints accept the same input: the text to encode as `content`, plus an optional `output` query string for the file name or asset name.

The download endpoint returns binary data, which fits well for printing labels, generating packing slips, or embedding barcodes into documents on your own infrastructure. The link endpoint returns a JSON object with a `data` field containing a URI, which is useful when you want to store or share the generated barcode without handling file transfer yourself.

Barcode Generator is a straightforward fit for inventory systems, order fulfillment flows, ticketing, and any app that needs to turn an identifier into a scannable Code128 barcode.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/generate-barcode
