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.
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.
-
Only this button contacts the API server. It receives the content of your QR code, so do not test with private data.
Add a link, text, Wi-Fi details, email, phone, SMS or location.
Choose the API service, size, format, colors and error correction.
Copy the URL or a snippet for HTML, JavaScript, Python, PHP or cURL.
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.
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.
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.
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.
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.
The two services use similar options with different names. The tool applies the right names for the service you select.
| Setting | QR Server (goQR.me) | QuickChart |
|---|---|---|
| Content | data | text |
| Size | size=300x300 (pixels) | size=300 (pixels) |
| Image format | format: png, svg, jpeg, gif, eps | format: png, svg |
| Error correction | ecc: L, M, Q, H | ecLevel: L, M, Q, H |
| Foreground color | color (hex without #) | dark (hex without #) |
| Background color | bgcolor (hex without #) | light (hex without #) |
| Quiet zone | qzone (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.
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&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
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.
| Type | Format | What happens on scan |
|---|---|---|
| Website link | https://example.com | Opens the page in the browser |
| Wi-Fi | WIFI:T:WPA;S:MyNetwork;P:secret123;; | Offers to join the network |
mailto:hello@example.com?subject=Hi | Starts a new email | |
| Phone | tel:+923001234567 | Offers to call the number |
| SMS | SMSTO:+923001234567:Hello | Starts a text message |
| Location | geo:24.8607,67.0011 | Opens the location in a map app |
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.
| Level | Data restored | Best for |
|---|---|---|
| L | About 7% | Clean screens and the smallest possible code |
| M | About 15% | General use, a good default |
| Q | About 25% | Print that may get dirty or worn |
| H | About 30% | Outdoor use or a logo placed over the center |
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.
| Level | Digits only | Letters and digits | Bytes (general text) |
|---|---|---|---|
| L | 7,089 | 4,296 | 2,953 |
| M | 5,596 | 3,391 | 2,331 |
| Q | 3,993 | 2,420 | 1,663 |
| H | 3,057 | 1,852 | 1,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.
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.
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.
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.
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.
| 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. |
| 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. |
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.
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.
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.
Find answers to common questions about QR code APIs, error correction, data capacity and privacy.
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.
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.
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.
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.
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.
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.
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.
Create a QR code API URL, generate a QR code image, encode a URL or build an HTTP request in seconds. Explore free developer tools to format, convert and debug your data in one place.
Explore All Developer Tools →