Saltar al contenido principal
QR Code Genius
QR Code Genius
FuncionesPreciosAyuda
Iniciar sesiónComenzar
Centro de Ayuda/API para Desarrolladores/Generate a QR Code (POST /qr)

Generate a QR Code (POST /qr)

Equipo de QR Code Genius
Actualizado 7/23/2026
6 min read

POST /api/v1/qr renders a single, fully-styled QR code and returns it inline as a base64 PNG data URL. Nothing is saved to your account — use bulk generation if you need the results stored and trackable.

Authentication uses the Authorization: Bearer header — see API Authentication.

Request

curl -X POST https://www.qrcodegenius.com/api/v1/qr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": "https://example.com",
    "width": 512,
    "height": 512,
    "dotsOptions": { "type": "rounded", "color": "#111827" },
    "backgroundOptions": { "color": "#ffffff" }
  }'

Fields

  • data (string, required) — the content to encode, 1–4296 characters. Any text works: URLs, Wi-Fi strings, vCards, plain text.
  • width, height (integer, optional) — output size in pixels, 50–2000.
  • margin (integer, optional) — quiet-zone padding in pixels, 0–100.
  • shape (string, optional) — "square" (default) or "circle".
  • image (string, optional) — a logo to embed in the center: an http(s) URL or a base64 data:image/... URI (png, jpeg, webp, or svg), up to 2,000,000 characters.
  • qrOptions, imageOptions, dotsOptions, cornersSquareOptions, cornersDotOptions, backgroundOptions (objects, optional) — full design control. See the styling reference for every field.

The request schema is strict: unknown fields are rejected with a 400 error rather than silently ignored. This catches typos like dotOptions early.

Response

{
  "success": true,
  "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
  "meta": {
    "usage_count": 5,
    "remaining": 995,
    "strategy": "monthly"
  }
}
  • data — the PNG as a data URL. Use it directly as an img source, or strip the data:image/png;base64, prefix and decode it to get the raw bytes.
  • meta.usage_count — requests used so far this period.
  • meta.remaining — requests left before hitting your limit.
  • meta.strategy — "monthly" if this request counted against your monthly quota, "credits" if it was drawn from purchased credits.

Errors

  • 400 — malformed JSON, a validation failure (see the details field for the first offending field), or an image URL that could not be fetched.
  • 401 — missing or invalid API key.
  • 429 — quota exhausted; see Errors and rate limits.
{ "error": "Invalid request body", "details": "data: Required" }

Saving the result

A common pattern is decoding the data URL and writing it to a file or object storage:

const res = await fetch("https://www.qrcodegenius.com/api/v1/qr", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.QR_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ data: "https://example.com", width: 512 }),
});
const { data } = await res.json();
const png = Buffer.from(data.split(",")[1], "base64");
await fs.promises.writeFile("qr.png", png);

¿Fue útil este artículo?

Tu opinión nos ayuda a mejorar nuestra documentación.

QR Code Genius
QR Code Genius

La plataforma de códigos QR más inteligente para creadores y empresas.

Producto

  • Características
  • Precios
  • Ayuda y FAQ
  • API para desarrolladores
  • URL / Sitio Web
  • vCard / Tarjeta Digital
  • WiFi
  • Cripto (Bitcoin/ETH)
  • Redes Sociales
  • Eventos (iCal)

Empresa

  • Centro de ayuda
  • Centro de Ayuda
  • Empezar
  • Ingresar

Legal

  • Privacidad
  • Términos

© 2026 Magpie Nexus, Inc. Todos los derechos reservados. magpienexus.com

Todos los sistemas funcionando