Back to Blog
Tutorials

QR Code API: Developer's Guide to Programmatic QR Generation

Complete developer guide to the Quality QR API. Learn how to generate, manage, and track QR codes programmatically with code examples and best practices.

11 min read
QR Code API: Developer's Guide to Programmatic QR Generation

The Quality QR API lets you generate, manage, and track QR codes programmatically. Whether you're building an integration for your SaaS product, automating QR code creation for an e-commerce platform, or creating a custom workflow, the API gives you full control without touching a dashboard.

Why Use a QR Code API?

A dashboard is fine for creating a handful of codes. But programmatic generation is essential when you need to:

  • Automatically create QR codes when new products, orders, or users are added
  • Generate thousands of codes from a database or CRM
  • Embed QR code generation directly into your application
  • Trigger QR code creation from workflows, webhooks, or CI/CD pipelines
  • Build custom interfaces for non-technical team members

Getting Started

Authentication

All API requests require an API key passed in the Authorization header. Generate your key from the Quality QR dashboard under Settings → API Keys.

Authorization: Bearer your_api_key_here

Base URL

All endpoints use the base URL:

https://api.qualityqr.com/v1

Rate Limits

API rate limits depend on your plan. Free tier: 10 requests/minute. Pro: 60 requests/minute. Business: 200 requests/minute. See the full rate limit documentation for details.

Core API Endpoints

Create a QR Code

POST /api/v1/qr-codes

{
  "type": "url",
  "url": "https://example.com",
  "dynamic": true,
  "label": "Homepage Link"
}

Response (201 Created):

{ "id": "qr_8xK2mNp3", "type": "url", "url": "https://example.com", "shortUrl": "https://qr.qualityqr.com/8xK2mN", "dynamic": true, "scans": 0, "createdAt": "2026-02-17T10:30:00Z" }

List QR Codes

GET /api/v1/qr-codes?page=1&limit=20
```
Returns paginated list of all your QR codes with scan counts and status.

Update a Dynamic QR Code

PATCH /api/v1/qr-codes/:id

{
  "url": "https://example.com/updated-page"
}
```
Only works for dynamic codes. The QR code image stays the same—only the destination changes.

Get Scan Analytics

GET /api/v1/qr-codes/:id/analytics?period=30d
```
Returns scan data including total scans, unique scans, geographic breakdown, device types, and time-based trends.

Code Examples

cURL

curl -X POST https://api.qualityqr.com/v1/qr-codes \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "url", "url": "https://example.com", "dynamic": true}'

JavaScript (Node.js)

const response = await fetch('https://api.qualityqr.com/v1/qr-codes', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'url',
    url: 'https://example.com',
    dynamic: true,
  }),
});

const qrCode = await response.json();
console.log(qrCode.shortUrl);

Python

import requests

response = requests.post(
    'https://api.qualityqr.com/v1/qr-codes',
    headers={'Authorization': 'Bearer your_api_key'},
    json={'type': 'url', 'url': 'https://example.com', 'dynamic': True},
)

qr_code = response.json()
print(qr_code['shortUrl'])

Managing Dynamic QR Codes via API

Dynamic codes are where the API really shines. Common management operations:

  • Update destination URL — Redirect scanners to a new page without changing the printed code
  • Pause/resume — Temporarily disable a QR code (returns a custom message when scanned)
  • Delete — Permanently remove a code and its analytics data
  • Batch update — Change destinations for multiple codes in a single request

Webhooks and Analytics Integration

Set up webhooks to receive real-time scan notifications:

POST /api/v1/webhooks

{
  "url": "https://your-app.com/webhook/qr-scan",
  "events": ["scan.created"]
}

Each webhook payload includes the QR code ID, scan timestamp, location, and device data. Use this to trigger workflows—send a notification when a code is scanned, update a CRM record, or log activity in your analytics platform.

Rate Limits and Best Practices

  • Cache responses — Don't re-fetch QR code data that hasn't changed
  • Use batch endpoints — For bulk generation, use the batch create endpoint instead of looping individual requests
  • Handle rate limits gracefully — Implement exponential backoff when you receive 429 responses
  • Store QR code IDs — Save the returned ID in your database for future updates and analytics queries

Check your current usage and limits on the API rate limits page. Upgrade your plan if you need higher limits.

Get started with the API today—create a free account and generate your API key from the dashboard.

Frequently Asked Questions

What are the API rate limits for the free tier?

The free tier allows 10 API requests per minute and 100 requests per day. This is enough for testing and small integrations. The Pro plan increases this to 60 requests/minute, and Business provides 200 requests/minute.

What programming languages does the API support?

The Quality QR API is a standard REST API that works with any programming language that can make HTTP requests. We provide code examples for cURL, JavaScript/Node.js, Python, PHP, Ruby, and Go. Community SDKs are also available for several languages.

Can I create dynamic QR codes through the API?

Yes. Set 'dynamic': true in your create request. Dynamic codes created via API have the same tracking and editing capabilities as those created through the dashboard. Each dynamic code counts against your plan's allowance.

How do I handle API rate limit errors?

When you hit the rate limit, the API returns a 429 status code with a Retry-After header indicating when you can retry. Implement exponential backoff in your code—wait 1 second, then 2, then 4, etc. For bulk operations, use the batch endpoint instead of individual requests.

QQT

Written by

Quality QR Team

The Quality QR team brings together experts in QR technology, marketing, and software development. We're passionate about helping businesses create effective QR code strategies.

Ready to get started?

Create your first QR code in seconds. No credit card required.