API Documentation

Learn how to use the QR Code Forge API to generate QR codes programmatically.

API Endpoint

The base endpoint for all API requests.

GET /api/generate-qr

Query Parameters

Customize your QR code using these parameters.

ParameterTypeRequiredDescription
urlstringYesThe URL or text to encode.
imageUrlstringNoA URL to an image to embed in the QR code.

Example Usage

Here’s how you can use the API in your own projects.

Example URL

/api/generate-qr?url=https://dborgov.dev&imageUrl=https://dborgov.dev/brand/icon.png

cURL Example

curl -o qrcode.png "/api/generate-qr?url=https://dborgov.dev&imageUrl=https://dborgov.dev/brand/icon.png"

JavaScript (fetch)

fetch('/api/generate-qr?url=YOUR_URL&imageUrl=YOUR_IMAGE_URL')
  .then(response => response.blob())
  .then(blob => {
    const url = URL.createObjectURL(blob);
    // Use the URL to display the image, e.g., <img src={url} />
  });