QRCode.Pub tools

Free QR code images; paid web page → Markdown, page metadata and 30-day file hosting via x402 micropayments (USDC on Base/Solana, no API key). Remote Streamable HTTP server at https://qrcode.pub/mcp

Hosted MCP Server

npx add-mcp 'https://qrcode.pub/mcp'

Installs into Claude Code, Codex, Cursor and more

Documentation

Free QR code API

One URL in, one QR code image out. PNG or SVG, any size and color, no API key, no sign-up, no watermark. CORS is open and every image is cached at Cloudflare's edge.

GET https://qrcode.pub/api/qr?data=<text or link>&size=300&format=png

Example: https://qrcode.pub/api/qr?data=https%3A%2F%2Fexample.com&size=300

Try it

Parameters

NameDefaultDescription
datarequiredThe text or link to encode, URL-encoded. Up to 2000 characters (UTF-8, emoji are fine). text also works.
size300Image width/height in pixels, 32 to 2000. 300 or 300x300.
formatpngpng or svg.
color000000Foreground color: hex (1a237e, %231a237e) or r-g-b (26-35-126).
bgcolorffffffBackground color, same formats. bg also works.
eccMError correction: L 7%, M 15%, Q 25%, H 30%. Use H if you put a logo on top.
margin4Quiet zone around the code in modules, 0 to 20. Scanners need at least 2 to 4.

Errors return HTTP 400 with JSON like {"error": "..."}. Responses send Access-Control-Allow-Origin: * and Cache-Control: public, max-age=31536000, immutable.

Examples

HTML

<img src="https://qrcode.pub/api/qr?data=https%3A%2F%2Fexample.com&size=200" alt="QR code" width="200" height="200">

Markdown (GitHub README, docs)

![QR code](https://qrcode.pub/api/qr?data=https%3A%2F%2Fexample.com&size=200)

curl

curl -o qr.svg "https://qrcode.pub/api/qr?data=hello%20world&format=svg&color=1a237e"

JavaScript

const src = 'https://qrcode.pub/api/qr?' + new URLSearchParams({ data: 'https://example.com', size: 400, ecc: 'H' });
document.querySelector('img').src = src;

Google Sheets / Excel

=IMAGE("https://qrcode.pub/api/qr?size=200&data=" & ENCODEURL(A2))

Printing these codes on packaging, menus or signs? A static code can never be changed. A dynamic QRCode.Pub code points to a short link you can redirect any time, with scan counts: $9 once, no subscription, never expires.

Make an editable QR code →

For AI agents: pay-per-call tools (x402)

Four endpoints accept x402 micropayments (protocol v2, exact scheme, USDC on Base or on Solana mainnet — pick either entry of accepts) so an agent can call them with no account or API key. Call once, get 402 Payment Required with a PAYMENT-REQUIRED header, sign the payment, call again with PAYMENT-SIGNATURE. Any x402 client works (@x402/fetch, x402-axios, the Python SDK, the Solana pay CLI/MCP server, MCP clients with an x402 wallet).

EndpointPriceReturns
GET /x402/qr?data=…$0.005QR code image, same parameters as the free API above.
GET /x402/extract?url=…$0.01JSON: title, description, clean Markdown of the page, links.
GET /x402/meta?url=…$0.005JSON: title, description, canonical, OpenGraph, Twitter card, icons, JSON-LD.
POST /x402/store$0.01Hosts the uploaded file (≤ 5 MB; png, jpeg, webp, gif, pdf, json, txt, md, csv — raw body with a Content-Type, or multipart field file) at a public https://qrcode.pub/f/<id> URL for 30 days. JSON: url, expires, delete token (DELETE /x402/store/<id> with Authorization: Bearer). No HTML, SVG or scripts; files are served with nosniff and a sandboxing CSP.

The same 402 also carries a Machine Payments Protocol (MPP, by Stripe and Tempo) challenge in WWW-Authenticate: Payment — method tempo (USDC.e on Tempo) and method evm (USDC on Base), same price — so MPP clients work too: npx mppx "https://qrcode.pub/x402/qr?data=hello". Pay with Authorization: Payment …; the answer carries a Payment-Receipt header.

Machine-readable catalog with prices and input schemas: https://qrcode.pub/x402 (also at /.well-known/x402); OpenAPI 3.1 discovery document (Agentcash Discovery profile, indexed by x402scan): https://qrcode.pub/openapi.json. Nothing is charged for a 4xx answer (bad input, unreachable page). Settlement is done by an account-free facilitator; the PAYMENT-RESPONSE header carries the transaction hash.

import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";   // a wallet holding USDC on Base

const paidFetch = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(process.env.KEY)) }],
});
const res = await paidFetch("https://qrcode.pub/x402/extract?url=https://example.com");
const { title, markdown, links } = await res.json();

MCP server

The same tools are available to any MCP client as a remote server (Streamable HTTP, no login): https://qrcode.pub/mcp. Listed in the official MCP registry as pub.qrcode/tools. qr_code is free and returns the image inline; page_to_markdown, page_metadata and host_file are the x402 endpoints above — called without a payment argument they return the 402 payload (price and accepts), called with the base64 payment payload as payment they run and settle.

{ "mcpServers": { "qrcode-pub": { "type": "http", "url": "https://qrcode.pub/mcp" } } }

Agent Skills

Teach a coding agent (Claude Code, Codex, Cursor, OpenCode, …) this API in one command — two Agent Skills, qr-code-generator (the free image API) and x402-web-tools (the paid endpoints and MCP server), published in AgentiLoop/skills and at https://qrcode.pub/.well-known/agent-skills/.

npx skills add AgentiLoop/skills      # or: npx skills add https://qrcode.pub

FAQ

Do I need an API key?

No. There is no key, account or sign-up. Call the URL from a browser, an <img> tag, a server or a spreadsheet.

Is it really free? Are there limits?

Yes, it is free. There is no hard quota; please cache images you reuse and keep traffic reasonable. Responses are cached for a year, so the same URL is served from the edge.

Do you store the data I encode?

No. The image is generated on the fly and the content is not saved. We only count the number of calls per day and the referring website, with no IP addresses.

Can I use the codes commercially?

Yes. The images are yours to print or ship in your product, with no watermark and no attribution required.

Do the QR codes expire?

No. They are static codes: the content is inside the image, so they work forever. The catch is that you can never change what they point to after printing.

Can I change where a printed code points?

Not with a static code. For that, create a dynamic QRCode.Pub code: it points to a short link you can edit any time, with scan counts, for $9 once (no subscription).

No code? Use a generator

Bulk QR code generator · Free QR code generator with no expiration · WiFi QR code generator · vCard QR code generator · Restaurant menu QR code · Google review QR code · WhatsApp QR code generator · Instagram QR code generator · PDF QR code generator · Email QR code generator · SMS (text message) QR code generator · Phone call QR code generator · YouTube QR code generator · Facebook QR code generator · TikTok QR code generator · LinkedIn QR code generator · Google Maps location QR code · Calendar event QR code generator · Text QR code generator · Real estate sign QR code · Google Form QR code generator · App download QR code · Why did my QR code stop working? · Dynamic QR code without a subscription · Can you change a QR code after printing it? · Static vs dynamic QR codes · Printable WiFi QR code sign · QR code table tent maker