QR Code Generator
Generate QR codes from any text or URL. Returns a raw PNG image or base64-encoded JSON, with configurable size and error-correction level.
Overview
Use Cases
- Adding QR codes to print materials and invoices
- Sharing URLs or contact information via QR scan
- Mobile app deep-link distribution
- Event ticketing and check-in systems
- Marketing campaigns with trackable URLs
Features
API Endpoints
Generate QR Code (PNG)
Returns a raw PNG image of the QR code. Ideal for direct embedding or file download.
https://api.requiems.xyz/v1/tech/qr
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| data | string |
Required | The text or URL to encode in the QR code |
| size | integer |
Optional | Image size in pixels (default: 256, min: 50, max: 1000) |
| recovery | string |
Optional | Error-correction level: low (7%), medium (15%), high (25%), highest (30%). Higher levels are more robust to physical damage but produce larger images. Default: medium |
Try it out
Live DemoRequest
The text or URL to encode in the QR code
Image size in pixels (default: 256, min: 50, max: 1000)
Error-correction level: low (7%), medium (15%), high (25%), highest (30%). Higher levels are more robust to physical damage but produce larger images. Default: medium
Response Fields
| Field | Type | Description |
|---|---|---|
| (binary) | bytes |
Raw PNG image bytes. Content-Type is image/png. |
Code Examples
# Save a 200px PNG with high error-correction
curl "https://api.requiems.xyz/v1/tech/qr?data=https://example.com&size=200&recovery=high" \
-H "requiems-api-key: YOUR_API_KEY" \
--output qrcode.png
# Default size (256px), medium error-correction
curl "https://api.requiems.xyz/v1/tech/qr?data=https://example.com" \
-H "requiems-api-key: YOUR_API_KEY" \
--output qrcode.png
import requests
url = "https://api.requiems.xyz/v1/tech/qr"
headers = {"requiems-api-key": "YOUR_API_KEY"}
params = {"data": "https://example.com", "size": 200, "recovery": "high"}
response = requests.get(url, headers=headers, params=params)
with open("qrcode.png", "wb") as f:
f.write(response.content)
const params = new URLSearchParams({
data: 'https://example.com',
size: 200,
recovery: 'high'
});
const response = await fetch(
`https://api.requiems.xyz/v1/tech/qr?${params}`,
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const blob = await response.blob();
const imgUrl = URL.createObjectURL(blob);
require 'net/http'
uri = URI('https://api.requiems.xyz/v1/tech/qr')
uri.query = URI.encode_www_form(data: 'https://example.com', size: 200, recovery: 'high')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
File.write('qrcode.png', response.body, mode: 'wb')
Error Responses
bad_request
Missing or invalid parameters (e.g. data not provided, size out of range, unknown recovery level)
internal_error
Failed to generate QR code
Generate QR Code (Base64 JSON)
Returns a JSON envelope containing the QR code as a base64-encoded PNG string, along with its dimensions.
https://api.requiems.xyz/v1/tech/qr/base64
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| data | string |
Required | The text or URL to encode in the QR code |
| size | integer |
Optional | Image size in pixels (default: 256, min: 50, max: 1000) |
| recovery | string |
Optional | Error-correction level: low (7%), medium (15%), high (25%), highest (30%). Default: medium |
Try it out
Live DemoRequest
The text or URL to encode in the QR code
Image size in pixels (default: 256, min: 50, max: 1000)
Error-correction level: low (7%), medium (15%), high (25%), highest (30%). Default: medium
Response Fields
| Field | Type | Description |
|---|---|---|
| image | string |
Base64-encoded PNG image data |
| width | integer |
Width of the generated image in pixels |
| height | integer |
Height of the generated image in pixels |
Code Examples
curl "https://api.requiems.xyz/v1/tech/qr/base64?data=https://example.com&size=200&recovery=highest" \
-H "requiems-api-key: YOUR_API_KEY"
import requests
url = "https://api.requiems.xyz/v1/tech/qr/base64"
headers = {"requiems-api-key": "YOUR_API_KEY"}
params = {"data": "https://example.com", "size": 200, "recovery": "highest"}
response = requests.get(url, headers=headers, params=params)
result = response.json()["data"]
print(f"Image (base64): {result['image'][:40]}...")
const params = new URLSearchParams({
data: 'https://example.com',
size: 200,
recovery: 'highest'
});
const response = await fetch(
`https://api.requiems.xyz/v1/tech/qr/base64?${params}`,
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const { data } = await response.json();
// Use as an <img> src
document.getElementById('qr').src = `data:image/png;base64,${data.image}`;
require 'net/http'
require 'json'
uri = URI('https://api.requiems.xyz/v1/tech/qr/base64')
uri.query = URI.encode_www_form(data: 'https://example.com', size: 200, recovery: 'highest')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)['data']
puts data['image'][0..39] + '...'
Error Responses
bad_request
Missing or invalid parameters (e.g. data not provided, size out of range, unknown recovery level)
internal_error
Failed to generate QR code