> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bananasplit.net/llms.txt
> Use this file to discover all available pages before exploring further.

# API endpoints

> QR Code API endpoint reference with all parameters.

## Base URL

```
https://bananasplit.net/api/qr-code
```

## URL QR codes

### GET request

```
GET /api/qr-code?type=url&url={encoded-url}&format={format}
```

Shortcut:

```
GET /api/qr-code/url?url={encoded-url}&format={format}
```

### POST request

```bash theme={null}
POST /api/qr-code
Content-Type: application/json

{
  "type": "url",
  "url": "https://example.com",
  "format": "svg"
}
```

## Request parameters

### Required

| Parameter | Type | Description |
| - | - | - |
| `type` | string | QR type: `url`, `wifi`, `vcard`, `email`, `sms`, `text` |

### Type-specific

<Tabs>
  <Tab title="url">
    | Parameter | Type | Description |
    | - | - | - |
    | `url` | string | The URL to encode |
  </Tab>

  <Tab title="wifi">
    | Parameter | Type | Description |
    | - | - | - |
    | `ssid` | string | Network name |
    | `password` | string | Network password |
    | `encryption` | string | `WPA`, `WEP`, or `nopass` |
    | `hidden` | boolean | Hidden network |
  </Tab>

  <Tab title="vcard">
    | Parameter | Type | Description |
    | - | - | - |
    | `firstName` | string | First name |
    | `lastName` | string | Last name |
    | `phone` | string | Phone number |
    | `email` | string | Email address |
    | `organization` | string | Company name |
    | `title` | string | Job title |
    | `url` | string | Website |
  </Tab>

  <Tab title="email">
    | Parameter | Type | Description |
    | - | - | - |
    | `email` | string | Recipient email |
    | `subject` | string | Email subject |
    | `body` | string | Email body |
  </Tab>

  <Tab title="sms">
    | Parameter | Type | Description |
    | - | - | - |
    | `phone` | string | Phone number |
    | `message` | string | Pre-filled message |
  </Tab>

  <Tab title="text">
    | Parameter | Type | Description |
    | - | - | - |
    | `text` | string | Plain text content |
  </Tab>
</Tabs>

### Styling

| Parameter | Type | Default | Description |
| - | - | - | - |
| `color` | hex | varies | Foreground color (6 digits, no `#`) |
| `background` | hex | varies | Background color (6 digits, no `#`) |
| `logo` | string | `none` | `banana` or `none` |
| `corners` | string | `square` | `square` or `rounded` |

### Output

| Parameter | Type | Default | Description |
| - | - | - | - |
| `format` | string | `json` | `json`, `svg`, or `png` |
| `size` | integer | 256 | Image size in pixels (128–2048) |

## Response formats

### JSON

```json theme={null}
{
  "svg": "<svg>...</svg>",
  "png": "data:image/png;base64,..."
}
```

### SVG

Returns raw SVG content with `Content-Type: image/svg+xml`.

### PNG

Returns binary PNG with `Content-Type: image/png`.

## Response headers

```
Cache-Control: private, no-store
```

## Error responses

### 400 Bad Request

```json theme={null}
{
  "error": "Invalid URL",
  "code": "INVALID_URL",
  "hint": "URL must start with http:// or https://"
}
```

Check `code` and `hint`, correct the request, retry once.

### 413 Payload Too Large

Content exceeds limits. Shorten the payload or encode a URL that points to the full data.

### 422 Unprocessable Entity

Valid JSON but invalid QR content. Check field constraints.

### 429 Too Many Requests

Rate limited. Wait for the duration in `Retry-After` header.

## Rate limits

* 60 requests per minute per caller per edge location
* Distributed across Cloudflare's network


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.