This project provides a simple REST API for generating QR codes dynamically using Spring Boot and ZXing. You can customize the content, size, type, and error correction level of the QR codes.
git clone https://github.com/IbnBaqqi/qrcode-api.git
cd qrcode-apiThis is a Gradle project. To start the application:
./gradlew bootRunIf you're on Windows:
gradlew.bat bootRunOnce running, the application will be available at:
http://localhost:8080This API has no authentication or complex setup—just one endpoint to generate QR codes.
Check if the API is up:
GET /api/healthGET /api/qrcode| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
content |
string |
✅ | – | Text to encode in the QR code |
size |
int |
❌ | 250 | Image size in pixels (150–350 allowed) |
type |
string |
❌ | png | Image format: png, jpeg, or gif |
correction |
char |
❌ | L | Error correction level: L, M, Q, or H |
curl "http://localhost:8080/api/qrcode?content=https://github.com/IbnBaqqi&size=300&type=png&correction=H" --output qrcode.pngcontentmust not be blanksizemust be between 150 and 350typemust be one of:png,jpeg,gifcorrectionmust be one of:L,M,Q,H
Invalid input returns 400 Bad Request.
- Java 21
- Spring Boot
- Gradle
- ZXing
Please open an issue with steps to reproduce or an example request.