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
- Supports versioned APIs (
/apiand/api/v2) - 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 FORMATS.md for detailed format examples.
Base path: /api
GET /api/create/:typePOST /api/create/:typeGET /api/create(legacy text/url-compatible route)POST /api/create(legacy text/url-compatible route)
Base path: /api/v2
GET /api/v2/:typePOST /api/v2/:type
- The
/createsegment was removed from endpoint paths. - The QR type is provided directly in the versioned route path (
/api/v2/:type). - v1 routes are still available for backward compatibility.
Generate a QR code using query parameters.
Example:
GET /api/v2/vcard?firstName=John&lastName=Doe&email=john@example.com
Generate a QR code using a JSON body.
Example:
POST /api/v2/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/v2/text_url?text_url=Hello&fg=%23000000&bg=%23ffffff
See examples
- Node.js (v18+ recommended)
- npm
for docker setup go to feature/docker branch
# 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