Skip to main content

API de codes QR - Generer des codes QR par programmation

Build QR code generation into your app, SaaS dashboard, mobile backend, e-commerce workflow, or marketing automation stack with QR-Build's REST API. Send JSON parameters, receive PNG, SVG, or base64 JSON output, and manage dynamic QR destinations without rebuilding QR generation yourself.

Site web

Partagez votre site en quelques secondes avec un QR dirigeant vers votre page d’accueil, landing ou page de campagne. Idéal pour affiches, flyers ou cartes, sans saisie d’URL.

1 / 21
A QR code API is a REST endpoint that accepts parameters such as destination URL, output format, image size, and QR type, then returns a QR code image or data object. Developers use QR code APIs to generate QR codes programmatically inside applications instead of creating each code manually.

Qu est-ce qu une API de codes QR ?

A QR code API is a REST endpoint that accepts parameters - such as destination URL, output format, and image size - and returns a QR code as a PNG, SVG, or base64-encoded JSON object. Developers use QR code APIs to generate QR codes programmatically inside applications, without building or maintaining a QR library themselves.

A REST API is an HTTP-based interface that follows standard request and response conventions. In a QR code API, the endpoint is the specific URL your application calls, such as POST /v1/qr, and the request body contains QR parameters like type, data, format, size, color, and whether the code should be static or dynamic.

Developers choose an API when QR creation needs to happen inside a product workflow: a SaaS user clicks create, an e-commerce catalog imports 5,000 SKUs, a mobile app requests a shareable code, or a CRM campaign generates trackable QR assets after an event trigger.

QR-Build supports both static QR codes and dynamic QR codes. A static QR code stores the final destination directly in the QR image. A dynamic QR code stores a QR-Build redirect layer, which allows destination edits and scan analytics after the QR code has already been printed or distributed.

Comment generer un code QR avec l API QR-Build ?

To generate a QR code via API, send an authenticated POST request to the generation endpoint with your desired parameters: URL, format, size, and QR type. The API responds with the QR code image or a JSON object containing image data, and most basic implementations are complete in under 10 lines of code.

The QR-Build API is designed for server-side integration. If you prefer the manual flow first, see how to create a QR code in the web UI, then use the API when generation needs to run from code.

  1. 1 Authenticate with your API key. An API key is a unique credential string that identifies your QR-Build account and authorizes each request.
  2. 2 Send a POST request. Post JSON parameters to the generation endpoint, including the QR type, destination data, image format, and size.
  3. 3 Receive the QR code. The response can return a PNG URL, SVG markup, or a base64 JSON payload depending on the output format you requested.
  4. 4 Update dynamic destinations when needed. For dynamic QR codes, send a PATCH request to change the redirect destination without regenerating the printed QR image.
  5. 5 Retrieve analytics when the QR is dynamic. Use the analytics GET endpoint to pull scan count, timestamps, location, and device breakdown into your own dashboard.

Exemple de requete POST

curl -X POST https://api.qr-build.com/v1/qr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"url","data":"https://example.com","format":"png","size":300}'

Exemple de reponse JSON

{
  "id": "qr_8x4m2p",
  "type": "url",
  "format": "png",
  "static": true,
  "imageUrl": "https://cdn.qr-build.com/qr/qr_8x4m2p.png",
  "createdAt": "2026-07-01T12:00:00Z"
}

Quels formats de requete et de reponse sont pris en charge ?

QR code APIs commonly support PNG for print and email, SVG for scalable web rendering, and base64-encoded JSON for inline embedding. PNG is fixed resolution, SVG stays crisp at any size, and base64 avoids a separate image file request.

Choose the response format based on where the QR code will render, how it will be stored, and whether downstream systems need metadata. We evaluate formats by DPI behavior, file size, browser support, and HTTP round-trips.

Supported Output Formats

FormatBest forNotes
PNG Print, email, quick embedding Raster image with fixed resolution; request a larger size for print and packaging.
SVG Web apps, scalable UI, high-DPI displays Vector format that remains sharp at any size and is ideal for responsive dashboards.
Base64 Inline HTML, PDFs, and no-file workflows Embeds image data in JSON or HTML without a separate public image URL.
JSON Programmatic processing and metadata storage Returns identifiers, image data, destination, format, and creation metadata in one response.

Supported QR Types via API

As of 2026, the QR-Build API supports 12 QR code types. For a broader concept guide, see our overview of types of QR codes.

URL / link

Generate a QR code that opens a web page, landing page, support article, or app deep link.

WiFi

Encode network name, password, and security type so users can join a network after scanning.

vCard

Create contact QR codes with name, phone, email, company, job title, and website fields.

PDF

