---
title: "Download a QR code asset via Netlify Function"
method: GET
path: "/.netlify/functions/generate-qr"
---

# Download a QR code asset via Netlify Function

`GET /.netlify/functions/generate-qr`

## Request

- Base URL: `https://qrcodecrafter.com`
- URL: `https://qrcodecrafter.com/.netlify/functions/generate-qr`
- Auth: one of:
  - API key in header `X-Agent-Api-Key`
  - none
- TypeScript: <https://skmtc.dev/qrcodecrafter/apis/qrcodecrafter-api-2/docs/.netlify/functions/generate-qr/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `value` string, required
- `format` 'svg' | 'png' | 'jpg' | 'webp' | 'pdf' | 'eps'
- `size` integer
- `margin` integer
- `bgColor` string
- `fgColor` string
- `errorCorrectionLevel` 'L' | 'M' | 'Q' | 'H'
- `logo` string, nullable

## Response `200`

Generated QR code asset served as binary content

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key when key enforcement is enabled
- `405`: Method not allowed
- `429`: Too many requests. QR generation uses a cost-weighted per-client budget; honor the retry and rate-limit headers before resubmitting work.
- `500`: Server error

---

[API](https://skmtc.dev/qrcodecrafter/apis/qrcodecrafter-api-2.md) - [All operations](https://skmtc.dev/qrcodecrafter/apis/qrcodecrafter-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/qrcodecrafter/apis/qrcodecrafter-api-2/revisions/e66d9e8a52bf?raw)
