DEV Community

2x lazymac
2x lazymac

Posted on • Originally published at api.lazy-mac.com

How to Use the QR Code Generator API — Free REST + MCP Server

Need to generate QR codes on the fly? Skip the bloated npm packages. This API generates QR codes as PNG, SVG, or base64 — supports URLs, vCards, WiFi configs, emails, and phone numbers.

Try It Right Now

Generate a PNG QR code in your browser:

https://api.lazy-mac.com/qr-code/api/v1/generate?data=https://api.lazy-mac.com
Enter fullscreen mode Exit fullscreen mode

Or get it as base64 for embedding:

curl -s "https://api.lazy-mac.com/qr-code/api/v1/generate/base64?data=Hello%20World" | jq
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "base64": "data:image/png;base64,iVBORw0KGgoAAAANS..."
}
Enter fullscreen mode Exit fullscreen mode

All Endpoints

Endpoint Description
GET /api/v1/generate?data=TEXT Get QR as PNG image
GET /api/v1/generate/base64?data=TEXT Get QR as base64 string
POST /api/v1/generate Custom size, color, error correction
POST /api/v1/vcard QR from vCard contact info
POST /api/v1/wifi QR for WiFi network credentials

Custom Styled QR Code

curl -s -X POST https://api.lazy-mac.com/qr-code/api/v1/generate \
  -H "Content-Type: application/json" \
  -d '{
    "data": "https://api.lazy-mac.com",
    "size": 500,
    "format": "base64",
    "errorCorrection": "H"
  }' | jq
Enter fullscreen mode Exit fullscreen mode

WiFi QR Code

curl -s -X POST https://api.lazy-mac.com/qr-code/api/v1/wifi \
  -H "Content-Type: application/json" \
  -d '{"ssid": "MyNetwork", "password": "secret123", "encryption": "WPA"}' | jq
Enter fullscreen mode Exit fullscreen mode

Use as an MCP Server

{
  "mcpServers": {
    "qr-code": {
      "url": "https://api.lazy-mac.com/qr-code/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Ask Claude: "Generate a QR code for my website URL"

HTML Integration

<img src="https://api.lazy-mac.com/qr-code/api/v1/generate?data=https://yoursite.com" 
     alt="QR Code" width="300" height="300">
Enter fullscreen mode Exit fullscreen mode

That's it. One <img> tag. No JavaScript required.

Pricing

Tier Requests/mo Price
Free 100 $0
Pro 10,000 $9/mo
Business Unlimited $49/mo

Get Pro Access on Gumroad →


Browse all 22 APIs at api.lazy-mac.com →

More from the lazymac API Toolkit:

Top comments (0)