QR generator

This API generates a QR code image based on provided data and size parameters.
2ms

About

The API receives parameters to generate a QR code, including the type of image format (e.g., PNG) and encoded data containing the QR code content and size. The QR generator is then returned as an image response.
by GLOBUS.studio

Endpoint

				
					async function getQrCode(data) {
    try {
        const response = await fetch(`https://api.globus.studio/v2/qr?data=${encodeURIComponent(data)}&type=png&size=5`);
        if (!response.ok) {
            throw new Error('Network response was not ok');
        }
        const blob = await response.blob();
        const url = URL.createObjectURL(blob);
        const img = document.createElement('img');
        img.src = url;
        img.alt = 'QR Code';
        document.body.appendChild(img);
    } catch (error) {
        console.error('Error fetching QR code:', error);
    }
}

getQrCode('Hello, World!');