Appearance
Rate Limits
QR Code API uses rate limiting to ensure fair usage and maintain service quality for all users.
Limits by Plan
| Plan | Monthly Limit | Requests/Second |
|---|---|---|
| Free | 1,000 | 2 |
| Starter | 10,000 | 10 |
| Pro | 100,000 | 50 |
| Enterprise | Unlimited | Custom |
How Rate Limiting Works
Monthly Limits
Each plan includes a fixed number of API requests per month. The counter resets on the 1st of each month at 00:00 UTC.
Current Usage: 847 / 1,000 requests
Resets: January 1, 2025 00:00 UTCPer-Second Limits
To prevent abuse, requests are also limited per second:
- Free: 2 requests/second
- Starter: 10 requests/second
- Pro: 50 requests/second
Requests exceeding this limit receive a 429 Too Many Requests response.
Rate Limit Headers
Every API response includes headers showing your current usage:
http
HTTP/2 200 OK
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 153
X-RateLimit-Reset: 1704067200| Header | Description |
|---|---|
X-RateLimit-Limit | Total requests allowed per month |
X-RateLimit-Remaining | Requests remaining this month |
X-RateLimit-Reset | Unix timestamp when limit resets |
Handling Rate Limits
429 Too Many Requests
When you exceed the rate limit:
json
{
"error": true,
"message": "Rate limit exceeded",
"retryAfter": 1
}Best Practices
1. Implement Exponential Backoff
javascript
async function generateQR(data, retries = 3) {
for (let i = 0; i < retries; i++) {
const response = await fetch(
`https://www.qrcodeapi.io/api/generate?data=${encodeURIComponent(data)}`,
{ headers: { 'Authorization': `Bearer ${API_KEY}` } }
);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i);
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
continue;
}
return response;
}
throw new Error('Rate limit exceeded after retries');
}2. Cache Generated QR Codes
Don't regenerate the same QR code repeatedly:
javascript
const qrCache = new Map();
async function getQR(data) {
if (qrCache.has(data)) {
return qrCache.get(data);
}
const qr = await generateQR(data);
qrCache.set(data, qr);
return qr;
}3. Batch Requests
If generating multiple QR codes, use the batch endpoint (Pro plan):
javascript
// Instead of 100 individual requests
// Use a single batch request
const response = await fetch('https://www.qrcodeapi.io/api/batch', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: urls.map(url => ({ data: url }))
})
});Checking Your Usage
Via API
bash
curl "https://www.qrcodeapi.io/api/dashboard?action=usage" \
-H "Authorization: Bearer YOUR_API_KEY"Response:
json
{
"plan": "starter",
"usage": {
"current": 4523,
"limit": 10000,
"resetDate": "2025-02-01T00:00:00Z"
}
}Via Dashboard
Visit Dashboard → Usage to see:
- Current month usage
- Usage history graph
- Usage by endpoint
- Peak usage times
Upgrading Your Plan
If you're consistently hitting rate limits, consider upgrading:
- Go to Dashboard → Settings
- Click "Upgrade Plan"
- Select your new plan
- Complete payment
Upgrades are prorated and take effect immediately.
Enterprise Limits
Need more than 100,000 requests/month? Contact us for enterprise pricing:
- Unlimited requests
- Custom rate limits
- Dedicated support
- SLA guarantees
- Volume discounts
Related
- Authentication - API key setup
- Error Codes - All error responses
- Batch Generation - Efficient bulk QR codes