Skip to main content
EZQR

API QR Code

QR Code Generator REST API — Batch and Analytics

Create, update, list, and analyze QR codes from your own code — REST API with bearer-token auth, 100 RPM per key, batch endpoint for 100 codes per call, and full scan analytics.

Max plan — $20/mo

The REST API ships with the Max plan

Bearer-token auth, 100 RPM per key, batch endpoint up to 100 codes per call, full scan analytics. Generate a key from Settings → API Keys after upgrading.

About API QR Codes

The dashboard is the right tool for printing 50 codes for a trade show. The REST API is the right tool when QR codes are part of your product — when every new customer record needs a vCard QR, every shipment needs a tracking QR, every order confirmation email needs a personalized payment QR. Anything that scales past "I open the dashboard once a week" belongs in the API, not the form.

The surface is small and predictable. POST `/api/v1/qr-codes` with { name, content_type, content, target_url? } creates a code and returns the QR record with its ID, short link, and the URL to fetch the PNG/SVG/PDF. GET `/api/v1/qr-codes` lists your codes with cursor pagination and filters. PATCH `/api/v1/qr-codes/{id}` updates the destination for dynamic codes — repoint without reprinting. GET `/api/v1/qr-codes/{id}/scans` pulls scan analytics broken down by date, country, device, and referrer. POST `/api/v1/qr-codes/batch` creates up to 100 codes per call — chain calls for the same workflows you'd otherwise run via bulk CSV import.

Auth is bearer token: Authorization: Bearer ezqr_your_key in every request. Rate limit is 100 requests per minute per API key; rate-limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) come back on every response so retry logic is straightforward. The API is on the Max plan ($20/mo) alongside bulk CSV import; the two pair: bulk for one-shot operations, API for anything continuous. Static codes you create via the API survive cancellation — the destination is encoded into the pattern; dynamic codes route through EZQR's redirect for as long as the subscription is active.

Walkthrough

How to Create a API QR Code

  1. Generate an API key

    Sign up, upgrade to the Max plan ($20/mo), and create an API key from Settings → API Keys. Keys are scoped to your account and revocable at any time. Name each key by environment (prod, staging, dev-tasnim) so audit logs are useful.

  2. Make your first request

    POST /api/v1/qr-codes with { "name": "Customer 4471", "content_type": "url", "content": "https://app.example.com/c/4471", "target_url": "https://ez-qr.com/r/abc123" } and an Authorization: Bearer ezqr_... header. Response: the QR record with id, short_code, and asset URLs for PNG/SVG/PDF.

  3. Batch-create where the workflow allows

    POST /api/v1/qr-codes/batch takes an array of up to 100 code definitions in one call. Single-call overhead per code drops to milliseconds, and you stay well under the 100 RPM rate limit. Chain calls if you need more than 100 codes; pair with the bulk CSV import for one-shot operations larger than that.

  4. Repoint dynamic codes after printing

    PATCH /api/v1/qr-codes/{id} with { "target_url": "https://new-destination.com" } updates the redirect for a dynamic code. The printed QR stays the same; the destination changes server-side. Useful when campaigns end, product pages move, or experimental landing pages get rotated.

  5. Pull analytics for attribution and dashboards

    GET /api/v1/qr-codes/{id}/scans?from=2026-01-01&to=2026-01-31 returns aggregated scan counts by date, country, device, and referrer. Pipe into your warehouse, attribution platform, or internal dashboard — every printed-campaign scan is now structured data your team can query.

Where it works

API QR Code Use Cases

SaaS products that mint a QR per customer record — ticketing platforms, e-commerce tools, event-management software where every booking, order, or attendee needs a unique scannable code.

Internal tools that auto-generate codes for asset tracking, inventory, employee badges, or facility wayfinding — IT, ops, and HR teams use the API to keep code generation invisible to non-technical staff.

Marketing platforms creating campaign-specific QRs programmatically — one code per email recipient, per ad creative, per landing-page variant, so attribution is downstream-resolvable.

Print-on-demand and merchandise services that embed QR codes into generated artwork — the API call sits in the order pipeline, returning the SVG to drop into the product template.

CRM and ERP integrations that mint a code when a new contact, product, or order is created — Salesforce flows, HubSpot workflows, NetSuite scripts, all calling the API on record-create triggers.

Logistics and shipping platforms that need a QR per shipment, pallet, or container linking to the tracking record — the API runs in the warehouse pipeline at scale.

Real estate platforms generating a QR per listing on import, linking to the showing schedule or virtual tour, refreshed daily as inventory rotates.

Fitness and gym software (gym/fitness QRs) generating member-specific QRs for check-in, locker assignment, or class registration.

Hospitality platforms generating a QR per room, table, or guest — hotel apps and restaurant POS that hand QRs out at scale.

Warehouse and asset systems minting a code per item at the moment the record is created, with no manual step.

E-commerce platforms generating per-order codes for returns, packing slips and delivery confirmation.

Agency tooling that issues client codes programmatically and pulls scan data back into a client dashboard.

What works in practice

API QR Code Best Practices

Store API keys in environment variables (EZQR_API_KEY), never in source code or version control. Use a secrets manager (Vercel, Doppler, 1Password, AWS Secrets Manager) for production deployments.

