# Barcode Generator API

> Barcode Generator creates downloadable barcode images from text or product codes in Code 128, Code 39, EAN-13, EAN-8, UPC-A, UPC-E, ITF-14, Codabar, MSI and other linear formats, with bar width, height and margin adjustable on paid plans. Each response provides a temporary image download link, the image size in pixels, file format, and expiration timestamp.

**Endpoint:** `POST https://api.apiverve.com/v1/barcodegenerator`  
**Category:** Data Generation  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/barcodegenerator

## Overview

This barcode API handles barcode generation in one call: send a SKU, order ID, product number or any text and get back a scannable barcode image. Choose Code 128 (including the A, B and C subsets), Code 39, retail EAN-13, EAN-8, UPC-A and UPC-E, the EAN-2 and EAN-5 add-ons, ITF-14 and ITF for cartons, Codabar, MSI or Pharmacode, and optionally hide the text label beneath the bars. The API renders the image and returns a temporary download URL, image filename, pixel width and height, and Unix expiration timestamp. Paid plans can set the bar width, bar height and quiet-zone margin, and customize line and background colors and the label font size and spacing.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/barcodegenerator" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data":"51001544700","type":"code128","lineColor":"#000000","backgroundColor":"#FFFFFF","displayValue":true,"barWidth":1,"height":1,"margin":1,"fontSize":1,"textMargin":1}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | string | Yes | The data you want to generate a barcode from (string), up to 256 characters. length 0-256 |
| `type` | string | Yes | The type of barcode you want to generate. One of: code128, code128a, code128b, code128c, code39, ean13, ean8, ean5, ean2, upc, upce, itf14, itf, codabar, msi, msi10, msi11, msi1010, msi1110, pharmacode, isbn |
| `lineColor` | string | No | The color of the barcode (default: #000000). Premium field |
| `backgroundColor` | string | No | The background color of the barcode (default: #ffffff). Premium field |
| `displayValue` | boolean | No | Whether to display the value below the barcode (default: true) |
| `barWidth` | integer | No | Width of the narrowest bar in pixels (default: 4). default 4. range 1-10. Premium field |
| `height` | integer | No | Height of the bars in pixels (default: 40). default 40. range 10-500. Premium field |
| `margin` | integer | No | Quiet-zone margin around the barcode in pixels (default: 10). default 10. range 0-100. Premium field |
| `fontSize` | integer | No | Font size of the text label in pixels (default: 20). default 20. range 8-72. Premium field |
| `textMargin` | integer | No | Space between the bars and the text label in pixels (default: 2). default 2. range 1-50. Premium field |

## Response fields

- `imageName` — string · Unique identifier for the generated barcode image file
- `format` — string · File format of the barcode image output
- `type` — string · The barcode type that was generated
- `expires` — number · Unix timestamp when the barcode download URL expires
- `downloadURL` — string · Direct URL to download the generated barcode image
- `imageWidth` — number · Width of the generated image in pixels
- `imageHeight` — number · Height of the generated image in pixels

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "imageName": "cc85680f-a1d0-4627-89ff-7d7e53663a2b.png",
    "format": ".png",
    "type": "CODE128",
    "expires": 1766010012598,
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/barcodegenerator/cc85680f-a1d0-4627-89ff-7d7e53663a2b.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010012&Signature=cV6ANXGGaVDdl5SOFZt3xm2haHBnOklW1zXQICvJlGNlF4kwYVP9i%2F1RAN8NBGxSUiMk4Zcro%2FJUb3W%2Fwy8jA86pyEXTwIjNAiGW94ikpKSXs6%2FiV42Rwv6u2gX%2B2FH7XYyixlwJ%2B%2FHpfGcvka6u01FDk%2F2TUcR7%2FxsZ%2FmXPU2KTrzsI6XttCGBcHhex3LdTv%2F8tzMJbSshbZn%2BGcRTddwv6dC4lCcTtGE6Bl2zqY9s92KIr9X%2F4xj34q4XKBzywgXES57QaVhZeGPPOOUfLtI3pAN8fVSyM%2B9NBMU7R46xyqJ0J8PSVpQZhhAHn03T%2B40rcNp26GXqauM9K%2BLwZRw%3D%3D",
    "imageWidth": 468,
    "imageHeight": 82
  }
}
```

## Use cases

- **Warehouse Inventory Labeling** — Logistics managers turn incoming SKU numbers into Code 128 barcodes to print adhesive tracking tags for pallet racks.
- **Retail Order Invoicing** — When generating digital receipts, e-commerce storefronts append Code 39 barcode images so cashiers can scan returns at store counters.
- **Event Ticket Production** — Embed unique scannable barcodes on printable PDF conference badges before sending confirmation emails to attendees.
- **Internal Asset Tracking** — IT teams create compact Code 128 tags without bottom text labels to catalog laptops and monitors in inventory databases.

## SDKs

- **npm** — `npm install @apiverve/barcodegenerator` (https://www.npmjs.com/package/@apiverve/barcodegenerator)
- **PyPI** — `pip install apiverve-barcodegenerator` (https://pypi.org/project/apiverve-barcodegenerator/)
- **NuGet** — `dotnet add package APIVerve.API.BarcodeGenerator` (https://www.nuget.org/packages/APIVerve.API.BarcodeGenerator)
- **Source** — https://github.com/apiverve/barcodegenerator-api

## More

- Full reference: https://docs.apiverve.com/ref/barcodegenerator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
