Developers
Replace the QuickChart QR API
Map the text, size, ecLevel, dark and light parameters of quickchart.io/qr to the free QRdx image API, and rewrite every old URL in your files with one command.
By the end of this page, every QR code your pages, emails or templates load from QuickChart's quickchart.io/qr loads from the QRdx image API instead, at the same size and error correction level, with no account or key.
Both APIs work the same way: a GET URL that returns the image. size and margin keep their names and units, so the change is a new host, four renamed parameters and three defaults. The QuickChart parameters on this page come from its QR code documentation, checked on November 17, 2026.
Before you start
- Find the files that use the old API. The second pattern finds QuickChart's Google-style QR URLs, covered below:
grep -rlE "quickchart\.io/(qr\?|chart\?[^\"' ]*cht=qr)" .- Work in a git checkout or another place where you can review the change before it goes live.
Compare one URL
The two URLs below ask for the same code: a 300 × 300 PNG of https://example.com at error correction Q with a 2-module margin.
https://quickchart.io/qr?text=https%3A%2F%2Fexample.com&size=300&ecLevel=Q&margin=2
https://api.qrdx.dev/v1/qr?format=png&data=https%3A%2F%2Fexample.com&size=300&level=Q&margin=2curl -o after.png "https://api.qrdx.dev/v1/qr?format=png&data=https%3A%2F%2Fexample.com&size=300&level=Q&margin=2"
file after.png
# after.png: PNG image data, 300 x 300, 8-bit/color RGBA, non-interlacedMap the parameters
Three defaults differ, and the rewrite below sets each one so the codes look as they did:
- Format: QuickChart returns PNG. QRdx returns SVG unless you ask for
png,webporeps. Keep PNG for email, since many email clients don't show SVG. - Size: QuickChart draws
150, QRdx512. - Error correction: QuickChart uses
M, orHwith a center image. QRdx usesQ, which survives more damage but makes a denser code. Drop the addedlevel=Mif you'd rather have QRdx's default.
Rewrite the URLs in your files
This rewrites every quickchart.io/qr URL in the files you name. It changes the host and path, renames text, ecLevel, dark and light, swaps JPEG for PNG, and adds format=png, size=150 and level=M where a URL relied on QuickChart's defaults. Perl comes with macOS and most Linux distributions.
perl -pi -e 's{https?://quickchart\.io/qr\?([^\s"\x27<>)]*)}{my $q = $1; $q =~ s/(^|[&;])text=/${1}data=/; $q =~ s/(^|[&;])ecLevel=/${1}level=/; $q =~ s/(^|[&;])dark=/${1}fg=/; $q =~ s/(^|[&;])light=/${1}bg=/; $q =~ s/(^|[&;])format=\.?(?:jpe?g|png)(?=[&;]|$)/${1}format=png/i; $q =~ s/(^|[&;])format=\.svg/${1}format=svg/i; my $p = ""; $p .= "format=png&" unless $q =~ /(^|[&;])format=/; $p .= "size=150&" unless $q =~ /(^|[&;])size=/; $p .= "level=M&" unless $q =~ /(^|[&;])level=/; "https://api.qrdx.dev/v1/qr?$p$q"}ge' index.htmlRun on a file with three old tags:
<img src="https://quickchart.io/qr?text=https%3A%2F%2Fexample.com" alt="QR">
<img src="https://quickchart.io/qr?text=Hello%20world&dark=f00&light=0ff&ecLevel=Q&format=svg" alt="QR 2">
<img src="https://quickchart.io/qr?text=https%3A%2F%2Fexample.com%2Fmenu&size=300&margin=2&format=jpg" alt="QR 3">it produces:
<img src="https://api.qrdx.dev/v1/qr?format=png&size=150&level=M&data=https%3A%2F%2Fexample.com" alt="QR">
<img src="https://api.qrdx.dev/v1/qr?size=150&data=Hello%20world&fg=f00&bg=0ff&level=Q&format=svg" alt="QR 2">
<img src="https://api.qrdx.dev/v1/qr?level=M&data=https%3A%2F%2Fexample.com%2Fmenu&size=300&margin=2&format=png" alt="QR 3">The command leaves the style parameters (finderColor, dotStyle, finderStyle, finderDotStyle), centerImageUrl and caption as they are. QRdx ignores them, so those codes come out with plain square shapes and no logo or caption: change them by hand with the table above.
The command also stops at a quote mark, so a URL with a bare ' in its text, such as text=Here's%20my%20text, is only rewritten up to the quote. Encode it as %27 first. Where code adds parameters after a variable, the part after the variable keeps its old names. This lists what may be left, along with any other URL that uses those names; fix the QR ones by hand, then run it again:
grep -rnE "quickchart\.io/qr\?|[?&;](text=|ecLevel=|dark=|light=)" .Change the code that builds URLs
// Before
const src = `https://quickchart.io/qr?size=200&text=${encodeURIComponent(link)}`;
// After
const src = `https://api.qrdx.dev/v1/qr?format=png&size=200&level=M&data=${encodeURIComponent(link)}`;If you sent a POST with a JSON body, build the same URL from its fields instead:
import { writeFile } from "node:fs/promises";
const url = new URL("https://api.qrdx.dev/v1/qr");
url.searchParams.set("data", "https://example.com/?a=1&b=2");
url.searchParams.set("size", "300");
url.searchParams.set("format", "png");
const response = await fetch(url);
await writeFile("qr.png", Buffer.from(await response.arrayBuffer()));qr.png: PNG image data, 300 x 300, 8-bit/color RGBA, non-interlacedGoogle-style URLs
QuickChart also answers Google Chart URLs at quickchart.io/chart?cht=qr…. Those use Google's parameters (chl, chs, chld), which Replace the Google Chart QR code API maps one by one. This rewrites them, and only the QR ones: a quickchart.io/chart URL without cht=qr is a chart, and stays as it is.
perl -pi -e 's{https?://quickchart\.io/chart\?((?=[^\s"\x27<>)]*cht=qr)[^\s"\x27<>)]*)}{my $q = $1; $q =~ s/(^|[&;])chl=/${1}data=/; $q =~ s/(^|[&;])chs=(\d+)x\d+/${1}size=$2/; $q =~ s/(^|[&;])chld=([LMQH])(?:\||%7C)(\d+)/${1}level=$2&margin=$3/i; $q =~ s/(^|[&;])chld=([LMQH])/${1}level=$2/i; "https://api.qrdx.dev/v1/qr?format=png&$q"}ge' index.html<img src="https://quickchart.io/chart?cht=qr&chs=150x150&chl=Testing123" alt="QR">
<img src="https://quickchart.io/chart?c={type:'bar',data:{labels:['A','B'],datasets:[{data:[1,2]}]}}" alt="A bar chart"><img src="https://api.qrdx.dev/v1/qr?format=png&cht=qr&size=150&data=Testing123" alt="QR">
<img src="https://quickchart.io/chart?c={type:'bar',data:{labels:['A','B'],datasets:[{data:[1,2]}]}}" alt="A bar chart">QRdx ignores the leftover cht=qr.
If something goes wrong
400 with "param": "data"
The URL still says text instead of data, often in code the rewrite didn't reach.
{"code":"VALIDATION_ERROR","message":"Invalid query parameters","data":{"details":[{"param":"data","message":"Invalid input: expected string, received undefined"}]},"status":400}400 with "param": "size"
A size over 2048 pixels, or under 64, is refused. Change those sizes by hand.
{"code":"VALIDATION_ERROR","message":"Invalid query parameters","data":{"details":[{"param":"size","message":"Too big: expected number to be <=2048"}]},"status":400}400 with "param": "format"
jpg, jpeg or base64 came from code the rewrite didn't reach. Use png. For a data URI, fetch the PNG and encode it yourself.
The logo or caption is missing
QRdx ignores centerImageUrl and caption. Use logoIcon or logoFileId for the logo and a frame for the label, as in the table above.
429 after a bulk reload
The image API allows 300 requests a minute per IP address. Wait the seconds in the Retry-After header, or generate the files once instead of loading them live.
What else to know
- Caching: the same URL always returns the same bytes, so responses are cached for a year (
Cache-Control: public, max-age=31536000, immutable). Renders with a logo you uploaded (logoFileId) aren't cached. - More options: more shapes, gradients and frames. Try them in the URL builder, or read the parameters.
- Self-hosting: a self-hosted QRdx serves the same API at
/api/v1/qron your own domain.
Related
- QR code image API: every parameter, styles, logos and limits
- Replace the Google Chart QR code API: the parameters of Google-style URLs
- CLI: make the files once, including a whole CSV
- Render a QR code image: the reference page with a Try it panel
Was this page helpful?
Last updated on
Replace the goQR.me QR code API
Map the size, ecc, color and qzone parameters of api.qrserver.com to the free QRdx image API, and rewrite every old URL in your files with one command.
Barcode API
Make EAN, UPC, Code 128, GS1-128, Data Matrix and other barcode images from a GET URL with no API key, send values as JSON to keep them out of URLs, and keep barcodes in a workspace with the REST API.