QR API Integration: Track Campaigns Without Reprinting Codes

9 October 2026QR API Integration: Track Campaigns Without Reprinting Codes

QR API Integration: Track Campaigns Without Reprinting Codes

Sketch accents framing the article title

A QR API integration lets you generate, customise, and track QR codes programmatically, including updating the destination URL behind a printed code without reprinting anything. This guide walks through the endpoints, authentication, data models, and automation patterns you need, starting with how to get an API key and run your first request. We will also cover the ISO/IEC 18004 symbology standard and how a platform like QRlytics puts these pieces together.


TL;DR:

  • Only dynamic codes can change destinations after printing; static codes remain fixed, while analytics and dynamic generation usually require a paid plan.
  • Store API keys in environment variables or a secrets vault, handle rate limits with exponential backoff, and cache image URLs after retrieval.
  • Test branded codes on three phone models before printing, and preserve a quiet zone of roughly four modules with strong contrast.
  • Use signed webhooks for real time scan events, add idempotency keys to prevent duplicate counts, and check data retention and privacy practices.
  • Pin client code to a specific API version, test upgrades in a sandbox, and verify that existing short URLs remain active after billing changes.

Qrlytics
qrlytics.app
Keep Printed QR Campaigns Working
QRlytics lets you update dynamic code destinations and track scans, helping you manage campaigns without replacing printed materials.
Explore QRlytics

Table of Contents

  • Core capabilities a QR code API should offer
  • Quick start: creating and embedding a QR code
  • Choosing the right QR type and payload fields
  • Keeping QR images print-ready and on-brand
  • Turning scans into data with analytics and webhooks
  • Connecting QR scans to your automation stack with MCP
  • Why a production-ready platform matters for long campaigns
  • Versioning and backwards compatibility of QR code APIs
  • What we’d recommend for anyone building this long-term
  • How QRlytics puts this into practice
  • FAQ
  • Sources

Core capabilities a QR code API should offer

Most QR code APIs expose a similar set of operations. Before you integrate one, check that it covers the basics plus the gating details that affect your architecture.

  • Create: generate a new QR code (static or dynamic) from a payload.
  • Get and list: retrieve a single code’s details or page through your account’s codes.
  • Update: change the destination URL on dynamic codes only; static codes are fixed at creation.
  • Delete: remove a code and, depending on the plan, archive its scan history.
  • Image retrieval: fetch the rendered QR as a PNG or SVG by code ID.

Dynamic codes work through a short URL that redirects to your real destination, which is what makes the destination editable after printing. Authentication typically uses an API key passed in a header, sometimes as a bearer token, and most providers apply rate limits per key to prevent abuse. Expect dynamic codes and analytics to sit behind a paid plan: free tiers usually cover static generation only.

Quick start: creating and embedding a QR code

Getting your first code onto a page takes four steps once you have an API key.

  1. Store your key securely: keep it in an environment variable or a secrets vault, never hardcoded in client-side code.
  2. Create a dynamic QR code: send a POST request with your destination URL, for example curl -X POST https://api.example.com/v1/qr -H "X-API-Key: $QR_API_KEY" -d '{"type":"url","target":"https://yoursite.com/launch","is_dynamic":true}', following the request shape shown in representative QR API documentation.
  3. Fetch the image: a GET request to the image endpoint, such as GET /v1/qr/{id}/image?format=svg, returns the file you embed directly into a web page or app.
  4. Handle failures gracefully: build retry logic with exponential backoff for rate-limit responses, and log validation errors separately from network errors so you can tell a bad payload from a dropped connection.

Node.js and Python clients follow the same pattern: authenticate, POST the payload, then GET the image URL once the code exists. Cache the returned image URL where possible rather than re-fetching on every page load, since QR images rarely change once a campaign is live.

Choosing the right QR type and payload fields

The API call you send depends on what the code needs to hold. Getting the type right at creation avoids re-issuing codes later.

  • URL: the most common type, pointing to a webpage, with is_dynamic set to true if you want it editable.
  • Text: plain text payloads for instructions, short messages, or product codes.
  • vCard: structured contact fields (name, phone, email) that populate a contact card on scan.
  • Wi-Fi: network name, password, and security type, letting a phone join automatically.
  • PDF: a hosted document link, often used for menus or manuals.

Useful flags beyond the content type include custom_slug for a readable short URL, password protection for gated content, and campaign start and end dates for time-boxed promotions. The underlying symbology follows ISO/IEC 18004, which sets error-correction levels and size constraints that affect how much data a code can safely hold. Test payloads against the API’s validation rules before launch: missing required fields or malformed URLs are the most common rejection reasons.

Keeping QR images print-ready and on-brand

A code that looks right on screen can still fail to scan once printed, so design choices matter as much as the API call.

Leave a clear quiet zone around the code (an empty margin equal to roughly four modules) and keep contrast high, ideally dark modules on a light background. For print, aim for a minimum module size of around 0.3mm at the intended scan distance, and export at a DPI suited to your printer rather than relying on a screen-resolution file. Adding a logo is safe at a higher error-correction level, since the extra redundancy compensates for the obscured area. SVG suits large-format and vector print jobs, while PNG works well for web and most everyday use. For accessibility, include alt text describing where the code leads and offer the same destination as a typed link nearby for anyone who cannot scan it.

Key checks for print-ready QR codes

Pro Tip: Test every branded code on at least three phone models before printing a large run, since camera quality varies more than most people expect.

Turning scans into data with analytics and webhooks

