A flexible backend API for generating QR codes in various formats, including text, URL, vCard, MeCard, WiFi, email, SMS, telephone, geo location, calendar events, Bitcoin, and UPI.
- Generate QR codes for multiple data types
- Supports both GET (query params) and POST (JSON body) requests
- Customizable foreground and background colors
- Built with Express, TypeScript, and QRCode
- Text/URL
- vCard
- MeCard
- WiFi
- SMS
- Telephone
- Geo Location
- Calendar Event
- Bitcoin
- UPI
See formatsExample.md for detailed format examples.
Generate a QR code using query parameters.
Example:
GET /api/create/vcard?firstName=John&lastName=Doe&email=john@example.com
Generate a QR code using a JSON body.
Example:
POST /api/create/wifi Content-Type: application/json
{ "type": "WPA", "ssid": "MyNetwork", "password": "mypassword" }
Add fg and bg parameters (hex color codes) to customize QR code colors.
Example:
GET /api/create/text_url?text_url=Hello&fg=%23000000&bg=%23ffffff
See examples
- Node.js (v18+ recommended)
- npm
# Dependency Installation
npm install
# Development
npm run dev
#Build
npm run build
# Start (Production)
npm startEnvironment variables can be set in a .env file:
PORT=<PORT>
REDIS_URL=redis://localhost:6379