Skip to content
⚠ TESTING ENVIRONMENT You are viewing a testing copy of Tolioo. Changes here do not affect the live website.

QR Code API Generator

Build a QR code API URL with your own size, colors and error correction, then copy ready-to-use code for HTML, JavaScript, Python, PHP and cURL. Fast, free and no signup.

  • 100% free
  • No API key
  • URL built in your browser

QR code content

QR code will contain -
Test the URL
Click "Show QR code" to load the image from the API server and check your settings.

Only this button contacts the API server. It receives the content of your QR code, so do not test with private data.

ADVERTISEMENT
Demo Ad 728 x 90

How to create a QR code API URL

  1. 1

    Enter the content

    Add a link, text, Wi-Fi details, email, phone, SMS or location.

  2. 2

    Set the style

    Choose the API service, size, format, colors and error correction.

  3. 3

    Copy the code

    Copy the URL or a snippet for HTML, JavaScript, Python, PHP or cURL.

QR CODE API GUIDE

QR Code API Generator – Create QR Code API URLs for Your Website and App

This free QR code API generator builds the exact URL you need to create QR codes from your website, app or script. Enter your link or text, choose the size, colors, format and error correction, and the tool writes the QR code API URL for you, together with copy-ready code for HTML, Markdown, React, JavaScript, Python, PHP and cURL. It supports two popular public QR code APIs, QR Server (goQR.me) and QuickChart, needs no API key for basic use and builds everything in your browser. You can also create the right content format for Wi-Fi, email, phone, SMS and location QR codes.

Searching for a QR code API, a QR code generator API URL or a free QR code API for your website and app? This page gives you the URL and the code in one step. Developers use it to add QR codes to tickets, invoices, Wi-Fi sharing pages, restaurant menus, checkout pages and mobile apps without installing a library. The tool runs in your browser on Windows, Mac, Linux, Android and iPhone, and builds the URL and snippets locally.

QR Code API URL Builder

Create a correctly encoded QR code API link with data, size, format, error correction level, foreground and background colors and quiet zone, ready to use as an image source.

Code Snippets for Developers

Copy the same request as an HTML img tag, Markdown image, React JSX, JavaScript with URLSearchParams, a Python requests script, PHP code or a cURL command.

Wi-Fi, Email, Phone and SMS QR Codes

Pick a content type and the tool formats the data that phones understand, so a scan can join a network, start an email, place a call or open a map.

What Is a QR Code API?

A QR code API is a web service that generates a QR code image on request. Instead of installing a library and writing code to draw the black and white squares, you send an HTTP GET request to a URL that contains your data and your options. The service replies with an image in PNG or SVG format. Because the request is only a URL, you can use it directly as the source of an img tag, in an email template, in a spreadsheet image formula or in the backend of an application.

This makes a QR code API the quickest way to add QR codes to a project: tickets, invoices, product pages, menus, business cards, event badges, Wi-Fi sign-in cards and links to download an app.

How to Use the QR Code API URL in 4 Steps

  1. Enter the content: Choose Text or URL, Wi-Fi, Email, Phone, SMS or Location, and fill in the fields.
  2. Choose the API service and style: Pick QR Server or QuickChart, then set the size, image format, error correction level, colors and quiet zone.
  3. Select the output you need: Choose API URL, HTML, Markdown, React, JavaScript, Python, PHP or cURL.
  4. Copy and test: Copy the code into your project, and use Show QR code to check the image. Scan it with a phone before you publish or print it.

QR Code API Parameters

The two services use similar options with different names. The tool applies the right names for the service you select.

