# Create URL QR Code — QR API

> Create a URL QR Code. See the documentation

- Key: `qr_api-create-url-qrcode`
- Type: Action (Write)
- Version: 0.0.2
- App: QR API (`qr_api`) — https://pipedream.com/apps/qr-api.md
- This page (HTML): https://pipedream.com/apps/qr-api/actions/create-url-qrcode
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/qr_api/actions/create-url-qrcode/create-url-qrcode.mjs

## Description

Create a URL QR Code. [See the documentation](https://qrapi.io/api-documentation/#/qrcode/create_url_qr_code)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filename` | `string` | Yes | The filename that will be used to save in /tmp directory without extension |
| `size` | `string` | No | Parameter valid only if poster.url is not specified. Use this parameter to specify the size preset of the QR Code image (including Quiet Zone which is free area around QR Code to ensure scannability). |
| `quiteZone` | `string` | No | Parameter valid only if poster.url is not specified. Use this parameter to specify the size of the Quiet Zone (which is free area around QR Code to ensure scannability). Set the Quiet Zone within a range of 0 to 12 (where 0 indicates no Quiet Zone and 12 the maximum). Tip: To achieve high scannability, it is recommended to set the Quiet Zone value to at least 4 or higher. |
| `customSize` | `integer` | No | Parameter valid only if parameter size is set to custom. Use this parameter to specify the custom size of the QR Code image in pixels (including Quiet Zone, which is free area around QR Code to ensure scannability). |
| `errorCorrection` | `string` | No | Use this parameter to set error correction level of the QR Code. Error Correction helps maintain scannability of the QR Code even if there is some damage to data modules. Error correction is measured in damage in percentage (%) that it can sustain. Values are L (~7%), M (~15%), Q (~25%), and H (~30%). |
| `dataPattern` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to edit the pattern of data modules of the QR Code. Choose pattern value from drop-down. View all the data patterns here. |
| `eyePattern` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to edit the pattern of the eyes (position markers in the three corners) of the QR Code. Choose pattern value from drop-down. View all the eye patterns here. |
| `dataGradientStyle` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to add a color gradient style to the group of data modules. Choose style value from drop-down. View all the gradient patterns here. |
| `dataGradientStartColor` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to EITHER add a color (in hex format #000000) to all data modules (if data_gradient_style is set to None) OR to add the start color to data modules (if data_gradient_style is not set to None). |
| `dataGradientEndColor` | `string` | No | Parameter valid only if poster.url is not specified and data_gradient_style is not set to None. Use this parameter to set the end color (in hex format #000000) to data modules. |
| `eyeColorInner` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to specify color (in hex format #000000) to the inner component of the QR Code (all three) eyes (position markers in the three corners). |
| `eyeColorOuter` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to specify color (in hex format #000000) to the outer component of the QR Code (all three) eyes (position markers in the three corners). |
| `backgroundColor` | `string` | No | Parameter valid and required only if poster.url is not specified. Use this parameter to specify color (in hex format #000000) of the QR Codes' background including non-dark data modules. To remove background (i.e. make transparent), use value false. Tip: For highest scannability keep the background color as white i.e. #FFFFFF. |
| `logoUrl` | `string` | No | Parameter valid only if poster.url is not specified. Use this field if you want to design the QR Code with the 'Custom with Logo' feature. Otherwise, skip. Enter the URL of the image you want as a logo. Tip: Ensure the image source allows cross-domain access. Or simply use the Media feature to upload image and get URL or choose from our list of ready-made logos and icons. See the full list here. |
| `logoSize` | `integer` | No | Parameter valid only if data in logo.url is specified. Enter the size of the logo image as a percentage (%) of size of logo. Tip: High logo size may make the QR Code unscannable. Test thoroughly before finalizing. |
| `logoExcavated` | `boolean` | No | Parameter valid only if data in logo.url is specified. Use this paramater to specify if the blocks around the logo should be remove (true) or should not be removed (false) Tip: If selecting true, set error correction to a higher-level to ensure loss of blocks doesn't affect scannability. |
| `logoAngle` | `integer` | No | Parameter valid only if data in logo.url is specified. Use this parameter if you wish to rotate the image at an angle. Use values 1-359 (degrees) for clockwise rotation and -1 to -359 (degrees) for anti-clockwise rotation. |
| `logoCache` | `boolean` | No | Parameter valid and required only if logo.url is specified. By default, it will be set to True. When set to True, the logo image provided will be cached for 10 minutes to improve performance. Set to False only if the image uploaded in the URL provided in logo.url field will change frequently, else skip. |
| `posterUrl` | `string` | No | Use this field if you want to design the QR Code with the 'Custom with Background' feature. Otherwise, skip. Enter the URL of the image you want as a background image. Tip: Ensure the image source allows cross-domain access. Or simply use the Media feature to upload image and get URL. |
| `posterLeft` | `integer` | No | Parameter valid only if poster.url is specified. This parameter will help you position the QR Code from the left edge of the uploaded background image. Specify value in percentage (%) where value is the distance between the left-edge of the image and the centre of the QR Code.Tip: Value 50 is placing the QR Code in the centre of the background image in terms of image width. |
| `posterTop` | `integer` | No | Parameter valid only if poster.url is specified. This parameter will help you position the QR Code from the top edge of the uploaded background image. Specify value in percentage (%) where value is the distance between the top-edge of the image and the centre of the QR Code.Tip: Value 50 is placing the QR Code in the centre of the background image in terms of image height. |
| `posterSize` | `integer` | No | Parameter valid only if poster.url is specified. This parameter will help you specify the size of the QR Code relative to the size of the uploaded background image. Specify value in percentage (%) where value is the ratio of QR Code size and Uploaded Image size. |
| `posterEyeshape` | `string` | No | Parameter valid only if poster.url is specified. Use this parameter to edit the pattern of the eyes (position markers in the three corners) of the QR Code. Choose pattern value from drop-down. View all the poster eye patterns here. |
| `posterDataPattern` | `string` | No | Parameter valid only if poster.url is specified. Use this parameter to edit the pattern of data modules of the QR Code. Choose pattern value from drop-down. View all the poster data patterns here. |
| `format` | `string` | Yes | Format of QR Code |
| `syncDir` | `dir` | Yes | SyncDir |
| `url` | `string` | Yes | The URL to encode in the QR Code. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "qr_api",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "qr_api-create-url-qrcode",
  arguments: {
    filename: "Filename",
    size: "Size",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "qr_api-create-url-qrcode",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    qr_api: { authProvisionId: "apn_xxxxxxx" },
    filename: "Filename",
    size: "Size",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "qr_api-create-url-qrcode",
    "configured_props": {
      "qr_api": { "authProvisionId": "apn_xxxxxxx" },
      "filename": "Filename",
      "size": "Size"
    }
  }'
```

---

- App: https://pipedream.com/apps/qr-api.md · All apps: https://pipedream.com/apps
