QR Code Generator API — Create QR Codes Programmatically
QR Code Generator API — Create QR Codes Programmatically
QR codes are everywhere: restaurant menus, event tickets, product packaging, payment systems. If you need to generate them dynamically in your app, a QR code API is the fastest path.
Why Use an API Instead of a Library?
Client-side QR libraries work, but an API gives you:
- Consistent output across all platforms (iOS, Android, web, server)
- No dependencies to maintain in your codebase
- SVG support for perfect scaling at any size
- Custom styling — colors, margins, error correction levels
- Event tickets — encode ticket ID for quick scanning
- Restaurant menus — link to digital menu
- Product packaging — link to product page or manual
- Business cards — encode vCard contact info
- Wi-Fi sharing — encode Wi-Fi credentials
- Payment links — encode payment URL or crypto address
- App downloads — link to App Store / Play Store
Quick Start
Generate a QR Code (cURL)
`bash
curl -X POST https://api.16761.tech/qr \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"https://mysite.com","size":400}' \
-o qr.png
`
Python
`python
import requests
response = requests.post( "https://api.16761.tech/qr", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "text": "https://mysite.com", "size": 400, "format": "png", "darkColor": "#1a1a2e", "lightColor": "#ffffff" } )
with open("qr.png", "wb") as f:
f.write(response.content)
`
Custom Colors
`bash
curl -X POST https://api.16761.tech/qr \
-H "Authorization: Bearer YOUR_KEY" \
-d '{"text":"Hello World","darkColor":"#e94560","lightColor":"#0f3460","size":300}' \
-o branded-qr.png
`
Parameters
| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | text | string | required | Content to encode (max 4000 chars) | | size | integer | 300 | Image size in pixels (max 2000) | | format | string | png | Output format: png or svg | | margin | integer | 4 | Quiet zone margin | | darkColor | string | #000000 | Foreground color (hex) | | lightColor | string | #ffffff | Background color (hex) | | errorCorrection | string | M | Error correction: L, M, Q, or H |
Use Cases
Error Correction Levels
| Level | Recovery | Best For | |-------|----------|----------| | L | 7% | Clean environments, maximum data | | M | 15% | General use (default) | | Q | 25% | Moderate wear expected | | H | 30% | Harsh environments, logos overlay |
Free Tier
100 QR codes/day, no credit card required.
🚀 Get Free API Key