Point users to manuals, menus, brochures, compliance documents, or downloadable files.

Email

Open a prefilled email with recipient, subject, and body fields.

Phone

Create scan-to-call QR codes for service desks, sales teams, and support labels.

Menu

Generate QR codes for restaurant menus, seasonal menu pages, and table placements.

Coupon

Create promotional QR codes for discounts, redemption pages, and campaign offers.

Crypto

Encode wallet addresses and payment metadata for supported cryptocurrency flows.

PayPal

Create payment QR codes that route to PayPal payment or donation destinations.

Calendar

Generate QR codes for event details, appointment reminders, and calendar invites.

Bulk

Create many QR codes from one batch request for catalogs, tickets, labels, and print runs.

Static vs Dynamic QR Codes via API

A static QR code generated via API encodes the destination URL directly into the image, so it cannot be changed after generation. A dynamic QR code encodes a server-managed redirect URL, so the final destination can be updated later through a PATCH request without reprinting the QR code.

The static-versus-dynamic choice is an architecture decision. Use static QR codes for fixed destinations and dynamic QR codes when campaigns, products, labels, or printed assets may need edits or analytics. Learn how static vs dynamic QR codes differ outside the API context.

FeatureStatic QR via APIDynamic QR via API
Destination editable Non Oui
Scan analytics Non Oui
URL in QR payload Direct final URL QR-Build redirect layer
Ideal pour Fixed assets and permanent links Campaigns, products, packaging, and printed materials
Destination update method Regenerate and reprint PATCH the management endpoint
Plan fit Free-tier testing and fixed usage Paid plans for analytics and higher-volume management

Methodology note: this comparison is based on QR-Build API behavior. Always verify feature availability, rate limits, and plan requirements with your QR provider before production deployment.

Cas d utilisation pour l integration d une API de codes QR

QR code API integrations are best when QR creation is part of another system: product catalogs, SaaS dashboards, mobile apps, marketing automation, event workflows, or document generation. The API removes manual QR creation from repeatable workflows.

These are the integration patterns where QR-Build's API is more useful than a manual generator.

1

E-commerce - Per-product QR codes at scale

Generate QR codes for product pages, packaging inserts, warranty cards, receipts, and shelf labels as SKUs are created or updated. Bulk generation keeps QR output aligned with catalog data.

2

SaaS products - Embedded QR generation

Add QR creation to a dashboard without building a QR rendering engine, redirect layer, or analytics storage from scratch. Your product sends the request; QR-Build handles the QR output.

3

Marketing automation - Campaign QR codes

Trigger QR generation from CRM, CDP, email, or campaign events. Dynamic QR codes let marketers update destinations mid-campaign while keeping printed assets live.

4

Mobile apps - Lightweight API calls

iOS and Android apps can request QR images through a server-side backend, then render an image URL or base64 payload in the app without exposing the API key.

5

Document and label printing

Create QR codes for logistics labels, inventory sheets, compliance packets, and operational documents. This pattern is especially useful when labels are generated from database records.

See QR codes for inventory management

API vs Manual QR Generator - When Should You Use Each?

Use a QR code API when you need to generate QR codes at scale, trigger generation from code, or embed QR functionality directly inside your product. Manual QR generators are better for occasional one-off QR codes where no automation or integration is needed.

QR-Build's QR code generator is the right tool for manual creation. The API is the right tool when QR generation must run from a product workflow, backend job, or automation pipeline.

ScenarioUse APIUse manual generator
One-off QR code for a flyer Meilleur choix
Generate 500+ QR codes for products Meilleur choix
QR codes embedded in a SaaS dashboard Meilleur choix
Campaign QR with an updatable destination Meilleur choix
Quick WiFi QR code for an office Meilleur choix
Real-time QR generation after user action Meilleur choix

Authentification par cle API et securite

The QR-Build API uses API key authentication through the Authorization header, not API keys in URLs. Keep keys server-side, store them in environment variables, rotate compromised keys, and confirm current rate limits on the pricing page before production deployment.

An API key is account-scoped and should be sent as a Bearer token in the Authorization header. Do not place API keys in query strings, browser JavaScript, mobile app binaries, public repositories, or analytics logs.

Run QR generation calls from your backend, serverless function, or trusted integration service. Client-side apps should call your server, and your server should call QR-Build. This prevents users from extracting the key and consuming your quota.

Rate limiting is a server-enforced cap on requests per time window, and plan details can change as products evolve. Review the current pricing page before production rollout instead of relying on copied limits in a blog post or implementation ticket.

QR-Build enforces HTTPS for API traffic. For dynamic QR codes, the QR image stores the redirect layer, not the final destination URL; destination changes happen through authenticated management requests.

