What Is a QR Code?
QR code generator theory. A Quick Response (QR) code is a two-dimensional matrix barcode capable of encoding URLs, plain text, contact information, Wi-Fi credentials, payment data, and virtually any UTF-8 string. First developed by Denso Wave in 1994, QR codes became ubiquitous in the smartphone era because any camera app can decode them instantly — no dedicated scanner required. The ISO/IEC 18004 standard governs their encoding and error correction, ensuring interoperability across all compliant readers.
The QR Code Generator API by GLOBUS.studio turns any string of data into a ready-to-use QR code image in PNG, JPG, or GIF format, with a configurable module size — all in a single GET request averaging just 2ms latency.
API Endpoint and Parameters
GET https://api.globus.studio/v2/qr?data={encoded_string}&type={format}&size={size}
data— URL-encoded string to embed in the QR code (text, URL, vCard, Wi-Fi config, etc.)type— image format:png,jpg, orgifsize— module size multiplier controlling the output image dimensions
The API returns the image directly as a binary response with the appropriate Content-Type header, so it can be embedded in an <img> tag or piped to disk without any additional processing. Full parameter reference is on the QR Generator API documentation page.
Request Examples
PNG — Medium Size
GET /v2/qr?data=Hello%2C%20World%21&type=png&size=5
JPG — Small Size
GET /v2/qr?data=Hello%2C%20World%21&type=jpg&size=3
GIF — Large Size
GET /v2/qr?data=Hello%2C%20World%21&type=gif&size=10
Embedding Directly in HTML
<img src="https://api.globus.studio/v2/qr?data=https%3A%2F%2Fexample.com&type=png&size=6"
alt="QR code for example.com" />
Common Use Cases
Dynamic URL QR Codes for Marketing Materials
Print designers and marketing teams frequently need QR codes embedded in PDFs, brochures, and posters at generation time. By calling the API during document rendering — passing a campaign URL or UTM-tagged link as the data parameter — the QR code is always in sync with the current target URL without any manual regeneration step. Changing the destination only requires updating the data parameter; the image URL structure stays constant.
Event Tickets and Boarding Passes
Ticketing systems encode booking references, seat numbers, or signed tokens into QR codes that gate agents scan at entry points. Generating these codes on-the-fly via API — rather than pre-rendering and storing thousands of images — eliminates the storage overhead and keeps the pipeline stateless. The 2ms response time makes synchronous generation viable even at peak ticket delivery load.
Wi-Fi Credential Sharing
The WIFI:T:WPA;S:NetworkName;P:Password;; QR format lets guests connect to a network by scanning a code — no typing required. Hospitality applications, office management tools, and router admin panels can generate a fresh Wi-Fi QR code each time credentials rotate, simply by passing the updated credentials string to the API.
Product Labels and Inventory Tracking
Warehouses and manufacturing lines attach QR codes to physical items encoding SKUs, serial numbers, or batch identifiers. Generating labels programmatically via API lets inventory systems produce QR images on demand at print time without maintaining a local QR library in every service or worker node.
QR Code Generator in vCard and Contact Sharing
Business card applications encode vCard 3.0 or 4.0 data into QR codes so recipients can save contact details with a single scan. The API accepts the full vCard string as the data parameter, returning a print-ready PNG or JPG that can be embedded in digital cards, email signatures, or PDF exports.
WordPress Plugin Development
WordPress plugins that generate shareable content — post URLs, WooCommerce product pages, downloadable files — can embed a live QR code in the admin UI or on the front end using a simple <img> tag pointed at the API endpoint. No PHP QR library installation is needed, no Composer dependencies, no server-side image generation: the API handles everything and returns a binary image directly to the browser.
Payment and Crypto Address QR Codes
Cryptocurrency wallets and payment terminals encode recipient addresses or payment request URIs (Bitcoin’s BIP-21 format, for example) as QR codes. Generating these dynamically per transaction — with the exact amount and address encoded — is a natural fit for an on-demand API rather than a batch pre-generation job.
Integration Examples for QR Code Generator
cURL — Save to File
curl -o qrcode.png \
"https://api.globus.studio/v2/qr?data=https%3A%2F%2Fexample.com&type=png&size=6"
JavaScript — Dynamic Image Injection
const data = encodeURIComponent('https://example.com');
document.querySelector('#qr').src =
`https://api.globus.studio/v2/qr?data=${data}&type=png&size=6`;
PHP
$data = urlencode('https://example.com');
$url = "https://api.globus.studio/v2/qr?data={$data}&type=png&size=6";
// Embed as data URI
$image = base64_encode(file_get_contents($url));
echo "<img src=\"data:image/png;base64,{$image}\" alt=\"QR\" />";
Python
import requests
from urllib.parse import quote
data = quote('https://example.com')
response = requests.get(
f'https://api.globus.studio/v2/qr?data={data}&type=png&size=6'
)
with open('qrcode.png', 'wb') as f:
f.write(response.content)
WordPress (PHP) — Inline Image in Post
$data = rawurlencode( get_permalink() );
$qr_url = "https://api.globus.studio/v2/qr?data={$data}&type=png&size=5";
echo '<img src="' . esc_url( $qr_url ) . '" alt="QR code for this page" />';
Choosing the Right Size and Format for QR Code Generator
The size parameter controls the width of each individual QR module (pixel block) in the output image. A value of 3 produces a compact image suitable for screen display at small sizes; a value of 10 produces a large, print-ready image where each module is clearly defined even at reading distance. For most web use cases, values between 4 and 6 strike the right balance between file size and scan reliability.
PNG is the recommended format for digital display and documents — it is lossless and handles the high-contrast black-and-white pattern of a QR code without compression artifacts that could impair scanning. JPG is acceptable for previews. GIF is useful when compatibility with legacy systems or certain document formats is required.
Performance
With 2ms average latency and a stateless GET interface, the QR Generator API is designed for synchronous, inline use. Images can be requested at render time in server-side templates, streamed directly to PDF generators, or embedded as live <img> sources in HTML — no caching layer is required for most workloads, though caching by data + type + size is straightforward to implement if request volume is high.
Explore all parameters and test live requests on the QR Generator API documentation page.