---
title: Generate QR Code as SVG API
slug: generate-qr-code-as-svg-api
url: https://apyhub.com/freedailypro/service/generate-qr-code-as-svg-api
provider: FreeDailyPro
tags: [qr code, qr code generator, generate qr code, svg qr code, text to qr, url to qr, encode text, qr]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 1
atoms: 10
mcp: true
---

# Generate QR Code as SVG API

Generate a QR code from any text or URL as a scalable SVG. Choose JSON or SVG output and use it in web pages, print layouts and documents.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/freedailypro/generate-qr-code-as-svg-api` | What it does Generates a QR code from the provided text and returns it as a scalable SVG. By defaul… | 10 |

## Endpoint reference

### Generate a QR code as valid SVG

`POST https://api.eu.apyhub.com/freedailypro/generate-qr-code-as-svg-api` · 10 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `text` | body | string | yes |  |
| `format` | body | string | no | One of: json, svg. |

#### Quickstart

Generate a QR code from the required text, optionally choosing the output format.

```bash
curl -X POST "https://api.eu.apyhub.com/freedailypro/generate-qr-code-as-svg-api" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "https://apyhub.com",
    "format": "json"
  }'
```

#### What you'll get back

By default, a JSON object with the QR code as SVG markup and as a data URL:

```json
{
  "tool": "...",
  "result": {
    "svg": "<svg ...>...</svg>",
    "dataUrl": "data:image/svg+xml;...",
    "width": 256,
    "height": 256
  }
}
```

## About

## What it does
QR Code Generator turns a string of text into a valid SVG QR code. Send a required `text` value in the request body, and you can also set `format` to either `json` or `svg`.

Use it when you need a QR code for a URL, payment link, onboarding flow, product label, or offline handoff. Because the endpoint returns a valid SVG QR code, it fits well in web apps, print layouts, and any workflow that needs a crisp, scalable code rather than a raster image.

The input is intentionally small: just the text you want encoded, with no extra fields to manage. That makes it easy to generate codes from user-entered strings, generated links, or internal identifiers without adding formatting logic in your app.

The default response is JSON containing the SVG markup, a data URL for use in an `img` tag, and the image size. Set `format` to `svg` to get the raw SVG file instead, so you can treat this as a focused generation step in a larger document or asset pipeline.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/freedailypro/service/generate-qr-code-as-svg-api
