# QR Code API

> Creates QR codes as PNG or SVG from text or links, and reads codes from public image URLs.

Category: Utilities. Region: global. 4 endpoints at `https://api.hoshime.com/v1/qrcode/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/qrcode
## GET /v1/qrcode/create

A QR code of a text or link as a base64 PNG, with its side in pixels.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `data` | string | yes | The text or link the code encodes, up to 1000 bytes. (e.g. https://example.com) |
| `imageSize` | integer | no | Side of the square image in pixels, from 50 to 1000. (default 200; e.g. 200) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `base64` (string), `mimeType` (string), `size` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/qrcode/create?data=https%3A%2F%2Fexample.com&imageSize=200" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/qrcode/read

The codes in a public image URL and what they say.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Public http or https URL of an image that holds a QR code. (e.g. https://api.qrserver.com/v1/create-qr-code/?data=hello) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `data` (string), `error` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/qrcode/read?url=https%3A%2F%2Fapi.qrserver.com%2Fv1%2Fcreate-qr-code%2F%3Fdata%3Dhello" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/qrcode/svg

A QR code of a text or link as an SVG document, which scales without blur.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `data` | string | yes | The text or link the code encodes, up to 1000 bytes. (e.g. https://example.com) |
| `imageSize` | integer | no | Side of the square in pixels, from 50 to 1000. (default 200; e.g. 200) |
| `ecc` | string | no | Error correction level: L, M, Q or H. Higher levels survive more damage and make bigger codes. (one of L, M, Q, H; default M; e.g. M) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `data` (string), `ecc` (string), `size` (integer (int64)), `svg` (string)

```bash
curl "https://api.hoshime.com/v1/qrcode/svg?data=https%3A%2F%2Fexample.com&imageSize=200&ecc=M" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/qrcode/quickchart

A QR code of a text or link as a PNG image from QuickChart, a second generator with its own error correction setting.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `data` | string | yes | The text or link the code encodes, up to 1000 bytes. (e.g. https://example.com) |
| `imageSize` | integer | no | Side of the square image in pixels, from 50 to 1000. (default 200; e.g. 200) |
| `ecc` | string | no | Error correction level: L, M, Q or H. Higher levels survive more damage and make bigger codes. (one of L, M, Q, H; default M; e.g. H) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `base64` (string), `mimeType` (string), `size` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/qrcode/quickchart?data=https%3A%2F%2Fexample.com&imageSize=200&ecc=H" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
