Generate a QR-code image that encodes any URL, such as a video download link, using QRServer's image API.
Use Cases
Use when the caller provides a target URL and needs a QR code that can be opened or downloaded on another device. Keep the target URL as a placeholder or runtime input; never persist credentials, payment data, or expiring secrets in the skill.
Automation Flow
- Build the direct API URL without visiting the homepage:
https://api.qrserver.com/v1/create-qr-code/?size={size}&data={encodeURIComponent(target-url)}
Use a sufficiently large size such as 500x500 for phone scanning; preserve the target URL exactly before URL-encoding it.
2. Navigate to the constructed URL in one browser call.
3. On the loaded page, run this self-contained extractor:
(() => {
const qrUrl = window.location.href;
const image = document.querySelector('img');
return {
qrUrl,
imageUrl: image?.currentSrc || image?.src || qrUrl,
targetUrl: new URL(qrUrl).searchParams.get('data'),
size: new URL(qrUrl).searchParams.get('size')
};
})()- Give the caller the returned
imageUrl/qrUrlas the QR-code image to open or download on the phone.
Possible Friction Points
- The endpoint returns the QR image directly; there may be no HTML document or
<img>element, sowindow.location.hrefis the reliable image URL. - Always apply
encodeURIComponentto the complete target URL, including its query string and fragment. - QRServer's
sizeparameter uses pixel dimensions such as500x500; larger images improve scanning at the cost of download size. - Treat target URLs containing access tokens, signed parameters, or other secrets as sensitive and do not log or persist them.