QR code API parameters for QR Server and QuickChart
SettingQR Server (goQR.me)QuickChart
Contentdatatext
Sizesize=300x300 (pixels)size=300 (pixels)
Image formatformat: png, svg, jpeg, gif, epsformat: png, svg
Error correctionecc: L, M, Q, HecLevel: L, M, Q, H
Foreground colorcolor (hex without #)dark (hex without #)
Background colorbgcolor (hex without #)light (hex without #)
Quiet zoneqzone (modules)margin (modules)

Always URL-encode the content. A link such as https://example.com/page?id=1&ref=2 contains characters that would otherwise be read as separate parameters. This tool encodes the value for you, and the JavaScript, Python and PHP snippets use the built-in parameter encoders of each language.

QR Code API Examples

API URL (QR Server)

https://api.qrserver.com/v1/create-qr-code/?data=https%3A%2F%2Fexample.com&size=300x300&format=png&ecc=M&color=000000&bgcolor=ffffff&qzone=4

HTML

<img src="https://api.qrserver.com/v1/create-qr-code/?data=https%3A%2F%2Fexample.com&amp;size=300x300" alt="QR code" width="300" height="300">

JavaScript

const params = new URLSearchParams({
  data: "https://example.com",
  size: "300x300",
  ecc: "M"
});

document.getElementById("qr").src =
  "https://api.qrserver.com/v1/create-qr-code/?" + params;

Python

import requests

response = requests.get(
    "https://api.qrserver.com/v1/create-qr-code/",
    params={"data": "https://example.com", "size": "300x300"},
    timeout=30,
)

with open("qr-code.png", "wb") as f:
    f.write(response.content)

PHP

$url = 'https://api.qrserver.com/v1/create-qr-code/?' . http_build_query([
    'data' => 'https://example.com',
    'size' => '300x300',
]);

file_put_contents('qr-code.png', file_get_contents($url));

cURL

curl -G "https://api.qrserver.com/v1/create-qr-code/" \
  --data-urlencode "data=https://example.com" \
  --data "size=300x300" -o qr-code.png

QR Code Content Formats

A QR code stores plain text. Phones decide what to do with it by looking at the start of the text, so each action has its own format.

Text formats that phones recognise
TypeFormatWhat happens on scan
Website linkhttps://example.comOpens the page in the browser
Wi-FiWIFI:T:WPA;S:MyNetwork;P:secret123;;Offers to join the network
Emailmailto:hello@example.com?subject=HiStarts a new email
Phonetel:+923001234567Offers to call the number
SMSSMSTO:+923001234567:HelloStarts a text message
Locationgeo:24.8607,67.0011Opens the location in a map app

Error Correction Levels Explained

Error correction lets a QR code be read even when part of it is dirty, scratched or covered. A higher level restores more damage, but it adds more modules, so the code becomes denser.

QR code error correction levels
LevelData restoredBest for
LAbout 7%Clean screens and the smallest possible code
MAbout 15%General use, a good default
QAbout 25%Print that may get dirty or worn
HAbout 30%Outdoor use or a logo placed over the center

How Much Data Fits in a QR Code?

The capacity depends on the type of content and the error correction level. These are the maximum values for the largest QR code, version 40.

Maximum QR code capacity by error correction level
LevelDigits onlyLetters and digitsBytes (general text)
L7,0894,2962,953
M5,5963,3912,331
Q3,9932,4201,663
H3,0571,8521,273

A QR code that carries a lot of data is dense and hard to scan from a distance. When you can, shorten the content, for example by using a short link, and the code will be simpler and more reliable.

QR Code API vs Library vs Self-Hosting

A public QR code API is the fastest way to start, but it is not the only way. You can also generate codes in your own code with a library, for example the qrcode package for Node.js, qrcode or segno for Python, endroid/qr-code for PHP, ZXing for Java, go-qrcode for Go or QRCoder for .NET. The right choice depends on your project.

  • Use a public API when: you need a quick prototype, a simple website, an email template or a low-traffic tool.
  • Use a library when: you need full control over the design, offline generation, high traffic or data that must stay private.
  • Think about the risks of an API: it is a third-party dependency, can change or go offline, may rate-limit or reject requests and receives the content of every QR code.

This tool is independent and is not affiliated with QR Server or QuickChart. Read the terms of service of the provider you use before you rely on it in production.

QR Code Design Tips for Reliable Scanning

  • Keep strong contrast: Use dark modules on a light background. Light-on-dark or low-contrast colors may not scan. You can test your colors with the Contrast Checker.
  • Leave a quiet zone: The empty border around the code should be at least 4 modules wide. Do not reduce it unless you have tested the code.
  • Choose a sensible size: For print, make the code at least 2 cm (about 0.8 inch) wide and use SVG so it stays sharp at any size.
  • Prefer short content: A short link makes a simpler code than a long URL with tracking parameters.
  • Test before you publish: Scan the code with at least two different phones, in the lighting where it will be used.
  • Pick colors carefully: Convert brand colors to the hex format the API expects with the Color Converter.

Privacy and Security When Using a QR Code API

With a QR code API, the content of the QR code travels inside the URL. When your page or app requests the image, the API provider receives that content and may keep it in server logs. So never use a third-party API to create codes that contain passwords, private keys, one-time codes or personal data. For a Wi-Fi guest network that is meant to be shared, the risk is lower, but a private network password should not be sent to a public service. Use HTTPS URLs, do not put secrets in the content, and create sensitive codes locally or on your own server. For a simple QR code that you only need to download, you can use our QR Code Generator.

QR Code API Use Cases

  • Event tickets and passes: Show a unique QR code that staff scan at the door.
  • Restaurant menus and table ordering: Link a table or a menu page to a printable QR code.
  • Wi-Fi sharing pages: Let guests join a network by scanning instead of typing a password.
  • Invoices and receipts: Add a code that opens a payment or tracking page.
  • Product packaging and labels: Point customers to manuals, warranty pages or reviews.
  • Mobile app downloads: Send desktop visitors to the right app store link.
  • Contact details: Share a phone number, email or location with one scan.

QR Code Size and Print Guide

A QR code that looks good on screen can fail on paper. Use this guide when you choose the size parameter and the print size.

Recommended QR code sizes
Where it is used Suggested image size Notes
Website or app screen 200 to 300 px Large enough for phone cameras, small enough for most layouts.
Email and PDF 300 to 400 px Use a high-contrast image and keep the quiet zone.
Printed flyer or menu 500 px or more, printed about 2 to 3 cm wide or larger Test with several phones before printing.
Poster or banner 800 px or more, printed much larger Longer distance needs a bigger code and simpler data.

Troubleshooting: QR Code API Problems and Fixes

Common QR code API problems
Problem Likely cause How to fix it
The QR code will not scan Low contrast, too small or no quiet zone. Use a dark foreground on a light background, a larger size and a quiet zone of 4 modules.
The image does not load The data in the URL is not encoded or the URL is too long. Encode special characters and shorten the content.
The code is very dense Too much text for the code size. Shorten the content or use a short link. Lower error correction if needed.
Colors scan badly Foreground and background are too similar, or inverted. Keep a clearly darker foreground and a lighter background.
The code blocks the page layout The image has a fixed size larger than its container. Use width and height attributes or max-width in CSS.
Requests fail in production A network rule, content security policy or service limit. Allow the image host in your policy, and consider hosting or caching the image.

Create QR Code API URLs on Mobile, Windows and Mac

The QR code API generator runs in your web browser, so you can build QR code API URLs and code snippets online on Android, iPhone, Windows, Mac and Linux. Whether you search for a free QR code API for HTML, a QR code generator API for Python or PHP, or a quick way to test a code on your phone, the steps are the same: open the page, choose the content type and options, then copy the URL or snippet.

Related Tools for Developers

When you build requests by hand, the URL Encoder and Decoder helps you encode query parameters, the Base64 Encode and Decode tool helps when you need to embed data in a request, and the Image to Base64 tool turns a downloaded QR code image into a data URI that you can paste into HTML or CSS.

Free QR Code API URL Generator, No Signup

Our QR code API generator is free, fast and works on desktop, tablet and mobile. There is no account, nothing to install and no limit on the number of URLs you build. The tool creates the URL and the code in your browser, and only contacts the API service if you choose to test the image. Always scan your final QR code and test it in the place where it will be used.

ADVERTISEMENT
Demo Ad 300 x 250
COMMON QUESTIONS

Frequently Asked Questions About QR Code API

Find answers to common questions about QR code APIs, error correction, data capacity and privacy.

What is a QR code API?

A QR code API is a web service that creates a QR code image when you send it a request. You put your text or link and your options, such as size and colors, into a URL, and the service returns a PNG or SVG image. Because it is just a URL, you can use it directly as the source of an image tag in a web page, an email or an app, without installing any QR code library.

How do I use the QR code API URL in my website or app?

Generate the URL with this tool, then paste it into the src attribute of an img tag, for example img src equals the API URL. In an app, request the same URL with an HTTP client and save the image bytes to a file. This page also gives you ready-made code for HTML, Markdown, React, JavaScript, Python, PHP and cURL, so you can copy the one that fits your project.

Is the QR code API free and does it need an API key?

The public services offered here, QR Server (goQR.me) and QuickChart, can be called for basic QR codes without an API key. They are third-party services, though, and are not run by this website. Free public APIs can change, rate-limit or reject requests, so read the terms of the provider you choose, and consider generating QR codes on your own server if your project has high traffic or needs guaranteed uptime.

Which error correction level should I choose?

Level M, which restores about 15 percent of damaged data, is a good default for screens and most printed codes. Choose L for the smallest code when the QR code will be displayed on a clean screen, Q or H when the code may get scratched, dirty or partly covered, or when you place a logo over the center. Higher levels add more redundancy, so the code becomes denser and needs more room.

How much data can a QR code hold?

The largest QR code, version 40, can hold up to 7,089 digits, 4,296 letters and digits, or 2,953 bytes of general text at error correction level L. With level H the limit drops to 3,057 digits or 1,273 bytes. In practice, shorter content creates a simpler code that is easier to scan, so use a short link instead of a long URL whenever you can.

Is my data private when I use a QR code API?

This page builds the URL in your browser and does not send your text anywhere. But a QR code API works by receiving your data in the URL, so as soon as the image is requested, the API provider can see it and may log it. Do not use a third-party QR code API for passwords, private keys or confidential information. For sensitive data, generate the code locally or on your own server.

Can I make QR codes for Wi-Fi, email, phone numbers and SMS?

Yes. Choose the content type in the tool and fill in the fields. It creates the correct text format for each type: a WIFI code with the network name, password and security type, a mailto link with an optional subject and message, a tel link for a phone number, an SMSTO code for a text message, and a geo link for a map location. Phones recognise these formats and offer the matching action when the code is scanned.

ADVERTISEMENT
Demo Ad 320 x 50