---
name: qr-code-generator
description: Generate a QR code (PNG or SVG, transparent background by default) from text or a URL, via devops.majbase.com's free public API. Use whenever the user asks to create, make, or generate a QR code.
---

# QR Code Generator

Calls the QR Code Generator API at devops.majbase.com to turn text or a URL
into a QR code image. No API key or authentication required.

## Endpoint

```
POST https://devops.majbase.com/qr/api
```

## Request

Send JSON (or form-encoded) with:

| Field      | Type   | Required | Default   | Notes                                                        |
|------------|--------|----------|-----------|---------------------------------------------------------------|
| `data`     | string | yes      | —         | Text or URL to encode                                        |
| `format`   | string | no       | `png`     | `png` or `svg`                                                |
| `dark`     | string | no       | `#000000` | Module color — hex, e.g. `#RRGGBB` or `#RRGGBBAA`             |
| `scale`    | int    | no       | `10`      | PNG module size in pixels                                     |
| `border`   | int    | no       | `4`       | Quiet zone (margin) in modules                                 |
| `error`    | string | no       | `H`       | Error correction: `L` (7%), `M` (15%), `Q` (25%), `H` (30%)   |
| `filename` | string | no       | `qr.png`/`qr.svg` | Download filename                                     |

## Response

The raw image bytes (PNG or SVG), returned as a file attachment — write the
response body directly to disk.

## Example

```bash
curl -sS -X POST https://devops.majbase.com/qr/api \
  -H "Content-Type: application/json" \
  -d '{"data": "https://example.com", "format": "png", "scale": 10, "error": "H"}' \
  -o qr.png
```

## Notes

- Background is transparent by default (only the dark modules are drawn, no
  light/background fill) — fine for PNG and SVG alike.
- If `data` looks like a URL, the server appends `utm_source=devops.majbase.com`
  to it automatically before encoding.
- Full interactive tool (and more examples): https://devops.majbase.com/qr/
