# QR and Barcode Reader: decode codes in images in bulk (`examsens.ai/qr-barcode-reader`) Actor

Finds and decodes every QR code, Data Matrix, Aztec, PDF417, EAN, UPC, Code 128, Code 39, ITF and other barcode in images you list, with the format, text, content kind, corner points and rotation of each.

- **URL**: https://apify.com/examsens.ai/qr-barcode-reader.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (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

from $2.70 / 1,000 image scanneds

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 and Barcode Reader: decode codes in images in bulk

Give it a list of image URLs and get back every QR code and barcode in each image: the format, the decoded text, what kind of content it holds, and exactly where it sits in the image. One image can hold many codes, and all of them are returned.

### Formats

2D codes: QR Code, Micro QR Code, rMQR Code, Data Matrix, Aztec, PDF417, MaxiCode.

Barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, Codabar, ITF, DataBar, DataBar Expanded and DataBar Limited.

Codes are found turned at any angle, upside down, and as light codes on a dark background.

A UPC-A barcode is the same symbol as an EAN-13 starting with 0, so when every format is searched it is reported as EAN-13 with the leading 0 (`0036000291452`). Select only UPC-A in the formats to have it reported as UPC-A.

### For each code

- `format` (such as `QR Code` or `EAN-13`) and `formatId`
- `text`: the decoded content
- `contentKind`: url, email, phone, sms, wifi, contact, calendar, geo, number, text, gs1 or binary
- `contentType` as the decoder reports it (Text, Binary, GS1, ISO15434), and `bytesBase64` for binary content
- `position`: the four corner points in pixels, and `boundingBox` with x, y, width and height
- `orientation`: the rotation of the code in degrees, such as -90 or 180
- `errorCorrectionLevel` for QR, Aztec and PDF417 codes, and `symbologyIdentifier`

Codes are listed top to bottom, then left to right.

### Input

- Image URLs: http or https URLs, or data URIs such as `data:image/png;base64,...`. PNG, JPEG, GIF, WebP, BMP, TIFF, AVIF and HEIC images are read. Up to 30 MB and 60 megapixels each. Photos are turned upright from their EXIF orientation first, so positions match the image as you see it.
- Formats to look for: leave empty for all, or pick some to scan faster
- Look for rotated codes, look for inverted codes, look in smaller copies (all on by default)
- Images at once (default 4)

### Output

Dataset: one item per image with `index` (its place in your list), `imageUrl`, `ok`, `barcodeCount`, `texts` (the decoded texts), `barcodes` (the details above), `imageFormat`, `width`, `height` and `frames`. An image with no code gets `barcodeCount: 0`. An image that cannot be read gets `ok: false` and an `error`, such as `HTTP 404` or `not a readable image` for a web page. The other images still run.

### Pricing

Pay per event: one event per image scanned, whether or not it holds a code. An image that cannot be downloaded or read is not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

Each image URL is downloaded once. Images are not stored. Decoded content is returned as it is and never opened or followed.

### Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.

# Actor input Schema

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

Images to scan: http or https URLs, or data URIs (data:image/png;base64,...). PNG, JPEG, GIF, WebP, BMP, TIFF, AVIF and HEIC are read. Up to 30 MB and 60 megapixels each.

## `formats` (type: `array`):

Leave empty to look for every format. Limiting the list speeds up scanning and avoids false matches.

## `tryRotate` (type: `boolean`):

Also look for codes turned 90, 180 or 270 degrees.

## `tryInvert` (type: `boolean`):

Also look for light codes on a dark background.

## `tryDownscale` (type: `boolean`):

Also scan reduced copies of large images, which finds codes that fill much of a high resolution photo.

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

How many images are downloaded and scanned at the same time.

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/test/samples/qrcode-1/1.png"
  ],
  "tryRotate": true,
  "tryInvert": true,
  "tryDownscale": true,
  "maxConcurrency": 4
}
```

# 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://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/test/samples/qrcode-1/1.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/qr-barcode-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 = { "imageUrls": ["https://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/test/samples/qrcode-1/1.png"] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/qr-barcode-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 '{
  "imageUrls": [
    "https://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/test/samples/qrcode-1/1.png"
  ]
}' |
apify call examsens.ai/qr-barcode-reader --silent --output-dataset

```

## MCP server setup

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