QR Code Generation

Programmatically generate high-quality QR codes with custom colors, styles, and embedded logos.

Prerequisites

To use the API, you must authenticate your requests using a Bearer Token.

How to Authenticate

Follow our App Authentication documentation to learn how to exchange your Client ID and Secret for an Access Token.

View Authentication Docs

Generate a QR Code

Send a POST request to generate a QR code. The response includes the image data (Base64) and a ready-to-use HTML embed code.

const FormData = require('form-data');
const fetch = require('node-fetch');

const form = new FormData();
form.append('text', 'https://example.com');
form.append('color', '#000000');
form.append('background_color', '#ffffff');
form.append('qr_type', 'circle__rounded');
form.append('image_type', 'link');
form.append('image', 'https://example.com/logo.png');

const response = await fetch('https://eaglebirth.com/api/app/qr_code_generator/', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    ...form.getHeaders()
  },
  body: form
});

const data = await response.json();
console.log(data);

Payload Parameters

ParameterRequiredTypeDescription
textYesstringThe data to be encoded in the QR code (URL, text, etc.).
imageOptionalfile | stringA logo to embed in the center. Can be a file upload or a public URL string.
image_typeOptionalstringSet to 'link' if providing a URL, 'image' if uploading a file, or 'none'.
colorOptionalhexForeground color (e.g., #000000).
background_colorOptionalhexBackground color (e.g., #ffffff).
qr_typeOptionalstringStyle of the QR patterns (e.g., 'circle__rounded', 'default'). See Supported QR Styles below.

Supported QR Styles

You can pass any of the following IDs to the qr_type parameter to customize the visual style of your code. Click on a style to copy its ID.

default_qr
default_qr
Copy
circle__circle
circle__circle
Copy
circle__gapped_square
circle__gapped_square
Copy
circle__horizontal
circle__horizontal
Copy
circle__rounded
circle__rounded
Copy
circle__square
circle__square
Copy
circle__vertical
circle__vertical
Copy
custom_eye__circle
custom_eye__circle
Copy
custom_eye__gapped_square
custom_eye__gapped_square
Copy
custom_eye__horizontal
custom_eye__horizontal
Copy
custom_eye__rounded
custom_eye__rounded
Copy
custom_eye__square
custom_eye__square
Copy
custom_eye__vertical
custom_eye__vertical
Copy
gapped_square__circle
gapped_square__circle
Copy
gapped_square__gapped_square
gapped_square__gapped_square
Copy
gapped_square__horizontal
gapped_square__horizontal
Copy
gapped_square__rounded
gapped_square__rounded
Copy
gapped_square__square
gapped_square__square
Copy
gapped_square__vertical
gapped_square__vertical
Copy
gradiant_horizontal
gradiant_horizontal
Copy
gradiant_radial
gradiant_radial
Copy
gradiant_square
gradiant_square
Copy
gradiant_vertical
gradiant_vertical
Copy
horizontal__circle
horizontal__circle
Copy
horizontal__gapped_square
horizontal__gapped_square
Copy
horizontal__horizontal
horizontal__horizontal
Copy
horizontal__rounded
horizontal__rounded
Copy
horizontal__square
horizontal__square
Copy
horizontal__vertical
horizontal__vertical
Copy
rounded__circle
rounded__circle
Copy
rounded__gapped_square
rounded__gapped_square
Copy
rounded__horizontal
rounded__horizontal
Copy
rounded__rounded
rounded__rounded
Copy
rounded__square
rounded__square
Copy
rounded__vertical
rounded__vertical
Copy
square__circle
square__circle
Copy
square__gapped_square
square__gapped_square
Copy
square__horizontal
square__horizontal
Copy
square__rounded
square__rounded
Copy
square__vertical
square__vertical
Copy
vertical__circle
vertical__circle
Copy
vertical__gapped_square
vertical__gapped_square
Copy
vertical__horizontal
vertical__horizontal
Copy
vertical__rounded
vertical__rounded
Copy
vertical__square
vertical__square
Copy
vertical__vertical
vertical__vertical
Copy

Response Structure

The API returns a JSON object containing the status, the raw Base64 image data, and an HTML embed code string.

json
{
  "res": "success",
  "data": "data:image/png;base64,iVBORw0KGgo...",
  "embed_code": "<img src='https://assets.eaglebirth.com/qr/render/?token=...' alt='QR Code' width='250' />"
}

The Embed Code

The embed_code field provides a secure, signed HTML string you can place directly on your website. If you provide a logo URL, the embed code uses a dynamic link. If you upload a local image file, the embed code will contain the full image data (Data URI) to ensure it works instantly without hosting requirements.