# QR Code & Barcode Generator + Reader (Bulk, PNG/SVG, Logo) (`fast_data_asap/qr-barcode-generator-reader`) Actor

Bulk-generate QR codes, EAN-13, EAN-8, UPC-A, Code 128, Code 39 and Data Matrix as PNG or SVG (colors, logo, caption, error correction), or read/decode all QR codes and barcodes from image URLs. No API key. $0.50 per 1,000 codes.

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

## Pricing

$0.50 / 1,000 codes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 & Barcode Generator + Reader (Bulk, PNG/SVG, Logo)

Generate thousands of **QR codes and barcodes** in one run, or **read (decode) every QR code and barcode** in a list of images. No API key, no sign-up at a third-party service, no watermark. $0.50 per 1,000 codes.

### What it does

**Generate mode**

- Code types: **QR code, EAN-13 (GTIN-13), EAN-8, UPC-A, Code 128, Code 39, Data Matrix**
- Output: **PNG** (pixel-exact, no blurry scaling) or **SVG** (vector, print-ready)
- Custom **foreground / background color** (or transparent background)
- **Logo in the center of QR codes** – error correction is switched to H automatically so the code still scans
- QR **error correction** L / M / Q / H, **quiet zone**, **scale** (px per module) or **target width**, bar height
- Human-readable digits under barcodes plus an optional **caption** under any code
- **Check digit validation** for EAN-13, EAN-8 and UPC-A – a wrong check digit gives a free error row instead of an unscannable label. Leave the check digit out and it is calculated for you.
- Files are saved in the run's key-value store; every dataset row has a direct `fileUrl`

**Read mode**

- Give image URLs (PNG, JPG, WebP, GIF, BMP, TIFF); every QR code, Data Matrix, Aztec, PDF417, EAN/UPC, Code 128/39/93, ITF, Codabar, DataBar ... in each image is decoded with the zxing-cpp engine
- Returns type, decoded data, bounding box and corner points for each code
- Rotated, inverted (light-on-dark) and multiple codes per image are supported

### Who it is for

- **E-commerce & retail**: EAN/UPC barcodes for product labels, packaging and Amazon / Shopify listings
- **Marketing**: branded QR codes with logo and colors for flyers, posters and menus
- **Logistics & warehouses**: Code 128 / Data Matrix labels for orders, shipments and bins
- **Developers & automations** (n8n, Make, Zapier): generate or read codes from an API call without running your own service
- **Data teams**: extract product codes or links from large batches of photos and scans

### Why this actor

- Generator **and** reader in one tool, 7 symbologies for generation, ~20 for reading
- Pixel-exact output (whole-pixel modules) – sharper scans than resized images
- EAN/UPC check digit validation before anything is charged
- Pay only per successful file or image with a code found. Errors and images without codes are free.
- Fast: the default 3 codes finish in a few seconds at 512 MB

### Input example (generate)

```json
{
  "mode": "generate",
  "items": [
    { "data": "https://apify.com", "name": "website-qr" },
    { "data": "4006381333931", "name": "ean13-product", "type": "ean13" },
    { "data": "ORDER-2026-000123", "name": "code128-order", "type": "code128" }
  ],
  "type": "qr",
  "format": "png",
  "errorCorrection": "M",
  "foregroundColor": "#000000",
  "backgroundColor": "#FFFFFF",
  "logoUrl": "",
  "caption": ""
}
```

You can also put plain values into `texts` (one per line) – they use the global `type`.

### Output example (generate)

```json
{
  "mode": "generate",
  "name": "ean13-product",
  "type": "ean13",
  "data": "4006381333931",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/U0QJuhdGc7TMb5xgv/records/ean13-product.png?signature=...",
  "fileName": "ean13-product.png",
  "width": 345,
  "height": 178,
  "format": "png",
  "status": "ok",
  "error": null,
  "sizeBytes": 2471
}
```

An invalid EAN such as `4006381333932` returns `"status": "error", "error": "Invalid EAN13 check digit in 4006381333932: last digit should be 1."` and is not charged.

### Input example (read)

```json
{
  "mode": "read",
  "imageUrls": ["https://example.com/label-photo.jpg"]
}
```

### Output example (read)

```json
{
  "mode": "read",
  "imageUrl": "https://api.apify.com/v2/key-value-stores/U0QJuhdGc7TMb5xgv/records/website-qr.png?signature=...",
  "status": "ok",
  "count": 1,
  "type": "QR Code",
  "data": "https://apify.com",
  "width": 330,
  "height": 330,
  "codes": [
    {
      "type": "QR Code",
      "data": "https://apify.com",
      "rect": { "x": 40, "y": 40, "width": 250, "height": 250 },
      "polygon": [{ "x": 40, "y": 40 }, { "x": 290, "y": 40 }, { "x": 290, "y": 290 }, { "x": 40, "y": 290 }],
      "orientation": 0,
      "contentType": "Text",
      "errorCorrection": "M"
    }
  ],
  "error": null
}
```

`type` and `data` repeat the first code for easy spreadsheet use; `codes` lists all of them. Images without any code get `"status": "no_code_found"` (free).

### Pricing

Pay per event: **$0.0005 per code** ($0.50 per 1,000) – charged once per generated file, or once per image in which at least one code was decoded. Invalid inputs, failed downloads and images without codes are free.

