<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Thong Dang</title>
    <description>The latest articles on DEV Community by Thong Dang (@thongdn).</description>
    <link>https://dev.to/thongdn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4040373%2F26e6654b-447d-41fc-bf1f-a3b864157880.png</url>
      <title>DEV Community: Thong Dang</title>
      <link>https://dev.to/thongdn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thongdn"/>
    <language>en</language>
    <item>
      <title>I built a free QR code API with no API key — here's the stack (Cloudflare, zero-dep PNG)</title>
      <dc:creator>Thong Dang</dc:creator>
      <pubDate>Tue, 21 Jul 2026 15:45:02 +0000</pubDate>
      <link>https://dev.to/thongdn/i-built-a-free-qr-code-api-with-no-api-key-heres-the-stack-cloudflare-zero-dep-png-178j</link>
      <guid>https://dev.to/thongdn/i-built-a-free-qr-code-api-with-no-api-key-heres-the-stack-cloudflare-zero-dep-png-178j</guid>
      <description>&lt;p&gt;Every "free" QR API I tried wanted a signup, an API key, or quietly turned my QR into a tracked short link that could expire. So I built one that doesn't. Here's how it works — and how it stays free.&lt;/p&gt;




&lt;h2&gt;
  
  
  The itch
&lt;/h2&gt;

&lt;p&gt;I needed to drop a QR code into a web page. Simple, right? But every option had a catch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up, get an API key, paste it into a &lt;code&gt;.env&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Free tier, but the QR is actually a &lt;strong&gt;short link&lt;/strong&gt; that redirects through their domain — so they can track every scan, and the code &lt;strong&gt;stops working&lt;/strong&gt; if you stop paying.&lt;/li&gt;
&lt;li&gt;Or a heavy client-side library when all I wanted was &lt;code&gt;&amp;lt;img src="..."&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a static piece of data — a URL, some text, a Wi-Fi credential — none of that should be necessary. A QR code is just a bitmap of your data. It shouldn't need an account, and it shouldn't phone home.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://qrkit.tools" rel="noopener noreferrer"&gt;QRKit&lt;/a&gt;&lt;/strong&gt;: a free QR + barcode tool with a public API that needs &lt;strong&gt;no key&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The one-line version
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://qrkit.tools/api/qr?data=https://example.com&amp;amp;size=300"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"QR code"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. It returns an image directly, CORS is open, and it works from any page or backend. No key, no SDK.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# SVG, custom colors, higher error correction&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://qrkit.tools/api/qr?data=Hello%20World&amp;amp;size=400&amp;amp;format=svg&amp;amp;ecc=H&amp;amp;dark=175CD3"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; qr.svg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Params: &lt;code&gt;data&lt;/code&gt; (required), &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;format&lt;/code&gt; (&lt;code&gt;png&lt;/code&gt;|&lt;code&gt;svg&lt;/code&gt;), &lt;code&gt;ecc&lt;/code&gt; (&lt;code&gt;L&lt;/code&gt;/&lt;code&gt;M&lt;/code&gt;/&lt;code&gt;Q&lt;/code&gt;/&lt;code&gt;H&lt;/code&gt;), &lt;code&gt;dark&lt;/code&gt;, &lt;code&gt;light&lt;/code&gt;, &lt;code&gt;margin&lt;/code&gt;, &lt;code&gt;download&lt;/code&gt;. Full docs: &lt;a href="https://qrkit.tools/api" rel="noopener noreferrer"&gt;qrkit.tools/api&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why "static" matters
&lt;/h3&gt;

&lt;p&gt;The content is encoded &lt;strong&gt;directly&lt;/strong&gt; into the QR matrix — there's no redirect link in the middle. Practically, that means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It never expires.&lt;/strong&gt; The data lives in the image, not on my server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No scan tracking.&lt;/strong&gt; There's nothing to track — the phone reads the data and acts on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It can't be locked.&lt;/strong&gt; Even if my site went down tomorrow, every code already printed keeps working.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the honest default a QR code &lt;em&gt;should&lt;/em&gt; have, and it's the whole reason the project exists.&lt;/p&gt;

&lt;h3&gt;
  
  
  The stack
&lt;/h3&gt;

&lt;p&gt;The entire thing runs on &lt;strong&gt;Cloudflare Pages + Pages Functions&lt;/strong&gt; (free tier). A few decisions made that possible:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Matrix-only QR rendering.&lt;/strong&gt; Most QR libraries pull in Node canvas/renderers that don't bundle for Workers. I use &lt;code&gt;qrcode&lt;/code&gt;'s core to compute &lt;em&gt;just the module matrix&lt;/em&gt;, then render SVG/PNG myself. No native deps, so it bundles clean for the edge runtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A zero-dependency PNG encoder.&lt;/strong&gt; For PNG output I hand-roll the encoder (matrix → pixels → PNG chunks) instead of pulling a library. It keeps the bundle tiny and stays well under the Workers CPU limit. (For very large sizes I recommend SVG — it's resolution-independent and cheaper to generate.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Coalesced KV writes for the "codes created" counter.&lt;/strong&gt; I show a live counter of codes generated. Naively that's one KV write per request — which would blow through the free tier's 1,000 writes/day instantly. Instead each isolate buffers increments in memory and flushes to KV at most once per minute, while reads add the un-flushed buffer so the number still moves in real time. It's best-effort/vanity, but it's honest-enough and free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Per-IP rate limiting via a WAF rule.&lt;/strong&gt; Pages Functions don't support the native Workers &lt;code&gt;ratelimit&lt;/code&gt; binding, so abuse protection is a single free Cloudflare WAF Rate Limiting rule at the edge — no code, no cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  On keeping it free
&lt;/h3&gt;

&lt;p&gt;There are no ads on the API and no tracking anywhere. It's maintained by one person. If it's useful to you, there's a "buy me a coffee" link — that's the whole business model. I'd rather keep it genuinely free than bolt on the exact dark patterns that made me build this in the first place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Web generator (QR, Wi-Fi, barcode, logo): &lt;strong&gt;&lt;a href="https://qrkit.tools" rel="noopener noreferrer"&gt;qrkit.tools&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;API docs: &lt;strong&gt;&lt;a href="https://qrkit.tools/api" rel="noopener noreferrer"&gt;qrkit.tools/api&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Also a Telegram bot: &lt;strong&gt;@QRKitToolsBot&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love feedback on the API design — parameters, formats, anything missing for your use case. What would make you actually reach for this over a client-side lib?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>cloudflare</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
