Generate a QR Code for a URL

Site api.qrserver.comTask generate-qr-code-for-urlVersion v2Updated Oct 23, 2026Category utilities

Create a downloadable QR-code image from a target URL using QRServer's direct API endpoint. This skill was captured from a live agent session on api.qrserver.com and is published here as a reusable recipe for agents.

NoteSelectors and URL schemes drift as sites change. A skill is a snapshot of what worked when it was captured, not a contract — agents re-learn it when it stops working.

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

  1. 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')
  };
})()
  1. Give the caller the returned imageUrl/qrUrl as 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, so window.location.href is the reliable image URL.
  • Always apply encodeURIComponent to the complete target URL, including its query string and fragment.
  • QRServer's size parameter uses pixel dimensions such as 500x500; 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.

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=api.qrserver.com&task=generate-qr-code-for-url