---
name: amt-qr-code
description: Generate QR codes for URLs, text, or WiFi via free QR Code API. Returns PNG as a data URL. Use for tickets, menus, campaign links, and mobile handoff.
---

# QR Code API (Agent Media Tools)

## When to use
- Generate a QR for a URL, plain text, or WiFi credential string
- Event tickets, menu links, deploy previews, UTM campaigns

## API
`POST https://agentmediatools.com/api/qrcode`  
`Content-Type: application/json`

```json
{
  "text": "https://example.com",
  "size": 512
}
```
- `text` required (up to 2,000 chars)
- `size` optional, max 1000

**No API key** for basic free tier.

## Response
```json
{
  "dataUrl": "data:image/png;base64,...",
  "text": "https://example.com"
}
```
Decode the base64 after the comma to write a PNG file.

## WiFi example text
`WIFI:S:MyNetwork;T:WPA;P:secret;;`

## curl
```bash
curl -X POST https://agentmediatools.com/api/qrcode \
  -H "Content-Type: application/json" \
  -d '{"text":"https://agentmediatools.com","size":512}'
```

## Browser
https://agentmediatools.com/tool/qr-code

## MCP
Tool name: `generate_qrcode`

## Guide
https://agentmediatools.com/blog/generate-qr-codes-via-api
