GET
/
qr
package main

import(
	"context"
	dubgo "github.com/dubinc/dub-go"
	"github.com/dubinc/dub-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := dubgo.New(
        dubgo.WithSecurity("DUB_API_KEY"),
    )

    res, err := s.QRCodes.Get(ctx, operations.GetQRCodeRequest{
        URL: "https://needy-newsstand.biz/",
        HideLogo: dubgo.Bool(true),
        IncludeMargin: dubgo.Bool(false),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
"<string>"

Query Parameters

url
string
required

The URL to generate a QR code for.

The logo to include in the QR code. Can only be used with a paid plan on Dub.

size
number
default:600

The size of the QR code in pixels. Defaults to 600 if not provided.

level
enum<string>
default:L

The level of error correction to use for the QR code. Defaults to L if not provided.

Available options:
L,
M,
Q,
H
fgColor
string
default:#000000

The foreground color of the QR code in hex format. Defaults to #000000 if not provided.

bgColor
string
default:#FFFFFF

The background color of the QR code in hex format. Defaults to #ffffff if not provided.

Whether to hide the logo in the QR code. Can only be used with a paid plan on Dub.

margin
number
default:2

The size of the margin around the QR code. Defaults to 2 if not provided.

includeMargin
boolean
default:true
deprecated

DEPRECATED: Margin is included by default. Use the margin prop to customize the margin size.

Response

200
image/png

The QR code

The response is of type string.