Code Examples for the QR Code API

The fastest QR code API integration is a server-side POST request with an Authorization header and a JSON body. The examples below show curl, JavaScript with fetch, and a PATCH request for updating a dynamic QR destination.

Methodology note: the examples below use the same API surface our own QR-Build web generator uses - no separate API tier. Replace placeholder keys and IDs with values from your account before testing.

Generate a URL QR Code (curl)

curl -X POST https://api.qr-build.com/v1/qr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"url","data":"https://example.com","format":"png","size":300}'

Generate a URL QR Code (JavaScript / Nonde.js)

const response = await fetch("https://api.qr-build.com/v1/qr", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.QR_BUILD_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    type: "url",
    data: "https://example.com",
    format: "svg",
    size: 300
  })
});

if (!response.ok) {
  throw new Error(`QR generation failed: ${response.status}`);
}

const qr = await response.json();
console.log(qr.imageUrl);

Update a Dynamic QR Destination

curl -X PATCH https://api.qr-build.com/v1/qr/qr_8x4m2p \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"destination":"https://example.com/new-campaign"}'

How Does Bulk QR Code Generation Work via API?

A bulk generation endpoint accepts an array of QR parameters in one request and returns a batch of QR codes, typically as a ZIP archive or JSON array of image data. This is more efficient than sending hundreds or thousands of sequential individual requests.

Bulk generation is designed for product catalogs, event tickets, packaging labels, inventory tags, print runs, and agency workflows where many QR codes share a common pattern but differ by destination or metadata.

A typical bulk request includes an array of rows, each with type, data, format, size, and optional label metadata. The response can return a job ID for asynchronous processing, a ZIP file URL, or a JSON array of generated QR assets depending on batch size and account settings.

For high-volume jobs, treat rate limits as part of the integration design. Queue batches, retry safely after rate-limit responses, and avoid regenerating static QR images when a cached asset is still valid.

Can You Access Scan Analytics via API?

Via the analytics GET endpoint, you can retrieve scan count, scan timestamps, device type breakdown, and geographic location data for each dynamic QR code. This data can be piped into dashboards, data warehouses, or BI tools for campaign performance analysis.

Scan analytics are collected when a dynamic QR code routes through the QR-Build redirect layer. Static QR codes do not pass through a redirect layer, so they cannot provide the same scan analytics model.

Analytics API access is useful when your product needs to show QR performance inside its own dashboard, combine scan data with CRM records, or export campaign events to a warehouse. For dashboard-based reporting, see the scan analytics dashboard guide.

A webhook is an HTTP callback that can notify your server when a scan event occurs. Webhooks are useful when scan data should trigger real-time downstream actions, such as lead scoring, inventory lookup, or campaign attribution.

Erreurs courantes d integration d une API de codes QR

The most common QR code API mistakes are exposing API keys, choosing static QR codes for destinations that will change, skipping error handling, requesting images too small for print, and cropping the quiet zone around the QR code.

Hardcoding API keys in client-side code

We've seen teams expose keys in browser JavaScript and mobile binaries. Always make API calls from a trusted server-side environment.

Using static QR when dynamic QR is needed

If the destination may change after print, use a dynamic QR code with a redirect layer. Static QR codes require regeneration and reprinting.

Nont handling API errors or rate limits

Handle non-2xx responses, retry only when safe, and display clear failure states in your product instead of silently dropping QR generation.

Generating QR images at too low a resolution

Small PNG output can look fine on screen but fail on packaging or signage. Use SVG for scalable output or request larger PNG dimensions for print.

Ignoring quiet zone requirements

The quiet zone is the blank margin around the QR code. Cropping it can make an otherwise valid QR code difficult or impossible to scan.

Bonnes pratiques pour l integration d une API de codes QR

A strong QR code API integration keeps keys server-side, validates destinations before generation, uses dynamic QR codes for changeable campaigns, chooses SVG for scalable web rendering, and monitors scan analytics after launch.

Use dynamic QR for changeable destinations

Campaigns, product pages, support documents, and printed labels often change after distribution. Dynamic QR codes prevent costly reprints.

Cache generated static QR images

If a static QR code's payload is permanent, store the generated asset and reuse it instead of creating the same code repeatedly.

Match format to channel

Use SVG for responsive web interfaces, PNG for simple print and email workflows, and JSON or base64 when downstream systems need embedded image data.

Validate destination URLs

Validate and normalize URLs before generation so broken, unsafe, or malformed destinations do not become printed assets.

Monitor analytics after deployment

Use scan analytics to confirm that codes are being scanned, placements are working, and campaigns are routing users to the intended destination.

