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โ
| Endpoint | Description | Price |
|---|---|---|
GET /api/qr/:data | Basic QR code | FREE |
GET /api/qr/address/:address | Wallet address QR | FREE |
GET /api/qr/ens/:name | ENS name QR | $0.001 |
GET /api/qr/payment | EIP-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โ
| Param | Type | Default | Description |
|---|---|---|---|
size | number | 200 | Image size in pixels (50-1000) |
format | string | png | png, svg, or base64 |
color | string | 000000 | Foreground color (hex) |
bg | string | ffffff | Background color (hex) |
margin | number | 4 | Quiet 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โ
| Param | Type | Default | Description |
|---|---|---|---|
size | number | 200 | Image size |
logo | boolean | false | Include ENS logo in center |
resolve | boolean | true | Include 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โ
| Param | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient address or ENS |
value | string | No | ETH amount |
token | string | No | Token contract address |
amount | string | No | Token amount (if token specified) |
chainId | number | No | Chain ID (default: 1) |
data | string | No | Transaction data |
size | number | No | Image 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โ
| Code | HTTP | Description |
|---|---|---|
INVALID_ADDRESS | 400 | Malformed Ethereum address |
INVALID_ENS | 400 | Invalid ENS name format |
ENS_NOT_FOUND | 404 | ENS name not registered |
SIZE_TOO_LARGE | 400 | Size exceeds 1000px |
Error Responseโ
{
"error": true,
"code": "INVALID_ADDRESS",
"message": "Invalid Ethereum address format"
}
Related Endpointsโ
- ENS Resolution โ Resolve names to addresses
- Health & Utilities โ Other utility endpoints
- Wallet Balances โ Check wallet holdings
Try It Nowโ
๐ง Open Swagger UI โ