Skip to main content

QR Code Generation

Generate QR codes for wallet addresses, ENS names, and payment links.

Try it Live

Open in Swagger UI โ†’ to test these endpoints interactively.

Endpointsโ€‹

EndpointDescriptionPrice
GET /api/qr/:dataBasic QR codeFREE
GET /api/qr/address/:addressWallet address QRFREE
GET /api/qr/ens/:nameENS name QR$0.001
GET /api/qr/paymentEIP-681 payment QR$0.001

GET /api/qr/:dataโ€‹

Generate a QR code for any text data.

Requestโ€‹

curl "https://api.web3identity.com/api/qr/Hello%20World" --output qr.png

Query Parametersโ€‹

ParamTypeDefaultDescription
sizenumber200Image size in pixels (50-1000)
formatstringpngpng, svg, or base64
colorstring000000Foreground color (hex)
bgstringffffffBackground color (hex)
marginnumber4Quiet zone margin

Responseโ€‹

Returns image binary (PNG/SVG) or JSON with base64:

# Get PNG (default)
curl "https://api.web3identity.com/api/qr/test" --output qr.png

# Get SVG
curl "https://api.web3identity.com/api/qr/test?format=svg" --output qr.svg

# Get base64 JSON
curl "https://api.web3identity.com/api/qr/test?format=base64"

Base64 Response:

{
"data": "test",
"format": "base64",
"image": "data:image/png;base64,iVBORw0KGgo..."
}

GET /api/qr/address/:addressโ€‹

Generate a QR code for a wallet address with EIP-55 checksum.

Requestโ€‹

curl "https://api.web3identity.com/api/qr/address/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045?size=300" \
--output vitalik-qr.png

Responseโ€‹

PNG image containing the checksummed address.

SDKโ€‹

const qrUrl = client.getAddressQRUrl('0xd8dA...');
// Returns: https://api.web3identity.com/api/qr/address/0xd8dA...

JavaScriptโ€‹

const BASE_URL = 'https://api.web3identity.com';

function getAddressQRUrl(address, size = 200) {
return `${BASE_URL}/api/qr/address/${address}?size=${size}`;
}

// Use in HTML
const img = document.createElement('img');
img.src = getAddressQRUrl('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 300);
img.alt = 'Wallet QR Code';
document.body.appendChild(img);

React Componentโ€‹

function WalletQR({ address, size = 200 }) {
const url = `https://api.web3identity.com/api/qr/address/${address}?size=${size}`;

return (
<img
src={url}
alt={`QR code for ${address.slice(0, 8)}...`}
width={size}
height={size}
/>
);
}

// Usage
<WalletQR address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" size={300} />

GET /api/qr/ens/:nameโ€‹

Generate a QR code for an ENS name with optional logo overlay.

Requestโ€‹

curl "https://api.web3identity.com/api/qr/ens/vitalik.eth?size=300&logo=true" \
--output vitalik-ens-qr.png

Query Parametersโ€‹

ParamTypeDefaultDescription
sizenumber200Image size
logobooleanfalseInclude ENS logo in center
resolvebooleantrueInclude resolved address

Responseโ€‹

QR code containing ethereum:vitalik.eth (EIP-681 format).


GET /api/qr/paymentโ€‹

Generate an EIP-681 payment request QR code.

Requestโ€‹

curl "https://api.web3identity.com/api/qr/payment?\
to=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&\
value=0.1&\
chainId=1" --output payment-qr.png

Query Parametersโ€‹

ParamTypeRequiredDescription
tostringYesRecipient address or ENS
valuestringNoETH amount
tokenstringNoToken contract address
amountstringNoToken amount (if token specified)
chainIdnumberNoChain ID (default: 1)
datastringNoTransaction data
sizenumberNoImage size

Example: ETH Paymentโ€‹

# Request 0.1 ETH payment
curl "https://api.web3identity.com/api/qr/payment?\
to=vitalik.eth&\
value=0.1" --output eth-payment.png

Example: USDC Paymentโ€‹

# Request 100 USDC payment
curl "https://api.web3identity.com/api/qr/payment?\
to=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&\
token=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&\
amount=100&\
chainId=1" --output usdc-payment.png

EIP-681 Formatโ€‹

The QR code contains a standard payment URI:

ethereum:0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045@1?value=1e17

This is compatible with:

  • MetaMask
  • Rainbow
  • Coinbase Wallet
  • Most mobile wallets

Customization Examplesโ€‹

Branded QR (Dark Mode)โ€‹

curl "https://api.web3identity.com/api/qr/address/0xd8dA...?\
color=8b5cf6&\
bg=1a1a2e&\
size=400" --output branded-qr.png

High Resolution for Printโ€‹

curl "https://api.web3identity.com/api/qr/ens/yourname.eth?\
size=1000&\
margin=8&\
format=svg" --output print-qr.svg

Inline in HTML (base64)โ€‹

async function getInlineQR(address) {
const res = await fetch(
`https://api.web3identity.com/api/qr/address/${address}?format=base64`
);
const { image } = await res.json();
return image; // data:image/png;base64,...
}

// Use directly in img src
document.getElementById('qr').src = await getInlineQR('0xd8dA...');

Error Handlingโ€‹

CodeHTTPDescription
INVALID_ADDRESS400Malformed Ethereum address
INVALID_ENS400Invalid ENS name format
ENS_NOT_FOUND404ENS name not registered
SIZE_TOO_LARGE400Size exceeds 1000px

Error Responseโ€‹

{
"error": true,
"code": "INVALID_ADDRESS",
"message": "Invalid Ethereum address format"
}


Try It Nowโ€‹

๐Ÿ”ง Open Swagger UI โ†’