# Barcode & QR Code Reader + Generator (Bulk, 14 Formats) (`mrlarryjohnson/barcode-qr-reader-generator`) Actor

Decode QR codes, Data Matrix, PDF417, Aztec, EAN/UPC, Code 128 and more from images in bulk, or generate thousands of PNG/SVG barcodes and QR codes from a list. Offline zxing-cpp engine, no API key. Pay only for codes found or generated.

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

## Pricing

from $0.50 / 1,000 code read or generateds

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

## Barcode & QR Code Reader + Generator (Bulk, 14 Formats)

Two tools in one, powered by the open-source **zxing-cpp** engine running inside the Actor (no third-party API, no key):

**Read mode:** give it image URLs and get every code in each image: QR, Micro QR, rMQR, Data Matrix, Aztec, PDF417, MaxiCode, EAN-13/8, UPC-A/E, Code 128/39/93, ITF, Codabar, DataBar and more. You get the text, format, content type, orientation and corner positions. Rotated, inverted and small codes are handled.

**Generate mode:** give it a list of texts and get a **PNG or SVG** per code (QR, Micro QR, Data Matrix, Aztec, PDF417, Code 128, Code 39, Code 93, EAN-13, EAN-8, UPC-A, UPC-E, ITF, Codabar), stored in the run's key-value store with a download link in each row.

### Use cases

- **Retail & inventory:** batch-generate EAN/UPC or Code 128 labels for a product catalog; decode barcodes from supplier photos
- **Marketing:** create hundreds of QR codes for campaigns, menus, flyers (SVG for print)
- **Document processing:** read QR/Data Matrix/PDF417 from scanned forms, tickets and shipping labels
- **Automation:** plug into Make, Zapier or n8n through the Apify API

### Input

| Field | Default | Notes |
|---|---|---|
| `mode` | `read` | `read` or `generate` |
| `imageUrls` | — | Read mode: public image links (PNG, JPG, WEBP, GIF, BMP, TIFF; 20 MB max) |
| `codes` | — | Generate mode: one text per code |
| `format` | `QRCode` | Generate mode symbology |
| `outputFormat` | `png` | `png` or `svg` |
| `scale` | `8` | Pixels per module/bar |
| `errorCorrection` | `M` | QR/Aztec/PDF417: L, M, Q, H |
| `humanReadableText` | `true` | Digits under 1D barcodes |

### Output examples

Read:

```json
{"mode": "read", "imageUrl": "https://example.com/label.png", "codesFound": 1,
 "codes": [{"text": "https://apify.com", "format": "QRCode", "contentType": "Text", "orientation": 0,
            "position": [[32,32],[264,32],[264,264],[32,264]]}], "error": null}
```

Generate:

```json
{"mode": "generate", "text": "5901234123457", "format": "EAN13", "fileKey": "EAN13-5901234123457-1a2b3c4d.png",
 "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/EAN13-5901234123457-1a2b3c4d.png", "error": null}
```

### Pricing (pay per event)

- **$0.50 per 1,000** (`code-processed`, $0.0005): one per image in which at least one code was found, or one per generated code. Plus the standard $0.00005 actor start.
- **Free:** images with no code, failed downloads, invalid texts (for example letters in an EAN-13).
- Respects your run's maximum cost.

### Notes

- Images are decoded in memory and not kept. Generated files live in your run's storage under your Apify data-retention settings.
- Links must be public; private network and cloud metadata addresses are blocked.

***

*Actively maintained. Issues answered within 24 hours on the Issues tab.*

# Actor input Schema

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

Read codes from images, or generate code images from text.

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

Public links to PNG, JPG, WEBP, GIF, BMP or TIFF images. Every code in each image is returned. Up to 10,000 per run.

## `codes` (type: `array`):

One code per line: a URL, SKU, product number, Wi-Fi string, etc.

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

Symbology for generated codes. EAN/UPC need digits only (check digit optional).

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

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

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

Size of one bar/module. 8 gives roughly 300 px QR codes.

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

Higher levels survive more damage but make denser codes.

## `humanReadableText` (type: `boolean`):

Adds the human-readable digits under 1D barcodes (EAN, UPC, Code 128...).

## `concurrency` (type: `integer`):

Images fetched at the same time.

## Actor input object example

```json
{
  "mode": "read",
  "imageUrls": [
    "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https%3A%2F%2Fapify.com"
  ],
  "codes": [
    "https://apify.com",
    "SKU-10042"
  ],
  "format": "QRCode",
  "outputFormat": "png",
  "scale": 8,
  "errorCorrection": "M",
  "humanReadableText": true,
  "concurrency": 8
}
```

# Actor output Schema

## `results` (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 = {
    "imageUrls": [
        "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https%3A%2F%2Fapify.com"
    ],
    "codes": [
        "https://apify.com",
        "SKU-10042"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrlarryjohnson/barcode-qr-reader-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 = {
    "imageUrls": ["https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https%3A%2F%2Fapify.com"],
    "codes": [
        "https://apify.com",
        "SKU-10042",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("mrlarryjohnson/barcode-qr-reader-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 '{
  "imageUrls": [
    "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https%3A%2F%2Fapify.com"
  ],
  "codes": [
    "https://apify.com",
    "SKU-10042"
  ]
}' |
apify call mrlarryjohnson/barcode-qr-reader-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mrlarryjohnson/barcode-qr-reader-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/eMQqiD3fPelTAYAto/builds/yctIMIzUAjoO8PWEk/openapi.json
