BitlyDeveloper
Navigation

Generate QR Codes

You’ll need to create a short link to define a QR Code’s destination before creating the QR Code. After creating the short link, you can generate a QR Code for it via the API. QR Code colors and file type options may be available depending on your subscription plan.

Refer to the Create Endpoint for a detailed breakdown of the customizations that are available when creating a QR Code.

There are multiple examples in the dropdown for the request which show a variety of QR Code customizations.

We recommend taking a look at the available customizations in the Bitly web app for a visual preview of what's available.

Creating a QR Code for a short link

The Create QR Code endpoint can create codes with a large variety of customizations.

Multiple QR Codes can be created for the same url if needed. Just call the endpoint multiple times.

The minimum amount of data required is as follows:

POST /v4/qr-codes
{
  "title": "Minimal QR Code",
  "group_guid": "Ba1bc23dE4F",
  "destination": {
    "bitlink_id": "bit.ly/abc123"
  }
}

Request Body

The request body is briefly described below and in more detail in the Create Endpoint.

title string A title to name the QR Code.

destination object This determines where the QR Code scan is redirected.

render_customizations object Change the colors, shapes, add logos, and more. This object determines what the QR Code will look like.

You can specify the color of almost any element of the QR Code. There are multiple shapes for the different elements of the QR Code.

Let's create another QR Code with some customization options set. We'll set the dot pattern option to rounded and adjust the shape of each corner to leaf. We'll also use two gradients, one for the background, and one for the color of the QR dots.

POST /v4/qr-codes
{
  "title": "Gradient QR Code",
  "group_guid": "Ba1bc23dE4F",
  "destination": {
    "bitlink_id": "bit.ly/abc123"
  },
  "render_customizations": {
    "dot_pattern_type": "rounded",
    "corners": {
      "corner_1": { "shape": "leaf" },
      "corner_2": { "shape": "leaf" },
      "corner_3": { "shape": "leaf" }
    },
    "gradient": {
      "style": "linear",
      "angle": 45,
      "colors": [
        { "color": "#C80404", "offset": 10 },
        { "color": "#042F86", "offset": 90 }
      ],
      "exclude_corners": false
    },
    "background_gradient": {
      "style": "radial",
      "colors": [
        { "color": "#C696EE", "offset": 25 },
        { "color": "#D4E1A8", "offset": 50 }
      ]
    }
  }
}

A successful response will return metadata about the QR Code.

{
  "qrcode_id": "string",
  "group_guid": "string",
  "title": "string",
  "archived": "boolean",
  "created": "string",
  "modified": "string"
}

Once the code has been created successfully we can grab the image data from the following endpoint.

GET /v4/qr-codes/{qrcode_id}/image

The response is returned as SVG by default.