DEV Community

shaheen amjed
shaheen amjed

Posted on

Needs a professional Qr code generater ?

A powerful and production-ready QR Code Generator API with extensive customization options. Easily create QR codes for URLs, text, Wi-Fi credentials, emails, phone numbers, and geolocations using a single POST request. The API supports multiple output formats (png, svg, base64) and allows customization of size, colors, margin, and error correction level.
Link : https://rapidapi.com/dreamers-dev-dreamers-dev-default/api/ultimate-qr-code-generator-api

πŸ“¦ Ultimate QR Code Generator API – Overview

A fast, secure, production-ready REST API for generating QR codes with powerful customization options.

> βœ… Designed to be lighter, faster, and more powerful than alternatives
> βœ… Zero database required
> βœ… Built-in caching, validation, rate-limiting, and full customization support


πŸš€ Endpoint

POST /generate

Generates a QR code based on the provided input and options.


πŸ“₯ Request Body (JSON)

Field Type Required Description
data string βœ… Yes The content to encode (URL, text, phone, email, etc.)
size number ❌ No Pixel size of the QR code (default: 300, min: 100, max: 2000)
format string ❌ No Output format: png, svg, or base64 (default: png)
foregroundColor string ❌ No QR foreground color (hex, default: #000000)
backgroundColor string ❌ No Background color (hex, default: #ffffff)
errorCorrectionLevel string ❌ No QR error correction level: L, M, Q, H (default: M)
margin number ❌ No Margin around the QR code (default: 4, range: 0–20)

πŸ“€ Example Responses

πŸ–ΌοΈ format: base64

{
  "success": true,
  "format": "base64",
  "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
  "qrType": "url",
  "generatedAt": "2025-07-02T22:10:23.478Z"
}
Enter fullscreen mode Exit fullscreen mode

πŸ“¦ format: png or svg

Returns the image directly with proper headers:

Content-Type: image/png
X-Cache: HIT
X-QR-Type: url
Enter fullscreen mode Exit fullscreen mode

🧠 Smart QR Type Detection

Automatically detects and labels QR type based on content:

  • βœ… URLs
  • βœ… Plain Text
  • βœ… Wi-Fi (WIFI:T:WPA;S:MyNetwork;P:pass123;;)
  • βœ… Email addresses (mailto: or raw email)
  • βœ… Phone numbers (tel: or raw number)
  • βœ… Geo coordinates (geo:lat,lon)

πŸ” Built-in Protection

Feature Description
Rate Limiting Protects from abuse (100 req/15 min/IP)
Caching Speeds up repeat requests (stored by hash key)
Input Validation Uses validator.js to sanitize and protect input
Helmet Secures HTTP headers
CORS Public-friendly, supports all origins

πŸ“š Additional Endpoints

Endpoint Method Description
/ GET API welcome and usage documentation
/generate POST Main QR code generation endpoint
/health GET Health check: memory, uptime, cache stats

Top comments (0)