### API, n8n and MCP usage

Run synchronously and get the dataset items back:

```bash
curl -X POST "https://api.apify.com/v2/acts/fast_data_asap~qr-barcode-generator-reader/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"generate","texts":["https://example.com/a","https://example.com/b"],"type":"qr","format":"svg"}'
```

- **n8n / Make / Zapier**: use the Apify node/app, actor `fast_data_asap/qr-barcode-generator-reader`, and map `fileUrl` or `codes` into the next step.
- **AI agents (MCP)**: add `https://mcp.apify.com?tools=fast_data_asap/qr-barcode-generator-reader` to Claude, Cursor or any MCP client to let your agent create or read QR codes and barcodes.

### Notes

- Generated `fileUrl`s are signed links to the run's key-value store; files are kept as long as your storage retention allows.
- PDF input is not supported in read mode – convert the page to an image first.
- Logo works for QR codes only; keep it at 25 % of the width or less.

# Actor input Schema

## `mode` (type: `string`):

generate = create QR codes / barcodes as PNG or SVG files. read = decode all QR codes and barcodes found in images.

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

Generate mode. List of objects: {"data": "...", "name": "optional-file-name", "type": "optional per-item type", "caption": "optional caption"}. Per-item type overrides the global code type.

## `texts` (type: `array`):

Generate mode. One value per line (URL, text, product number ...). Uses the global code type. Added to 'Codes to generate'.

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

Default code type for generated codes. EAN-13, EAN-8 and UPC-A check digits are validated (or added when you leave them out).

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

PNG (raster) or SVG (vector, ideal for print).

## `scale` (type: `integer`):

Size of one QR / Data Matrix module or one barcode bar unit in pixels. 0 = automatic (10 for QR / Data Matrix, 3 for barcodes).

## `size` (type: `integer`):

Optional. Picks the largest whole-module scale so the code is at most this wide (sharp edges, no blurry resizing). Overrides scale.

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

Height of the bars for 1D barcodes (EAN, UPC, Code 128, Code 39).

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

L = 7 %, M = 15 %, Q = 25 %, H = 30 % damage tolerance. Automatically H when a logo is added.

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

Hex color of the code, e.g. #000000.

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

Hex color of the background, e.g. #FFFFFF, or 'transparent'.

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

Optional. Direct link to a PNG/JPG/WebP logo placed in the center of every QR code. Error correction is switched to H automatically.

## `logoSizePercent` (type: `integer`):

Width of the centered logo relative to the QR code. Keep it at 25 or below for reliable scanning.

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

White margin around the code in modules. Scanners need at least 4 for QR, 10 for barcodes (applied automatically as minimum for EAN/UPC).

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

Prints the encoded value under 1D barcodes.

## `caption` (type: `string`):

Optional text printed under every generated code (per-item 'caption' overrides it).

## `imageUrls` (type: `array`):

Read mode. Direct links to images (PNG, JPG, WebP, GIF, BMP, TIFF). Every QR code and barcode in each image is decoded.

## `maxConcurrency` (type: `integer`):

How many images are downloaded in parallel in read mode.

## Actor input object example

```json
{
  "mode": "generate",
  "items": [
    {
      "data": "https://apify.com",
      "name": "website-qr"
    },
    {
      "data": "4006381333931",
      "name": "ean13-product",
      "type": "ean13"
    },
    {
      "data": "ORDER-2026-000123",
      "name": "code128-order",
      "type": "code128"
    }
  ],
  "type": "qr",
  "format": "png",
  "scale": 0,
  "barHeight": 120,
  "errorCorrection": "M",
  "foregroundColor": "#000000",
  "backgroundColor": "#FFFFFF",
  "logoSizePercent": 22,
  "quietZone": 4,
  "showText": true,
  "maxConcurrency": 8
}
```

# Actor output Schema

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

No description

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

No description

# 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 = {
    "mode": "generate",
    "items": [
        {
            "data": "https://apify.com",
            "name": "website-qr"
        },
        {
            "data": "4006381333931",
            "name": "ean13-product",
            "type": "ean13"
        },
        {
            "data": "ORDER-2026-000123",
            "name": "code128-order",
            "type": "code128"
        }
    ],
    "format": "png"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fast_data_asap/qr-barcode-generator-reader").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 = {
    "mode": "generate",
    "items": [
        {
            "data": "https://apify.com",
            "name": "website-qr",
        },
        {
            "data": "4006381333931",
            "name": "ean13-product",
            "type": "ean13",
        },
        {
            "data": "ORDER-2026-000123",
            "name": "code128-order",
            "type": "code128",
        },
    ],
    "format": "png",
}

# Run the Actor and wait for it to finish
run = client.actor("fast_data_asap/qr-barcode-generator-reader").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 '{
  "mode": "generate",
  "items": [
    {
      "data": "https://apify.com",
      "name": "website-qr"
    },
    {
      "data": "4006381333931",
      "name": "ean13-product",
      "type": "ean13"
    },
    {
      "data": "ORDER-2026-000123",
      "name": "code128-order",
      "type": "code128"
    }
  ],
  "format": "png"
}' |
apify call fast_data_asap/qr-barcode-generator-reader --silent --output-dataset

```

## MCP server setup

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

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/wJpszBbRu8yQUnZ1u/builds/1FfYPVG6JWTPjF4BE/openapi.json
