# QR Code Generator (`zsoftware/qr-code-generator`) Actor

The QR Code Generator generates QR codes from a list of text values or URLs. It stores the generated QR codes as PNG images in a ZIP file, which is downloadable. The actor also pushes metadata for each QR code, including the original value, filename, and index, for easy reference.

- **URL**: https://apify.com/zsoftware/qr-code-generator.md
- **Developed by:** [Karim](https://apify.com/zsoftware) (community)
- **Categories:** Automation, Developer tools, Social media
- **Stats:** 21 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## QR Code Generator

This [Apify Actor](https://apify.com) generates QR code images from a list of input values (such as URLs, plain text, or any other string). It outputs a ZIP file containing all generated QR codes in PNG format and provides a count of successfully generated codes.

***

### 📥 Input

The actor expects the following input in JSON format:

```json
{
  "urls": ["https://example.com", "Hello, world!", "mailto:support@example.com"]
}
```

### 📥 Input Fields

The actor expects the following input:

- `urls` (array of strings, **required**):\
  A list of values to encode into QR codes. Each value can be a URL, plain text, email address, phone number, or any other string.

#### Example Input

```json
{
  "urls": [
    "https://example.com",
    "Hello, world!",
    "mailto:contact@example.com",
    "tel:+1234567890"
  ]
}
```

### 📤 Output

The output of the QR Code Generator contains the following data:

- **input\_value**: The value that was used to generate the QR code.
- **filename**: The filename of the generated QR code image (e.g., `qr_code_1.png`).
- **index**: The index of the QR code in the list of input values.

Each generated QR code will be represented as a record with these fields.

#### Example Output:

| Input Value         | Filename      | Index |
| ------------------- | ------------- | ----- |
| https://example.com | qr\_code\_1.png | 1     |
| Hello world         | qr\_code\_2.png | 2     |
| https://apify.com   | qr\_code\_3.png | 3     |

In the above table:

- `Input Value` is the text or URL that was used to generate the QR code.
- `Filename` is the generated QR code image's filename.
- `Index` represents the position of the input value in the original list of QR code values.

You can download the generated QR codes as a ZIP file, or access the individual QR code images from the Apify key-value store.

***

### 📁 Example Output Files

After the actor runs, you will get the following output in the key-value store:

- `qr_code_1.png`
- `qr_code_2.png`
- ...
- `qr_code_N.png`
- `qr_codes.zip`

The `.png` files are individual QR codes generated for each input value.\
The `qr_codes.zip` file contains all of the above images bundled together in a single downloadable archive.

***

### 💡 Notes

- QR codes are generated for each input string provided, not just URLs — you can input text, emails, phone numbers, or any string.
- Filenames follow the format: `qr_code_<index>.png`, where `<index>` corresponds to the order of input.

# Actor input Schema

## `qrCodeValues` (type: `array`):

List of text values or URLs to encode into QR codes.

## Actor input object example

```json
{
  "qrCodeValues": [
    "https://example.com",
    "Hello world",
    "https://apify.com"
  ]
}
```

# 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 = {
    "qrCodeValues": [
        "https://example.com",
        "Hello world",
        "https://apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zsoftware/qr-code-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 = { "qrCodeValues": [
        "https://example.com",
        "Hello world",
        "https://apify.com",
    ] }

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

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

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

```

## CLI example

```bash
echo '{
  "qrCodeValues": [
    "https://example.com",
    "Hello world",
    "https://apify.com"
  ]
}' |
apify call zsoftware/qr-code-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=zsoftware/qr-code-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/IsYtOdkRn7hhnu32W/builds/bUUpfTfPaDYJZxjSA/openapi.json