Glossaire de l API de codes QR

In QR-Build terminology, a QR code API combines an authenticated endpoint, a request payload, an output format, and optional dynamic redirect management. These terms define the moving parts developers need before integration.

We define these terms consistently across QR-Build's product, API, and documentation so developers, marketers, and product managers can make the same implementation decisions.

API key

An API key is a unique credential string that authenticates each request to the QR-Build API and connects usage to your account.

Endpoint

An endpoint is a specific URL your client sends requests to, such as POST /v1/qr for generation or GET /v1/qr/{id}/analytics for reporting.

Dynamic QR

A dynamic QR code is a QR code whose encoded URL points to a server-managed redirect layer, allowing the final destination to change after the QR is printed.

Redirect layer

A redirect layer is the QR-Build-managed URL encoded in a dynamic QR code; it forwards scanners to the current destination and enables analytics.

Scan analytics

Scan analytics are data collected when a dynamic QR code is scanned, including count, timestamp, device type, and geographic location.

Base64

Base64 is a binary-to-text encoding that lets QR image data travel inside JSON or HTML without a separate image file request.

Webhook

A webhook is an HTTP callback that notifies your server when a scan event or QR workflow event occurs.

FAQ de l API de codes QR

A QR code API should answer the practical integration questions before a developer signs up: authentication, formats, dynamic updates, bulk generation, analytics, pricing, rate limits, and security.

Answers to developer, product, and integration questions about QR-Build API usage.

What is a QR code API?

A QR code API is a REST endpoint that accepts QR parameters such as type, URL, size, and format, then returns a QR code image or data object. It lets developers generate QR codes from application code instead of using a manual generator.

How do I generate a QR code with an API?

Authenticate with an API key, send a POST request with the QR parameters, and read the returned PNG, SVG, or JSON response. The simplest URL QR integration is a server-side HTTP request with a JSON body.

Is the QR-Build API free?

QR-Build offers free access for getting started with static QR generation. Dynamic QR codes, scan analytics, higher volume, and production features may require a paid plan; verify current details on the pricing page.

What output formats does the QR code API support?

The API supports PNG, SVG, base64, and JSON-style responses. Use PNG for simple print and email, SVG for scalable web or print rendering, and JSON or base64 when your application needs metadata and embedded image data.

What is the difference between static and dynamic QR codes via API?

A static QR code encodes the final destination directly into the image. A dynamic QR code encodes a redirect layer, so the destination can be edited later and scan analytics can be collected.

Can I update a dynamic QR code's destination via API?

Oui. Send a PATCH request to the QR code management endpoint with the new destination URL. The printed QR image does not need to be regenerated because the redirect layer routes future scans to the updated destination.

How do I generate bulk QR codes via API?

Use a batch request with an array of QR parameters. The API can return generated assets as a ZIP archive, a job result, or a JSON array depending on volume and account configuration.

What QR code types can I generate via the API?

As of 2026, QR-Build supports URL, WiFi, vCard, PDF, email, phone, menu, coupon, crypto, PayPal, calendar, and bulk QR workflows through API-oriented generation.

What authentication does the QR code API use?

The API uses API key authentication. Send the key as a Bearer token in the Authorization header and keep it server-side.

How do I keep my API key secure?

Store API keys in environment variables or a secret manager, make QR-Build calls from your server, never expose keys in client-side JavaScript, and rotate keys if they are committed or shared accidentally.

Can I access scan analytics via the API?

Oui. For dynamic QR codes, the analytics endpoint can return scan count, scan timestamps, device type, and location data. For dashboard-based analysis, see our QR code analytics guide.

What programming languages work with the QR code API?

Any language that can make HTTPS requests can use the API, including JavaScript, TypeScript, Python, Ruby, PHP, Go, Swift, Kotlin, Java, and C#.

What image size should I request for print use?

For print, request a large PNG or use SVG when possible. SVG is resolution-independent, while PNG should be sized high enough for the final printed dimensions and scan distance.

When should I use a QR code API instead of a manual generator?

Use the API for scale, automation, product integration, real-time generation, or campaign workflows. Use a manual generator for occasional one-off QR codes that do not need automation.

Can I use the QR code API in a mobile app?

Oui, but route calls through your server and deliver the generated image URL or data to the app. Do not embed your API key in an iOS or Android binary because it can be extracted.

Ressources QR-Build associees

Integrez la generation de QR dans votre produit

Start with a free API key, test static generation, then add dynamic QR management, bulk workflows, and scan analytics when your application needs them.

Rate limits and plan details change over time; verify current production limits before deployment.

QR Code - QR-Build

Besoin de generer des codes QR depuis le code ?

Obtenir l acces API