QR Code Generator

Generate QR codes as base64 PNG or SVG. One call, one code, 1 credit.

⚡ 1 credit per call

Try it

Fill in the fields below and hit Send.

Why use this

Generating QR codes in an agent pipeline means no external service dependency, no rate limits, and no wasted tokens describing what you want. One call, deterministic output.

Pricing

Any content, any format 1 credit

Request format

{
  "text": "https://example.com",
  "format": "png",
  "size": 256,
  "errorCorrectionLevel": "M"
}
Field Type Default Notes
text string required Content to encode
format png | svg png Output format
size integer 256 Pixels, PNG only. Min 64, max 1024.
errorCorrectionLevel L | M | Q | H M Data recovery: 7% / 15% / 25% / 30%

Response

data is a raw base64 string for PNG (no data:image/png;base64, prefix). For SVG it is the raw SVG markup.

To use the PNG in an <img> tag: <img src="data:image/png;base64,{data}">

Errors

Text too long for a QR code → 400. Empty text → 400.

API Reference

Endpoint

POST https://api.lightningapi.tools/qr-code/generate

Required headers

Authorization: Bearer <apiKey>
Content-Type: application/json

Example request

{
  "text": "https://example.com",
  "format": "png",
  "size": 256,
  "errorCorrectionLevel": "M"
}

Example response

{
  "text": "https://example.com",
  "format": "png",
  "data": "<base64 string>"
}