QRCODE
Gerador de QR Code
Manda qualquer texto ou URL, recebe um PNG de volta. Sem cadastro de conta pra cada código, sem SDK: é uma chamada GET que devolve a imagem pronta.
QR code generator
Send any text or URL, get a PNG back. No per-code account setup, no SDK: it's a GET call that returns the finished image.
SYNC resposta na mesma chamada answers in the same call
Endpoints
Endpoints
/api/v1/qrcode
gera um QR code de texto ou URL
generates a QR code from text or a URL
/api/v1/qrcode/pix
gera um QR code de Pix estático
generates a static Pix QR code
A resposta de sucesso dos dois é a imagem crua (Content-Type: image/png), não o envelope JSON que o resto da API usa. É um PNG, não dado estruturado. Erros continuam vindo como JSON normalmente.
The success response for both is the raw image (Content-Type: image/png), not the JSON envelope the rest of the API uses. It's a PNG, not structured data. Errors still come back as JSON as usual.
Parâmetros
Parameters
| Nome | Name | Onde | In | Descrição | Description |
|---|---|---|---|---|---|
data |
query | obrigatório: o texto ou URL a codificar, até 2000 caracteres | required: the text or URL to encode, up to 2000 characters | ||
size |
query | opcional, padrão 256: lado da imagem em pixels, entre 64 e 1024 |
optional, defaults to 256: image side in pixels, between 64 and 1024 |
Exemplo
Example
curl "https://api.alicercelabs.com.br/api/v1/qrcode?data=https://alicercelabs.com.br&size=256" \
-H "Authorization: Bearer <token>" \
-o qrcode.png
O arquivo salvo é um PNG de verdade, pronto pra abrir ou embutir num <img src>. Não tem passo de decodificação, o corpo da resposta já é a imagem.
The saved file is a real PNG, ready to open or embed in an <img src>. No decoding step, the response body already is the image.
Erros possíveis
Possible errors
| Status | Motivo | Reason |
|---|---|---|
| 400 | data ausente/maior que 2000 caracteres, ou size fora do intervalo 64-1024 | missing/too-long data, or size outside the 64-1024 range |
| 401 | token ausente ou inválido | missing or invalid token |
| 429 | limite de taxa excedido | rate limit exceeded |
QR code de Pix
Pix QR code
Monta o payload EMV/BR Code do Pix (o mesmo formato do "copia e cola") a partir de chave, nome e cidade do recebedor, e devolve tanto a imagem quanto o texto: o PNG no corpo da resposta, o payload no header X-Pix-Copia-Cola. É um QR estático, reutilizável, não expira nem depende de um servidor pra confirmar o pagamento depois.
Builds the Pix EMV/BR Code payload (the same format behind the "copy and paste" code) from the recipient's key, name and city, and returns both: the PNG in the response body, the payload in the X-Pix-Copia-Cola header. It's a static, reusable QR code, it doesn't expire or depend on a server to confirm payment afterward.
| Nome | Name | Onde | In | Descrição | Description |
|---|---|---|---|---|---|
chave |
query | obrigatório: a chave Pix do recebedor (CPF, CNPJ, email, telefone ou chave aleatória), até 77 caracteres | required: the recipient's Pix key (CPF, CNPJ, email, phone or random key), up to 77 characters | ||
nome |
query | obrigatório: nome do recebedor, até 25 caracteres (acento é removido automaticamente) | required: the recipient's name, up to 25 characters (accents are stripped automatically) | ||
cidade |
query | obrigatório: cidade do recebedor, até 15 caracteres | required: the recipient's city, up to 15 characters | ||
valor |
query | opcional: valor da cobrança em reais (ex. 10.50), maior que zero. Sem ele, quem paga digita o valor |
optional: the charge amount in reais (e.g. 10.50), greater than zero. Without it, the payer types in the amount |
||
txid |
query | opcional: identificador da transação, só letras e números, até 25 caracteres. Sem ele, vai *** (convenção do padrão pra "sem identificador") |
optional: the transaction identifier, letters and digits only, up to 25 characters. Without it, defaults to *** (the standard's convention for "no identifier") |
||
descricao |
query | opcional: texto livre embutido no payload, até 72 caracteres | optional: free text embedded in the payload, up to 72 characters | ||
size |
query | opcional, padrão 256: lado da imagem em pixels, entre 64 e 1024 |
optional, defaults to 256: image side in pixels, between 64 and 1024 |
curl "https://api.alicercelabs.com.br/api/v1/qrcode/pix?chave=11999999999&nome=Fulano&cidade=Sao+Paulo&valor=10.50" \
-H "Authorization: Bearer <token>" \
-o pix.png -D headers.txt
grep Pix-Copia-Cola headers.txt
Não valida se a chave existe de verdade, só o formato: confirmar isso exigiria consultar o DICT do Banco Central, fora do escopo desta API. Uma chave inválida gera um QR code válido que o app do pagador vai rejeitar na hora de pagar.
Doesn't validate whether the key actually exists, only its format: confirming that would require querying the Central Bank's DICT, out of scope for this API. An invalid key produces a valid QR code that the payer's app will reject at payment time.
| Status | Motivo | Reason |
|---|---|---|
| 400 | chave/nome/cidade ausente ou maior que o limite, valor não numérico ou <= 0, txid com caractere inválido ou muito longo, descricao muito longa, ou size fora do intervalo 64-1024 | missing/too-long chave/nome/cidade, non-numeric or <= 0 valor, invalid character or too-long txid, too-long descricao, or size outside the 64-1024 range |
| 401 | token ausente ou inválido | missing or invalid token |
| 429 | limite de taxa excedido | rate limit exceeded |
Usando o SDK
Using the SDK
As duas rotas devolvem um PNG cru, não o envelope JSON. .Save(caminho) grava o arquivo direto.
Both routes return a raw PNG, not the JSON envelope. .Save(path) writes the file directly.
SDKs oficiais: Go · Python · JavaScript.
Official SDKs: Go · Python · JavaScript.
Gerar um QR code
Generate a QR code
import (
"context"
"fmt"
alicercelabs "github.com/alicercelabs/alicercesdk-go"
)
client := alicercelabs.New("alk_...")
ctx := context.Background()
qr, err := client.QRCode.Generate(ctx, "https://alicercelabs.com.br", 512)
if err != nil {
panic(err)
}
qr.Save("qrcode.png")from alicercelabs import AlicerceLabs
client = AlicerceLabs(api_key="alk_...")
qr = client.qrcode.generate("https://alicercelabs.com.br", size=512)
qr.save("qrcode.png")import { AlicerceLabs } from "alicercesdk-javascript";
const client = new AlicerceLabs("alk_...");
const qr = await client.qrcode.generate("https://alicercelabs.com.br", 512);
await qr.save("qrcode.png");QR code de Pix
Pix QR code
monta o payload EMV/BR Code e devolve o PNG; o "copia e cola" vem no header X-Pix-Copia-Cola.
builds the EMV/BR Code payload and returns the PNG; the "copia e cola" text comes in the X-Pix-Copia-Cola header.
pix, err := client.QRCode.Pix(ctx, alicercelabs.PixParams{
Chave: "11999999999",
Nome: "Fulano de Tal",
Cidade: "Sao Paulo",
Valor: 10.50, // opcional, sem isso quem paga digita o valor
})
pix.Save("pix.png")
fmt.Println(pix.CopiaCola)pix = client.qrcode.pix(chave="11999999999", nome="Fulano de Tal", cidade="Sao Paulo", valor=10.50)
pix.save("pix.png")
print(pix.headers["x-pix-copia-cola"])const pix = await client.qrcode.pix({
chave: "11999999999",
nome: "Fulano de Tal",
cidade: "Sao Paulo",
valor: 10.50, // opcional, sem isso quem paga digita o valor
});
await pix.save("pix.png");
console.log(pix.headers.get("X-Pix-Copia-Cola"));Limites
Limits
100/dia · 4/hora sem token, por IP chamador; com uma API key (gerada no painel), 1.000/dia · 41/hora. Contado separado por operação: /qrcode e /qrcode/pix têm cotas independentes. Os dois endpoints geram o mesmo conteúdo pra os mesmos parâmetros, então o resultado fica em cache por 24h. Chamadas repetidas com os mesmos parâmetros não recalculam nada.
100/day · 4/hour without a token, per calling IP; with an API key (generated in the panel), 1,000/day · 41/hour. Counted separately per operation: /qrcode and /qrcode/pix have independent quotas. Both endpoints produce the same content for the same parameters, so the result is cached for 24h. Repeated calls with the same parameters don't recompute anything.