No code: open the free QR code generator, enter a URL or text, download the PNG. Developers and agents: use the QR code API below—no API key to start.
Looking for a free QR code API, QR code generator API, or a simple api qr code endpoint that works in headless agents? Agent Media Tools exposes POST /api/qrcode. Send text or a URL; get JSON with a PNG data URL you can display or save.
| Property | Value |
|---|---|
| Endpoint | POST /api/qrcode |
| Body | JSON: text (required), size (optional, max 1000) |
| Response | {"dataUrl":"data:image/png;base64,...","text":"..."} |
| Auth | No API key for basic free tier |
| Limits | 10/day anonymous · 25/day free account |
| Browser tool | /tool/qr-code |
💡 Windows users: Run from Git Bash or WSL.
curl -X POST https://agentmediatools.com/api/qrcode \
-H "Content-Type: application/json" \
-d '{"text":"https://agentmediatools.com","size":512}' \
| python3 -c 'import sys,json,base64; d=json.load(sys.stdin)["dataUrl"].split(",",1)[1]; open("qr.png","wb").write(base64.b64decode(d))'
The endpoint returns {"dataUrl":"data:image/png;base64,..."}. The pipe decodes that into qr.png.
curl -X POST https://agentmediatools.com/api/qrcode \
-H "Content-Type: application/json" \
-d '{"text":"WIFI:S:MyNetwork;T:WPA;P:secret;;","size":512}'
import base64
import requests
r = requests.post(
"https://agentmediatools.com/api/qrcode",
json={"text": "https://yoursite.com/promo", "size": 512},
)
r.raise_for_status()
data_url = r.json()["dataUrl"]
png = base64.b64decode(data_url.split(",", 1)[1])
with open("qr.png", "wb") as f:
f.write(png)
const res = await fetch("https://agentmediatools.com/api/qrcode", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "Hello from JS!", size: 512 }),
});
const { dataUrl } = await res.json();
// document.querySelector("img").src = dataUrl;
console.log(dataUrl.slice(0, 40) + "...");
Generate a QR code with POST https://agentmediatools.com/api/qrcode
Body JSON: {"text": "YOUR_URL_OR_TEXT", "size": 512}
Response: JSON with PNG data URL in "dataUrl". Decode base64 after the comma and save as PNG.
MCP clients can use the generate_qrcode tool when the Agent Media Tools MCP server is connected.
Yes for basic use (daily free limits). No credit card required to start. See pricing for higher limits.
Same product. Humans use /tool/qr-code; agents and apps call POST /api/qrcode.
Up to 2,000 characters in the text field; size is capped at 1,000 pixels.
Enter a URL or text—no API key. Get a PNG via the same endpoint agents use.
agentmediatools.com — free tools for humans and AI agents