# QR Code Generator API: Barcodes, EAN-13, SVG, PNG, PDF (`actose/qr-barcode-generator`) Actor

Bulk QR codes (URL, vCard, Wi-Fi, text) and barcodes (EAN-13, UPC-A, Code 128, DataMatrix) as SVG, PNG or PDF with colors, logo, URLs and a ZIP. No API key, no login. MCP-ready for Claude, Cursor, ChatGPT and AI agents. Pay per result, errors and duplicates are free. $0.50 per 1,000 codes.

- **URL**: https://apify.com/actose/qr-barcode-generator.md
- **Developed by:** [ABM](https://apify.com/actose) (community)
- **Categories:** Developer tools, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.43 / 1,000 code generateds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## QR Code Generator API: Bulk QR Codes & Barcodes (EAN-13, Code 128, DataMatrix)

**Price: $0.50 per 1,000 codes** ($0.0005 per generated file). Pay per result, no monthly rental. Invalid inputs, duplicates and failed items are listed with a clear message and are **never charged**.

Generate thousands of **QR codes** and **barcodes** in one run, from a JSON list or a simple list of lines. Each code is saved as an **SVG, PNG or PDF** file in the run's key-value store. The dataset gives you one row per code with its **public URL**, and every file is also bundled into **one ZIP**.

- **QR codes:** URL, plain text, **vCard** contact, **Wi-Fi** login, email, phone call, SMS, geo location
- **Barcodes:** **EAN-13**, EAN-8, UPC-A, **Code 128**, Code 39, ITF (Interleaved 2 of 5), **DataMatrix**
- **Styling:** foreground and background colors (or transparent), **center logo** for QR codes, error correction level (L/M/Q/H), module size, bar size, quiet zone, human-readable text under barcodes
- **Validation:** EAN/UPC check digits are computed if you leave them out, and verified if you include them. A wrong check digit is reported, never silently changed.
- **No API key, no login, no external website:** everything is computed by the actor, so nothing breaks when a third-party site changes. Static codes: they never expire and do not go through a redirect service.
- **MCP-ready:** Claude, Cursor, ChatGPT and other AI agents can call it and get back file URLs.

### How much does it cost?

| Codes | Price |
|---|---|
| 1 | $0.0005 |
| 1,000 | **$0.50** |
| 10,000 | $5 |
| 100,000 (maximum per run) | $50 |

Only codes whose file was stored and delivered in the dataset are charged (`code-generated` event). Errors, duplicates of an earlier item in the same run, and the ZIP file are free. If you set a maximum cost per run, the actor stops cleanly when it is reached and never delivers uncharged extras.

### How to use

1. Add your codes to **Codes to generate** (JSON), or paste one value per line into **Quick list** and pick a **Default type**.
2. Pick the **file format** and, if you want, colors and a logo URL.
3. Run it. Then download the files from the dataset (`fileUrl`) or get everything at once from `codes.zip`.

### Input example

```json
{
  "items": [
    { "type": "url", "data": "https://example.com", "fileName": "homepage" },
    { "type": "wifi", "ssid": "Guest-WiFi", "password": "welcome2024", "security": "WPA" },
    { "type": "vcard", "name": "Jane Doe", "phone": "+33612345678", "email": "jane@example.com", "organization": "Example Inc.", "title": "CEO", "website": "https://example.com" },
    { "type": "email", "to": "hello@example.com", "subject": "Hello" },
    { "type": "sms", "phone": "+33612345678", "message": "I want the promo" },
    { "type": "geo", "lat": 48.8584, "lng": 2.2945 },
    { "type": "ean13", "data": "590123412345" },
    { "type": "code128", "data": "SKU-000123", "format": "pdf" },
    { "type": "datamatrix", "data": "LOT 2026-10 / SN 4815162342" }
  ],
  "format": "png",
  "foregroundColor": "#1a237e",
  "backgroundColor": "#ffffff",
  "errorCorrection": "M",
  "logoUrl": "https://example.com/logo.png",
  "logoSizeRatio": "0.22",
  "moduleSize": 10
}
```

Quick list (one code per line):

```json
{
  "dataLines": ["https://example.com/p/1", "https://example.com/p/2", "https://example.com/p/3"],
  "defaultType": "url",
  "format": "svg"
}
```

#### Item fields

| Field | Used for | Notes |
|---|---|---|
| `type` | all | `url` (default), `text`, `vcard`, `wifi`, `email`, `phone`, `sms`, `geo`, `ean13`, `ean8`, `upca`, `code128`, `code39`, `itf`, `datamatrix` |
| `data` | all | Value to encode. Fields of structured types can also go inside `data` as an object |
| `ssid`, `password`, `security` (`WPA`/`WEP`/`nopass`), `hidden` | wifi | |
| `name` or `firstName`/`lastName`, `phone`, `workPhone`, `email`, `organization`, `title`, `website`, `street`, `city`, `region`, `zip`, `country`, `note` | vcard | vCard 3.0, UTF-8 (accents and non-Latin names work) |
| `to`, `subject`, `body` | email | `mailto:` link |
| `phone`, `message` | sms | |
| `lat`, `lng` | geo | or `data: "48.8584,2.2945"` |
| `fileName`, `format`, `foregroundColor`, `backgroundColor`, `errorCorrection`, `logoUrl` | all | Per-item overrides |

### Output example

One dataset row per code:

```json
{
  "index": 1,
  "type": "url",
  "format": "svg",
  "input": "https://example.com",
  "status": "success",
  "encodedData": "https://example.com",
  "fileKey": "00001-url.svg",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/00001-url.svg",
  "contentType": "image/svg+xml",
  "fileSizeBytes": 3105,
  "widthPx": 290,
  "heightPx": 290,
  "modules": "21x21",
  "errorCorrection": "M",
  "qrVersion": 1,
  "humanReadableText": null,
  "foregroundColor": "#000000",
  "backgroundColor": "#ffffff",
  "hasLogo": false,
  "errorMessage": null
}
```

A rejected item (not charged):

```json
{
  "index": 2,
  "type": "ean13",
  "format": "svg",
  "input": "5901234123458",
  "status": "error",
  "errorMessage": "EAN-13 \"5901234123458\" has a wrong check digit (expected 7)."
}
```

An identical request already generated in the same run gets `"status": "duplicate"` with the first file's `fileUrl`, and is not charged.

The key-value store also has `codes.zip` (every file) and `OUTPUT` (`generated`, `failed`, `requested`, `stoppedByBudget`, `zipUrl`).

### Use cases

#### 1. Retail: EAN-13 labels for a new product range

A **category manager** receives 400 new GTINs from GS1 and needs print-ready barcodes for packaging and shelf labels. The check digits are verified, so a typo in the spreadsheet is caught before printing.

Input:

```json
{ "dataLines": ["590123412345", "4006381333931", "3017620422003"], "defaultType": "ean13", "format": "pdf", "barHeight": 120 }
```

Output (extract):

```json
[{ "index": 1, "status": "success", "humanReadableText": "5901234123457", "fileUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/00001-ean13.pdf" }]
```

Next: the designer drops the PDFs (vector, one per product) into the packaging artwork. 400 codes = **$0.20**.

#### 2. Marketing: one tracked QR code per flyer channel

A **growth marketer** prints 1,200 door-hanger flyers for 60 neighbourhoods and wants one UTM link per neighbourhood to measure response in analytics.

Input:

```json
{
  "items": [
    { "type": "url", "data": "https://shop.example.com/?utm_source=flyer&utm_campaign=oct&utm_content=lyon-3", "fileName": "lyon-3" },
    { "type": "url", "data": "https://shop.example.com/?utm_source=flyer&utm_campaign=oct&utm_content=lyon-6", "fileName": "lyon-6" }
  ],
  "format": "svg", "foregroundColor": "#1a237e", "logoUrl": "https://example.com/logo.png", "fileNamePrefix": "flyer-oct"
}
```

Output (extract):

```json
[{ "index": 1, "status": "success", "fileKey": "flyer-oct-lyon-3.svg", "errorCorrection": "Q", "hasLogo": true }]
```

Next: the print shop gets `codes.zip`; each neighbourhood's scans show up separately in analytics. 60 codes = **$0.03**.

#### 3. Hospitality: Wi-Fi and contact QR codes for every room

A **hotel operations manager** prints a Wi-Fi QR code card for 85 rooms (one network per floor) and a vCard for the front desk.

Input:

```json
{
  "items": [
    { "type": "wifi", "ssid": "Hôtel-Étage-1", "password": "bienvenue-2026", "security": "WPA", "fileName": "wifi-floor-1" },
    { "type": "vcard", "name": "Réception Hôtel du Parc", "phone": "+33140000000", "email": "contact@hotel.example" }
  ],
  "format": "png", "moduleSize": 12
}
```

Output (extract):

```json
[{ "index": 1, "status": "success", "encodedData": "WIFI:T:WPA;S:Hôtel-Étage-1;P:bienvenue-2026;;", "widthPx": 396 }]
```

Next: guests join the Wi-Fi by scanning, without typing the password. 86 codes = **$0.04**.

Other uses: Code 128 for warehouse bins and shipping labels, DataMatrix for lot and serial numbers on small parts, vCard QR codes on attendee badges.

### API examples

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("<username>/qr-barcode-generator").call(run_input={
    "dataLines": ["https://example.com/a", "https://example.com/b"],
    "format": "png",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["status"], row["fileUrl"])
```

JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('<username>/qr-barcode-generator').call({
    items: [{ type: 'ean13', data: '590123412345' }],
    format: 'svg',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((r) => r.fileUrl));
```

### Integrations (Make, Zapier, n8n, Google Sheets)

Example automation with **n8n** or **Make**: a new row in a Google Sheet (product name + GTIN) triggers "Run Actor" with `{"items": [{"type": "ean13", "data": "{{GTIN}}", "fileName": "{{SKU}}"}], "format": "png"}`, then "Get dataset items" writes `fileUrl` back into the sheet, next to the product. The same works with Zapier's Apify integration, or with any HTTP client via the Apify API (`run-sync-get-dataset-items` returns the rows in one call).

### Use with AI agents (MCP)

Through the Apify MCP server, Claude, Cursor, ChatGPT and other agents can call this actor as a tool: "make QR codes for these 20 URLs" → the agent passes `dataLines` and gets back the public `fileUrl` of each file to insert into a document, an email or a CMS. Each row is plain JSON with stable camelCase fields.

### FAQ

**Which format should I pick?** SVG for web and professional printing (vector, tiny files). PDF to send directly to a printer (vector, one page per code). PNG when a tool only accepts images.

**Can I add my logo?** Yes, for QR codes: give a public PNG/JPEG/WebP/GIF URL in `logoUrl`. The error correction is raised automatically (Q or H), so the code still scans with the logo covering the center.

**Do the codes expire?** No. These are static codes: the data is stored in the code itself and does not go through a redirect service. The files stay in your Apify storage according to your retention settings. Download the ZIP to keep them forever.

**Are the files public?** The `fileUrl` links work without your API token, so anyone you share them with can open the file. Don't share the links if the codes contain private data (e.g. Wi-Fi passwords).

**What if one value is invalid?** That row gets `status: "error"` and a message, the rest of the run continues, and you are not charged for it.

**What if I send the same value twice?** The second one gets `status: "duplicate"`, points to the first file, and is free. Give a different `fileName` if you really want two files.

**Can I cap my spending?** Yes. Set a maximum cost per run in Apify and the actor stops before it generates codes it could not bill. You can also set `maxItems`.

**Can I use colored codes?** Yes, but keep a dark foreground on a light background. Inverted or low-contrast codes are refused by many scanners (the log warns you).

### Limits

- Up to 100,000 codes per run (split bigger jobs into several runs).
- QR capacity depends on the error correction level: about 2,900 bytes at level L and about 1,200 at level H. Longer data is reported as an error.
- DataMatrix supports ASCII text only (no accents or emoji). Code 39 supports uppercase letters, digits and `-. $/+%`. Code 128 supports ASCII. EAN/UPC/ITF accept digits only.
- Logos must be PNG, JPEG, WebP or GIF (no SVG logos), 5 MB maximum, and are used for QR codes only.
- Static codes only: no dynamic QR codes that redirect, and no scan analytics.
- The text printed under barcodes in PNG uses a standard sans-serif font; for strict OCR-B packaging requirements, use SVG/PDF and set your own font in your design tool.

# Actor input Schema

## `items` (type: `array`):

One object per code. Required: "data" (or the structured fields below). Optional "type": url (default), text, vcard, wifi, email, phone, sms, geo, ean13, ean8, upca, code128, code39, itf, datamatrix. Optional per-item overrides: "fileName", "format", "foregroundColor", "backgroundColor", "errorCorrection", "logoUrl".<br><br>Wi-Fi: {"type":"wifi","ssid":"Cafe","password":"secret","security":"WPA","hidden":false}<br>vCard: {"type":"vcard","name":"Jane Doe","phone":"+33612345678","email":"jane@acme.com","organization":"Acme","title":"CEO","website":"https://acme.com","street":"1 rue de Paris","city":"Paris","zip":"75001","country":"France"}<br>Email: {"type":"email","to":"hi@acme.com","subject":"Hello","body":"..."}<br>SMS: {"type":"sms","phone":"+33612345678","message":"Hi"}<br>Geo: {"type":"geo","lat":48.8584,"lng":2.2945}<br>EAN-13 / EAN-8 / UPC-A: give 12/7/11 digits and the check digit is computed, or the full number and it is verified.

## `dataLines` (type: `array`):

Faster alternative for simple lists: each line becomes one code of the "Default type" below (e.g. a list of URLs, product numbers or serial numbers). Added after "Codes to generate".

## `defaultType` (type: `string`):

Type used when an item has no "type" (and for every line of the quick list).

## `format` (type: `string`):

SVG (vector, smallest, best for print and web), PNG (raster image) or PDF (vector, one page per code, ready to print).

## `foregroundColor` (type: `string`):

Color of the dark modules / bars: #RRGGBB, #RGB or a CSS color name. Keep it dark for reliable scanning.

## `backgroundColor` (type: `string`):

\#RRGGBB, #RGB, a CSS color name, or "transparent" (PNG/SVG/PDF without background).

## `errorCorrection` (type: `string`):

How much of the QR code can be damaged and still scan: L ~7%, M ~15%, Q ~25%, H ~30%. Raised automatically to Q/H when a logo is used. Also raised for free when it does not make the code bigger.

## `logoUrl` (type: `string`):

Public URL of a PNG, JPEG, WebP or GIF image (max 5 MB) placed in the center of every QR code. Can be overridden per item with "logoUrl". Downloaded once per run.

## `logoSizeRatio` (type: `string`):

Logo width as a share of the QR code width (0.10 to 0.30). Larger logos look better but scan less reliably.

## `moduleSize` (type: `integer`):

Size of one square module in pixels. A typical QR code is 25–57 modules wide, so 10 px gives roughly 330–650 px images.

## `barWidth` (type: `integer`):

Width of the thinnest bar of 1D barcodes in pixels.

## `barHeight` (type: `integer`):

Height of the bars of 1D barcodes in pixels (text not included).

## `showText` (type: `boolean`):

Print the encoded number/text under 1D barcodes (EAN, UPC, Code 128, Code 39, ITF).

## `quietZone` (type: `integer`):

Blank margin around the code, in modules. Leave empty for the standard: 4 for QR, 2 for DataMatrix, 10 for barcodes.

## `fileNamePrefix` (type: `string`):

Optional prefix added to every file key, e.g. "campaign-oct" gives campaign-oct-00001-url.png.

## `createZip` (type: `boolean`):

Stores codes.zip in the key-value store with every generated file (free, not charged).

## `maxItems` (type: `integer`):

Safety cap for this run. 0 = no cap (hard limit 100,000 per run).

## Actor input object example

```json
{
  "items": [
    {
      "type": "url",
      "data": "https://example.com",
      "fileName": "homepage"
    },
    {
      "type": "wifi",
      "ssid": "Guest-WiFi",
      "password": "welcome2024",
      "security": "WPA"
    },
    {
      "type": "vcard",
      "name": "Jane Doe",
      "phone": "+33612345678",
      "email": "jane@example.com",
      "organization": "Example Inc."
    },
    {
      "type": "ean13",
      "data": "5901234123457"
    },
    {
      "type": "code128",
      "data": "SKU-000123"
    },
    {
      "type": "datamatrix",
      "data": "LOT 2026-10 / SN 4815162342"
    }
  ],
  "defaultType": "url",
  "format": "png",
  "foregroundColor": "#000000",
  "backgroundColor": "#ffffff",
  "errorCorrection": "M",
  "logoSizeRatio": "0.22",
  "moduleSize": 10,
  "barWidth": 3,
  "barHeight": 100,
  "showText": true,
  "createZip": true,
  "maxItems": 0
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `zip` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `files` (type: `string`):

No description

## `overview` (type: `string`):

Main results as a table (dataset view).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "items": [
        {
            "type": "url",
            "data": "https://example.com",
            "fileName": "homepage"
        },
        {
            "type": "wifi",
            "ssid": "Guest-WiFi",
            "password": "welcome2024",
            "security": "WPA"
        },
        {
            "type": "vcard",
            "name": "Jane Doe",
            "phone": "+33612345678",
            "email": "jane@example.com",
            "organization": "Example Inc."
        },
        {
            "type": "ean13",
            "data": "5901234123457"
        },
        {
            "type": "code128",
            "data": "SKU-000123"
        },
        {
            "type": "datamatrix",
            "data": "LOT 2026-10 / SN 4815162342"
        }
    ],
    "format": "png",
    "foregroundColor": "#000000",
    "backgroundColor": "#ffffff"
};

// Run the Actor and wait for it to finish
const run = await client.actor("actose/qr-barcode-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "items": [
        {
            "type": "url",
            "data": "https://example.com",
            "fileName": "homepage",
        },
        {
            "type": "wifi",
            "ssid": "Guest-WiFi",
            "password": "welcome2024",
            "security": "WPA",
        },
        {
            "type": "vcard",
            "name": "Jane Doe",
            "phone": "+33612345678",
            "email": "jane@example.com",
            "organization": "Example Inc.",
        },
        {
            "type": "ean13",
            "data": "5901234123457",
        },
        {
            "type": "code128",
            "data": "SKU-000123",
        },
        {
            "type": "datamatrix",
            "data": "LOT 2026-10 / SN 4815162342",
        },
    ],
    "format": "png",
    "foregroundColor": "#000000",
    "backgroundColor": "#ffffff",
}

# Run the Actor and wait for it to finish
run = client.actor("actose/qr-barcode-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "items": [
    {
      "type": "url",
      "data": "https://example.com",
      "fileName": "homepage"
    },
    {
      "type": "wifi",
      "ssid": "Guest-WiFi",
      "password": "welcome2024",
      "security": "WPA"
    },
    {
      "type": "vcard",
      "name": "Jane Doe",
      "phone": "+33612345678",
      "email": "jane@example.com",
      "organization": "Example Inc."
    },
    {
      "type": "ean13",
      "data": "5901234123457"
    },
    {
      "type": "code128",
      "data": "SKU-000123"
    },
    {
      "type": "datamatrix",
      "data": "LOT 2026-10 / SN 4815162342"
    }
  ],
  "format": "png",
  "foregroundColor": "#000000",
  "backgroundColor": "#ffffff"
}' |
apify call actose/qr-barcode-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actose/qr-barcode-generator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/vK6Fe4z1K0m9deKoh/builds/pDhngbsFiBO8UR5X6/openapi.json
