Skip to main content

Endpoint

GET https://qrgen.maybesurya.live/api/qrgen

Making a Request

HTTP Method

GET /api/qrgen
Just a simple GET request - that’s all you need!

Parameters

data
string
required
The text or URL you want to encode. This can be anything - a website link, some text, an email address, whatever you need. Examples: - https://example.com - Hello World - mailto:[email protected] - tel:+1234567890
apiKey
string
Your API key if you want higher rate limits (100 requests/min instead of 10). Format: sk_... Pro tip: Use the x-api-key header instead - it’s more secure.

Headers

x-api-key
string
Your API key. This is the recommended way to authenticate. Example: x-api-key: sk_1234567890abcdef

What You’ll Get Back

Success Response

HTTP Status: 200 OK Content-Type: image/png You’ll get a PNG image back - just save it and you’re done!

Example Usage

curl "https://qrgen.maybesurya.live/api/qrgen?data=https://maybesurya.dev" \
  -H "x-api-key: YOUR_API_KEY" \
  -o qrcode.png

When Things Go Wrong

Missing Data Parameter

HTTP Status: 400 Bad Request
{
  "error": "Missing required parameter: data"
}
Oops, you forgot to include what you want to encode!

Rate Limit Hit

HTTP Status: 429 Too Many Requests
{
  "error": "Rate limit exceeded. Please try again later."
}
You’ve been making too many requests. Wait a bit, or grab an API key for higher limits.

Invalid API Key

HTTP Status: 401 Unauthorized
{
  "error": "Invalid API key"
}
That API key doesn’t look right. Double-check it or grab a new one from the dashboard.

Server Error

HTTP Status: 500 Internal Server Error
{
  "error": "Failed to generate QR code"
}
Something went wrong on our end. Try again in a moment.

Real-World Examples

Website URL

curl "https://qrgen.maybesurya.live/api/qrgen?data=https://maybesurya.dev" -o website-qr.png
curl "https://qrgen.maybesurya.live/api/qrgen?data=mailto:[email protected]?subject=Hello" -o email-qr.png

Phone Number

curl "https://qrgen.maybesurya.live/api/qrgen?data=tel:+1234567890" -o phone-qr.png

Text Message

curl "https://qrgen.maybesurya.live/api/qrgen?data=sms:+1234567890?body=Hello" -o sms-qr.png

WiFi Network

curl "https://qrgen.maybesurya.live/api/qrgen?data=WIFI:T:WPA;S:NetworkName;P:Password;;" -o wifi-qr.png

Plain Text

curl "https://qrgen.maybesurya.live/api/qrgen?data=This%20is%20my%20custom%20text" -o text-qr.png
Don’t forget to URL-encode special characters! Most HTTP libraries do this automatically, but if you’re crafting URLs by hand, you’ll need to handle it.

Quick Templates

Need to get started fast? Here are some copy-paste templates:
bash https://qrgen.maybesurya.live/api/qrgen?data=YOUR_URL
bash https://qrgen.maybesurya.live/api/qrgen?data=mailto:EMAIL_ADDRESS
bash https://qrgen.maybesurya.live/api/qrgen?data=tel:PHONE_NUMBER
bash https://qrgen.maybesurya.live/api/qrgen?data=YOUR_TEXT

Rate Limits

Here’s what you get:
Access TypeRate LimitNeed Authentication?
Free (no key)10 requests/minuteNope
With API key100 requests/minuteYes

Want Higher Limits?

Grab an API key from the dashboard - it takes 30 seconds

Tips & Tricks

Do This: - URL-encode your data parameter - Use HTTPS (always!) - Handle errors gracefully - Cache QR codes when you can - Use API keys in production
Avoid This: - Hardcoding API keys in client code - Generating QR codes on every page load - Ignoring rate limit errors - Putting sensitive data in QR codes unencrypted

Next Steps