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.
Vue d'ensemble
Cas d'utilisation
- 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
Fonctionnalités
Points de terminaison de l'API
Generate QR Code (PNG)
Returns a raw PNG image of the QR code. Ideal for direct embedding or file download.
https://requiems.xyz/v1/technology/qr
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| data | string |
Requis | The text or URL to encode in the QR code |
| size | integer |
Facultatif | Image size in pixels (default: 256, min: 50, max: 1000) |
| recovery | string |
Facultatif | 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 |
Essayez-le
Démo en directRequête
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
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| (binary) | bytes |
Raw PNG image bytes. Content-Type is image/png. |
Exemples de code
# Save a 200px PNG with high error-correction
curl "https://requiems.xyz/v1/technology/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://requiems.xyz/v1/technology/qr?data=https://example.com" \
-H "requiems-api-key: YOUR_API_KEY" \
--output qrcode.png
import requests
url = "https://requiems.xyz/v1/technology/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://requiems.xyz/v1/technology/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://requiems.xyz/v1/technology/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')
Réponses d'erreur
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://requiems.xyz/v1/technology/qr/base64
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| data | string |
Requis | The text or URL to encode in the QR code |
| size | integer |
Facultatif | Image size in pixels (default: 256, min: 50, max: 1000) |
| recovery | string |
Facultatif | Error-correction level: low (7%), medium (15%), high (25%), highest (30%). Default: medium |
Essayez-le
Démo en directRequête
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
Champs de réponse
| Champ | 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 |
Exemples de code
curl "https://requiems.xyz/v1/technology/qr/base64?data=https://example.com&size=200&recovery=highest" \
-H "requiems-api-key: YOUR_API_KEY"
import requests
url = "https://requiems.xyz/v1/technology/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://requiems.xyz/v1/technology/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://requiems.xyz/v1/technology/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] + '...'
Réponses d'erreur
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
Batch Generate QR Codes (Base64)
Generate up to 50 base64-encoded QR codes in a single request. Results are returned in input order. The PNG endpoint has no batch variant — use this endpoint for batch generation.
https://requiems.xyz/v1/technology/qr/base64/batch
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| items | array<object> |
Requis | List of QR generation requests (1–50 items). |
| items[].data | string |
Requis | The text or URL to encode. |
| items[].size | integer |
Facultatif | Image size in pixels (50–1000). Defaults to 256. |
| items[].recovery | string |
Facultatif | Error-correction level: low, medium, high, highest. Defaults to medium. |
Essayez-le
Démo en directRequête
List of QR generation requests (1–50 items).
The text or URL to encode.
Image size in pixels (50–1000). Defaults to 256.
Error-correction level: low, medium, high, highest. Defaults to medium.
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| results | array<object> |
Per-item results in input order. |
| results[].data | string |
The input text or URL that was encoded. |
| results[].image | string |
Base64-encoded PNG image data (omitted on error). |
| results[].width | integer |
Width of the generated image in pixels (omitted on error). |
| results[].height | integer |
Height of the generated image in pixels (omitted on error). |
| results[].error | string |
Error message if generation failed (omitted on success). |
| total | integer |
Total number of items processed. |
Exemples de code
curl -X POST https://requiems.xyz/v1/technology/qr/base64/batch \
-H "requiems-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"items": [{"data": "https://example.com"}, {"data": "Hello, World!"}]}'
import requests
url = "https://requiems.xyz/v1/technology/qr/base64/batch"
headers = {
"requiems-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"items": [
{"data": "https://example.com", "size": 256},
{"data": "Hello, World!"}
]
}
response = requests.post(url, headers=headers, json=payload)
for item in response.json()["data"]["results"]:
if item.get("image"):
print(f"{item['data']}: {item['image'][:20]}...")
const response = await fetch('https://requiems.xyz/v1/technology/qr/base64/batch', {
method: 'POST',
headers: {
'requiems-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{ data: 'https://example.com', size: 256 },
{ data: 'Hello, World!' }
]
})
});
const { data } = await response.json();
data.results.forEach(item => {
if (item.image) {
document.getElementById('qr').src = `data:image/png;base64,${item.image}`;
}
});
require 'net/http'
require 'json'
uri = URI('https://requiems.xyz/v1/technology/qr/base64/batch')
request = Net::HTTP::Post.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
items: [
{ data: 'https://example.com', size: 256 },
{ data: 'Hello, World!' }
]
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)['data']
data['results'].each do |item|
puts item['image'][0..19] + '...' if item['image']
end
Réponses d'erreur
The items array is missing, empty, or exceeds 50 items.
The request body is missing or malformed.