per l’integrazione
Un codice QR in una sola richiesta
Invia i contenuti e le impostazioni di design attraverso GET / POST e riceve un PNG o SVG senza ulteriore controllo di scansione.
Libero e per sempre.PNG, SVG e API - nessuna tassa o abbonamenti.
Codice QR diretto. Nessuna trasmissione, nessuna scadenza.
GET / POSThttps://qivo.umind.group/
Richiesta e autenticazione
Passare la tua chiave nell'anello X-API-Key. sessioni editoriali e cookie non sono richiesti. QIVO_API_KEY in questo esempio è una variabile di ambiente client contenente la tua chiave.
curl --fail --show-error --get 'https://qivo.umind.group/' \
--header "X-API-Key: $QIVO_API_KEY" \
--data-urlencode 'data=https://umind.group' \
--data-urlencode 'contentType=url' \
--data-urlencode 'format=svg' \
--data-urlencode 'shape=rounded' \
--data-urlencode 'size=1024' \
--output qr-code.svgSe la tua integrazione accetta solo un URL, passare la chiave nel parametro chiave:
https://qivo.umind.group/?key=YOUR_SECRET_KEY&data=https%3A%2F%2Fumind.group&format=png&size=1024Il titolo prende precedenza sul parametro chiave. URL codifica valori di parametri: # → %23, + → %2B, e & dentro un valore → %26.
Utilizzare HTTPS e tenere la chiave sul tuo server. Non metterla in JavaScript pubblico. Le chiavi e i dati nelle URL GET possono apparire nella storia del browser o nei log del server; preferisci il titolo per la tua chiave.
Esempi di codice
Mantenere la chiave nella variabile ambiente QIVO_API_KEY; non pubblicarla nel codice di pagina.
<?php
$key = getenv('QIVO_API_KEY');
if (!$key) throw new RuntimeException('Set QIVO_API_KEY');
$query = http_build_query([
'data' => 'https://umind.group', 'format' => 'svg',
'shape' => 'rounded', 'size' => 1024,
], '', '&', PHP_QUERY_RFC3986);
$curl = curl_init('https://qivo.umind.group/?' . $query);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$image = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
if ($image === false || $status !== 200) {
throw new RuntimeException('Qivo request failed: ' . $status);
}
file_put_contents('qr-code.svg', $image);import { writeFile } from 'node:fs/promises';
const key = process.env.QIVO_API_KEY;
if (!key) throw new Error('Set QIVO_API_KEY');
const url = new URL('https://qivo.umind.group/');
url.search = new URLSearchParams({
data: 'https://umind.group', format: 'svg',
shape: 'rounded', size: '1024'
});
const response = await fetch(url, {
headers: { 'X-API-Key': key },
signal: AbortSignal.timeout(30000)
});
if (!response.ok) throw new Error(`Qivo request failed: ${response.status}`);
await writeFile('qr-code.svg', Buffer.from(await response.arrayBuffer()));import os
from pathlib import Path
from urllib.parse import urlencode
from urllib.request import Request, urlopen
key = os.environ['QIVO_API_KEY']
query = urlencode({
'data': 'https://umind.group', 'format': 'svg',
'shape': 'rounded', 'size': 1024,
})
request = Request('https://qivo.umind.group/?' + query,
headers={'X-API-Key': key})
# urlopen raises HTTPError for unsuccessful HTTP responses.
with urlopen(request, timeout=30) as response:
Path('qr-code.svg').write_bytes(response.read())Il logo di upload
POSThttps://qivo.umind.group/
Content-Type: multipart/form-dataX-API-Key: YOUR_SECRET_KEY
Qivo accetta file PNG, JPEG e WebP fino a 2 MB, con un lato massimo di 2048 pixel. le upload SVG non sono accettate. PNG o WebP con trasparenza funziona bene per una marca senza background.
| Parametri | Tipo | Requisiti | Valori |
|---|---|---|---|
X-API-Key | header | richiesto | YOUR_SECRET_KEY |
logo | string | richiesto | upload |
logoFile | file | richiesto | PNG / JPEG / WebP · ≤ 2 MiB · ≤ 2048 × 2048 px · ≤ 4,000,000 px |
logoScale | integer | Opzionale | 12–30 · di default: 24 |
logoPadding | integer | Opzionale | 0–25% · di default: 5 |
GET → logo=none / whatsapp / …POST → logo=upload + logoFilelogoUrl / logoBase64 / SVG / GIF → 422Content-Length > 3 MiB → 413level → H
curl --fail --show-error 'https://qivo.umind.group/' \
--header "X-API-Key: $QIVO_API_KEY" \
--form-string 'data=https://umind.group' \
--form-string 'format=svg' \
--form-string 'logo=upload' \
--form-string 'logoPadding=10' \
--form-string 'logoScale=24' \
--form 'logoFile=@./logo.png;type=image/png' \
--output qr-code.svg<?php
$key = getenv('QIVO_API_KEY');
if (!$key) throw new RuntimeException('Set QIVO_API_KEY');
$curl = curl_init('https://qivo.umind.group/');
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . $key],
CURLOPT_TIMEOUT => 30,
CURLOPT_POSTFIELDS => [
'data' => 'https://umind.group', 'format' => 'png',
'logo' => 'upload', 'logoScale' => '24', 'logoPadding' => '10',
'logoFile' => new CURLFile(__DIR__ . '/logo.png', 'image/png', 'logo.png'),
],
]);
$image = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
if ($image === false || $status !== 200) throw new RuntimeException('Qivo: ' . $status);
file_put_contents('qr-code.png', $image);import { readFile, writeFile } from 'node:fs/promises';
const key = process.env.QIVO_API_KEY;
if (!key) throw new Error('Set QIVO_API_KEY');
const form = new FormData();
form.set('data', 'https://umind.group');
form.set('format', 'svg');
form.set('logo', 'upload');
form.set('logoPadding', '10');
form.set('logoFile', new Blob([await readFile('./logo.png')], { type: 'image/png' }), 'logo.png');
// FormData supplies Content-Type and the multipart boundary automatically.
const response = await fetch('https://qivo.umind.group/', {
method: 'POST', headers: { 'X-API-Key': key }, body: form,
signal: AbortSignal.timeout(30000)
});
if (!response.ok) throw new Error(`Qivo: ${response.status}`);
await writeFile('qr-code.svg', Buffer.from(await response.arrayBuffer()));# python -m pip install requests
import os
from pathlib import Path
import requests
with open('logo.png', 'rb') as logo:
response = requests.post(
'https://qivo.umind.group/',
headers={'X-API-Key': os.environ['QIVO_API_KEY']},
data={'data': 'https://umind.group', 'format': 'svg', 'logo': 'upload', 'logoPadding': '10'},
files={'logoFile': ('logo.png', logo, 'image/png')},
timeout=30,
)
response.raise_for_status()
Path('qr-code.svg').write_bytes(response.content)La geometria QR all'interno di un SVG è basata su vectori. Il tuo logo caricato è incorporato come immagine di raster pulito, quindi i suoi dettagli non diventano illimitati. Per un grande poster, controllare l'accuratezza del logo separatamente.
Parametri di design
| Parametri | Tipo | Requisiti | Valori |
|---|---|---|---|
X-API-Key / key | string | richiesto | chiave segreta: capo o parametro GET |
data | string | Il testo e l'URL | Contenuto richiesto per testo/url |
contentType | string | Opzionale | texturlwifivcardwhatsapptelegramphoneviberemailsmsdi default: text |
format | string | Opzionale | pngsvgdi default: png |
size | integer | Opzionale | 25651210242048di default: 1024 |
shape | string | Opzionale | squaresoftroundeddotsleaf-softleafhorizontalverticalpointednotchedstardiamondxx-roundedplusplus-roundedheartsparkleconfettidi default: square |
border | string | Opzionale | squarecircleroundedskewdrop-tldrop-brleafleaf-inner-brleaf-circleleaf-inner-tlsquare-circlesoft-tlsoft-brsoft-leafroughdi default: square |
center | string | Opzionale | squarecircleroundedskewroughdrop-tldrop-brleafgearstardiamondxx-roundedplusplus-roundedheartdi default: square |
foreground / eyeColor | string | Opzionale | #RRGGBB di default: #192b39 |
background | string | Opzionale | #RRGGBB di default: #ffffff |
level | string | Opzionale | LMQHdi default: M |
quietZone | integer | Opzionale | 0 - 12 moduli di default: 4 |
logo | string | Opzionale | noneuploadwhatsapplinklocationwificredentialemailscanbellmenuscan-mescan-me-v2paypalbitcoinsparkplusdiamonddi default: none |
logoScale | integer | Opzionale | 12–30 di default: 24 |
logoPadding | integer | Opzionale | 0–25% di default: 5 |
logo=upload → POST / · logoFile · level=H
Tipi di contenuto
I campi dipendono dal contenutoType. per gli URL, fornire un completo https:// o http:// indirizzo. per i numeri di telefono, includere il codice paese.
| contentType | I campi necessari | I campi opzionali |
|---|---|---|
| text / url | data | — |
| phone / viber | phone | — |
| whatsapp / sms | phone | message |
| telegram | telegram | — |
| subject, message | ||
| wifi | ssid; wifiSecurity≠nopass → wifiPassword | wifiSecurity (WPA), wifiHidden (0) |
| vcard | firstName / lastName | organization, jobTitle, phone, email, website, address |
https://qivo.umind.group/?key=YOUR_SECRET_KEY&contentType=phone&phone=%2B380671234567&format=svgRisposte di fuoco
Una risposta di successo è il file dell'immagine stesso, senza un taglio JSON. Il contenuto-tipo è immagine/png o immagine/svg+xml. Gli errori vengono restituiti come JSON:
{"error":"Invalid API key."}- 200 — Immagine generata .
- 401 — La chiave scomparsa o invalidata.
- 405 — GET / POST
- 413 — Content-Length > 3 MiB
- 415 — POST: multipart/form-data
- 422 — Parametri invalidi o contenuti mancanti.
- 429 — Il limite del tasso è superato; Retry-After: 60.
- 503 — L'accesso API non è configurato o la protezione non è temporaneamente disponibile.
- 500 — errore di generazione interna.
Limiti e validità
Il limite predefinito è 60 richieste al minuto per IP. Il contenuto codificato è limitato a 800 byte. la produzione PNG supporta fino a 2048 × 2048 px. SVG conserva le forme vectorali.
L'API valida i formati di parametri, la dimensione e il contrasto, ma non esegue un decoder o verifica se i QR scansono.