Getting Started
Welcome to the FreeQRCodeGen API. Our API follows REST principles and uses JSON for all request and response bodies. Every endpoint is reached via HTTPS to ensure data integrity and security.
Authentication
Authorize your requests by including your API key in the `X-API-KEY` header. Keep this key secret—anyone with it can generate QRs on your behalf.
Content-Type: application/json
/generate
Generate QR Code
The primary endpoint for creating static QR codes. This returns a JSON response containing the QR image data in Base64 or an SVG string.
curl -X POST "https://freeqrcodegen.online/api/v1/generate" \ -H "X-API-KEY: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "data": "https://google.com", "type": "url", "size": 500, "fg_color": "#5B5FEF" }'
Request Parameters
/save-qr
Save QR to Account
Generates a QR code and automatically saves it to your dashboard. This is required if you want to track analytics or use dynamic destination URLs.
curl -X POST "https://freeqrcodegen.online/api/v1/save-qr" \ -H "X-API-KEY: YOUR_KEY" \ -d '{ "data": "https://yourlink.com", "type": "url", "dynamic": true, "name": "Spring Campaign 2024" }'
/analytics/{short_code}
Fetch Scan Data
Retrieve detailed scan statistics for any dynamic QR code in your account, including device types, countries, and daily scan counts.
curl -G "https://freeqrcodegen.online/api/v1/analytics/abcd123" \ -H "X-API-KEY: YOUR_KEY" \ -d "days=7"
Error Handling
Our API uses standard HTTP response codes to indicate the success or failure of an API request.
Usage Limits
We believe in open developers. Our free tier allows generous experimentation before needing a pro plan.