# Link to QR Code — PNG & SVG (`synthex-labs/link-to-qr-code`) Actor

Paste one website link and download a ready-to-scan QR code as PNG and print-friendly SVG. One field, no setup, no tracking or destination requests.

- **URL**: https://apify.com/synthex-labs/link-to-qr-code.md
- **Developed by:** [Dawid](https://apify.com/synthex-labs) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.005 / qr code generated

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

## Link to QR Code — PNG & SVG

**Paste a link. Click Start. Download your QR code.**

A small utility for adding a link to a flyer, menu, label or automated document workflow. No design settings, external account, paid AI API or website scraping.

### Three steps

1. Paste your link into **Your link**. The ready-to-run example is `https://example.com`.
2. Click **Start**.
3. Open **Output** and download **PNG** for everyday use or **SVG** for scalable print. The preview has the QR image, exact encoded URL and two download buttons.

Keep the white border around the code. Test the downloaded image with a phone before printing a large batch. Long links create denser codes and need more printed space; use a short destination when possible.

### What you get

- `qr-code.png`: crisp black-on-white PNG, near 1024 pixels with an integer number of pixels per module. Actual dimensions are in the JSON output.
- `qr-code.svg`: black-on-white vector QR that scales for print.
- `preview.html`: self-contained preview with embedded images/download links; no remote image/font loads or custom scripts.
- `OUTPUT` and one dataset row: exact `encoded_url`, PNG dimensions and file details.

The generator encodes your link locally. It does not visit or verify the destination, shorten it, add tracking, host a redirect service, or provide scan analytics. Scanning opens the exact encoded URL. Downloaded QR files have no generator-controlled expiry; their usefulness still depends on your destination remaining available. **Apify-hosted downloads follow your storage retention**, so save copies you want to keep.

### Accepted links

HTTP and HTTPS. A bare domain is converted to HTTPS. Leading/trailing whitespace is trimmed; international domains become ASCII IDNA and non-ASCII path/query/fragment characters are percent-encoded. Existing query parameters, percent escapes and fragments are preserved. Check `encoded_url` before printing.

Maximum normalized URL: 1,800 ASCII bytes. Invalid escapes, embedded controls/backslashes, unsupported schemes and username/password URLs are rejected with a safe error. This is a URL-to-QR utility, not a generic text, Wi-Fi or contact-card generator. The input schema intentionally contains only one field.

```json
{"url":"https://example.com/menu?utm_source=flyer#offers"}
```

No destination requests or DNS lookups are performed, including for private/internal URLs; the code does not establish whether a link is safe or reachable. Do not put passwords or confidential tokens into links you plan to print/share. Input/output storage visibility and retention follow your Apify settings; the Actor logs success/error messages, not the full link.

### Simple pricing

**$0.005 per successfully generated QR code**, with PNG, SVG and preview included. No per-format or scan fee; platform usage is included. Invalid input has no QR generation event. Always check the live Pricing tab. Rendering/charging and remote file writes are separate operations; a storage failure after charging may leave incomplete files—contact support with the run ID.

Default allocation: 128 MiB RAM, 60-second timeout. Files use error correction M and a four-module white quiet zone; no logo or decorative colors are added. The generator checks output with an independent decoder in its test suite; this does not guarantee every camera, printing material, size or lighting condition.

For support use the Actor Issues tab with the run ID. Never attach a private token or confidential link. Public research indicates weak direct demand for similar Apify utilities; this is a convenience experiment, not an earnings guarantee.

### Development

Install `requirements-dev.txt` from the repository root and run `python -m unittest discover -s tests -v`. Product dependencies remain separate from existing Actor Docker images. Regression tests cover URL behavior, QR decoding, files, preview escaping, billing and actual schema prefills for Store QA.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthex-labs/link-to-qr-code/changelog.md

# Actor input Schema

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

An HTTP/HTTPS link, e.g. https://example.com. A bare domain gets https:// automatically. Username/password links are refused.

## Actor input object example

```json
{
  "url": "https://example.com"
}
```

# Actor output Schema

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

No description

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

No description

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

No description

## `metadata` (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 = {
    "url": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthex-labs/link-to-qr-code").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 = { "url": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("synthex-labs/link-to-qr-code").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 '{
  "url": "https://example.com"
}' |
apify call synthex-labs/link-to-qr-code --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthex-labs/link-to-qr-code"
        }
    }
}
```

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/6yLbUv3HakgYzvPFk/builds/FEBhYXyi4yPfQzOQA/openapi.json