Use the batch endpoint (`/api/v1/qr-codes/batch`) for bulk creation — never loop the single-create endpoint. The batch endpoint takes 100 codes per call with milliseconds of overhead; looping single-create burns rate limit and adds tens of seconds.

Implement exponential-backoff retry on 429 (rate-limited) responses. Read X-RateLimit-Reset to know when the window resets. Standard backoff: 1s, 2s, 4s, 8s — fail to a dead-letter queue after 4 retries.

Cache QR records on your side — don't re-fetch the same code on every render. The API returns immutable fields (ID, short code, content) and mutable ones (target URL, scan count); cache the immutable bits aggressively, refresh mutable bits on a TTL that matches your dashboard's refresh cadence.

Use [dynamic codes](/qr-codes/dynamic) for anything you might want to repoint later. Static codes via the API work but cannot be updated after creation. If the destination might shift in the next 12 months, dynamic is the right choice even though it requires an active subscription.

Name keys by environment (prod, staging, dev-firstname) and rotate at a regular cadence. Revoke immediately on team turnover or suspected compromise; the dashboard lets you generate a replacement and keep the old one alive for a grace period.

Set a per-environment scope for testing — your staging key should not be able to mutate production codes. Configure key scopes from Settings → API Keys → Permissions.

Idempotency for batch endpoints: include an Idempotency-Key header with a UUID per logical batch operation. Retries with the same key return the same result without duplicating codes — essential for queue-based workflows where the same job might fire twice.

Keep the key server-side. A key in front-end JavaScript is a key you have published.

Use bulk endpoints for volume. A thousand single calls is slower for you and harder on the rate limit than one batch.

Store the code ID your call returns. Without it you cannot repoint that code later, which removes the main reason to use dynamic codes at all.

API QR Code FAQ

Common questions about generating, printing, and deploying these codes.

How much does the API cost?

API access is on the Max plan at $20/mo. No per-request fees, no per-code fees. Rate limit is 100 requests per minute per API key, with batch creation up to 100 codes per call — so the effective ceiling is ~10,000 new codes per minute per key. If your workflow needs more, contact us and we'll talk about a custom rate-limit tier.

What can I do with the API?

Full CRUD on QR codes plus analytics: create (single or batch up to 100), read (list with cursor pagination, get individual), update (repoint dynamic codes, rename, toggle active), delete (soft delete with 30-day undo), and scan analytics broken down by date, country, device, and referrer. Plus API-key management endpoints for rotation.

What authentication does the API use?

Bearer token auth. Include Authorization: Bearer ezqr_your_key in every request. Keys are generated from your dashboard at Settings → API Keys and are scoped to a single EZQR account. Per-environment scopes let you restrict a staging key to staging codes; production keys can be flagged as read-only or write-only.

Does the API return QR images directly?

The create endpoint returns the QR record with asset URLs for the rendered PNG, SVG, and PDF — fetch the image at the URL when you need it, or pre-cache the URL string in your database. The API itself doesn't stream binary images on the create call; this keeps the response payload small and lets you cache images at your CDN edge instead of EZQR's.

Will codes created via the API survive cancellation?

Static codes (created without a `target_url`) survive forever — the content is encoded into the QR pattern, no server dependency. Dynamic codes (created with a `target_url`) route through EZQR's redirect and need an active subscription. Pick the right tool: static for permanent destinations (asset tags, packaging), dynamic for anything you might need to repoint.

What do I need to start making API calls?

An API key from your dashboard and the ability to send an HTTP POST. That is the whole setup. Keys are scoped to your account, so treat one like a password and keep it server-side rather than in client code.

Can I generate codes without storing them in my account?

Yes. Static generation returns the image without persisting anything, which suits high-volume one-off rendering. Dynamic codes are stored by definition, because something has to hold your redirect. Choose per call, not per account.

What formats does the API return?

PNG, SVG and PDF. Request SVG for anything heading to print or into a layout tool, PNG for screens and email. The response is the file itself, so you pipe it straight into your own storage without a second round trip.

Can I update a dynamic code's destination through the API?

Yes, and this is the call most integrations actually need. Your codes are already printed; the destination changes. One PATCH against the code ID repoints it. Every printed copy follows immediately.

Does the API expose scan analytics?

Yes. Scan counts, timestamps and coarse location come back per code, so you pull them into your own dashboard rather than living in ours. That is the point of integrating. Otherwise the web app does the job.

Is there a rate limit?

100 requests per minute per API key. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers, so your retry logic reads the reset time and backs off precisely. A 429 response carries a Retry-After header in seconds. Batch endpoints count as one request no matter how many codes are in the batch. Use them aggressively.

What happens to my codes if I stop paying for the API?

Your three oldest dynamic codes keep resolving and the rest pause until you resubscribe. Nothing is deleted. That matters most for API users, because you are the ones with codes printed at volume on stock you cannot recall.

Can I use the API to check whether a code still scans?

Yes. Generation responses carry a validation result covering contrast ratio and a decode test, so your pipeline rejects an unreadable code before it reaches a printer. Wire that check into your build. Catching a failed code in CI costs nothing; catching it on a pallet of labels costs a reprint.

Related Articles

Related Industries

Related Guides

Related Tools

Ready to create your API QR code?

Free, no watermarks. Generate and download in seconds.

Generate Free QR Code