Once codes are live, the API should give you both the per-code detail and the campaign-wide picture.

  • Per-QR analytics: scan counts, timestamps, device type, and approximate location for an individual code.
  • Aggregated overview: totals across a campaign or account, often visualised as a geolocation heatmap.
  • Webhooks: real-time POST notifications fired on each scan, which should be signed so you can verify they came from the provider.
  • Exports: CSV or JSON downloads for feeding analytics into a spreadsheet or data warehouse.

Build webhook handlers with idempotency keys so a retried delivery does not double-count a scan, a pattern common across QR API documentation examples. For retention and privacy, check how long scan data is kept and whether personal identifiers are stripped, since GDPR-compliant tracking generally means avoiding device fingerprinting and giving users control over what is logged. A typical pipeline runs webhook to automation layer to CRM, so a scan can trigger a follow-up email or update a lead record within seconds.

Connecting QR scans to your automation stack with MCP

An MCP integration gives your automation layer a structured way to read QR events without polling the API directly, following practical event-level QR code Check-In workflows. The flow runs: a dynamic QR code resolves through its short URL, a scan fires a webhook, and the MCP layer records the event and triggers whatever logic you have configured.

  • ID mapping: store the QR code’s ID alongside your internal campaign ID so events reconcile cleanly, and use a human-readable slug for anyone auditing the mapping by hand.
  • Loyalty enrolment: automatically add a scanning device to a loyalty flow the first time it hits a code.
  • Fulfilment triggers: kick off a shipping or ticketing process the moment a code tied to an order is scanned.
  • A/B landing redirects: route scans to different landing pages based on time, location, or scan count.

Our MCP integration connects scan events directly into your existing automation tools, so when a scan webhook fires from a printed code, it can update a CRM record or launch a workflow without requiring custom polling code on your end.

Why a production-ready platform matters for long campaigns

Printed QR codes often outlive the marketing push that created them, which is why permanence matters more than most teams expect at launch. Codes we create during an active subscription keep working regardless of later billing status, so a poster from a past campaign never redirects to a dead link. Alongside that, dynamic URL updates, GDPR-compliant tracking, and scan heatmaps give you both the reliability and the visibility to run a campaign end to end. You can get started without a credit card and reach the API docs directly from our dynamic QR code generator, with plan details on our pricing page.

Versioning and backwards compatibility of QR code APIs

API versions matter because a QR code printed today might still be scanned in five years, long after the integration that created it has changed providers, frameworks, or maintainers. A well-designed QR API versions its endpoints explicitly, typically with a path prefix such as /v1/ or /v2/, so a breaking change ships as a new version rather than silently altering existing behaviour.

Backwards compatibility matters most for the redirect layer itself: even if an API’s request and response formats change between versions, the short URLs it has already issued need to keep resolving to their destinations indefinitely. That separation, between the API surface you integrate against and the redirect infrastructure sitting behind each printed code, is what lets a provider update its platform without breaking codes already in the field.

When evaluating a provider, check whether older API versions are deprecated on a timeline or supported indefinitely, and whether response payloads add new fields over time rather than removing or renaming existing ones. A provider that documents its deprecation policy up front saves you from discovering a breaking change when a batch job suddenly fails. For campaign-critical integrations, pin your client code to a specific API version and test against a sandbox before upgrading, rather than always calling the latest version by default.

Versioning and backwards compatibility of QR code APIs — overview diagram

What we’d recommend for anyone building this long-term

For printed or long-running campaigns, pair dynamic codes with a permanent redirect guarantee, lean on webhooks for real-time triggers, and keep scheduled exports for your reporting pipeline. Get the print design and error-correction level right early: a scan failure in the field costs more than a code change ever will.

*— The

How QRlytics puts this into practice

We built QRlytics so the features covered here, dynamic updates, real-time analytics, and permanent redirects, work together out of the box rather than as separate add-ons you have to stitch in yourself. Codes created during an active subscription keep resolving even if billing lapses, and GDPR-compliant tracking means you get scan data without compromising on privacy.

Qrlytics

Getting started takes a few minutes: sign up with no credit card required, grab your API key from the dashboard, and create your first dynamic code either through our dynamic QR code generator or directly via the API. Check pricing for plan details once you are ready to scale beyond the free tier.

FAQ

What is the difference between a dynamic and static QR code?

A static QR code has its destination baked in permanently, so changing the link means printing a new code. A dynamic QR code redirects through a short URL you control, so you can update where it points without reprinting anything.

How do I authenticate requests to a QR code API?

Most QR code APIs authenticate with an API key sent in a request header, sometimes formatted as a bearer token. Keep the key in an environment variable or secrets vault rather than embedding it in client-side code.

What does QRlytics cost for API access?

QRlytics offers a Free plan at $0 per year, and a Pro plan with pricing available on request through the same pricing page. API access and advanced analytics typically sit on the paid tier.

Why would a printed QR code stop working?

A QR code typically stops working when the hosting service is discontinued, a subscription lapses, or a static code’s destination URL is taken offline. Codes we create during an active subscription are built to keep redirecting regardless of later billing status.

Can I track individual scans from a QR code API?

Yes, most QR code APIs expose per-code analytics covering scan counts, timestamps, device type, and approximate location, alongside an aggregated view across a campaign. Our QR code analytics guide covers the metrics worth tracking for a campaign.

Sources

  • ISO/IEC 18004:2024 — QR code bar code symbology specification
  • qrrq-qrcodegenerator/qrrq-api-docs — example API documentation

Recommended

  • QR Codes for Marketing & Advertising | Track Campaign ROI
  • Track Scan to Conversion: QR Analytics & Campaign Sheet for Marketers
  • Printed material tracking: How to master QR code campaigns
  • QR code tracking: a practical guide for marketers