faro-qr-code/generate

Generate a QR code as a base64-encoded PNG.

by Faro

Dynamic (cost in response)
charged on success

What it does

Generates a QR code as a base64-encoded PNG, encoding any text or URL. Size, error-correction level, and border width are configurable.

Primary use cases

  • Marketers embedding campaign-tracked URLs into print, packaging, and event collateral.
  • AI agents producing per-recipient QR codes for tickets, receipts, loyalty cards, or check-in flows.
  • Developers generating QR codes inline in PDFs, invoices, or shipping labels without bundling a QR library.
  • Operations teams attaching QR codes to assets, inventory, and physical locations for quick mobile scanning.

Why use this tool

Returning a base64 PNG inline keeps the workflow single-call: agents can embed the result directly into a document, email, or HTML response without managing storage or file handoff. Configurable error-correction levels let you trade size for resilience when codes will be printed small or on uneven surfaces.

Good to know

Higher error-correction levels produce denser codes that survive partial occlusion (such as a centered logo) but require more space. Adjust the border (quiet zone) to ensure reliable scanning when embedding in tight layouts.

Parameters

datastringrequired

Text or URL to encode into the QR code.

sizeintegeroptionaldefault: 256

Output image size in pixels (square).

borderintegeroptionaldefault: 4

Quiet-zone border width in modules.

formatstringoptionaldefault: "png"

Output image format.

error_correctionstringoptionaldefault: "M"

QR error-correction level. Higher levels tolerate more damage but encode less data.

faro-qr-code/generate — Faro