Skip to content
API key

API reference

QR images endpoints

Download the QR image for a QR code or a digital business card.

Download a QR image

GEThttps://api.qrbold.com/api/public/v1/qr-codes/:id/image Try it

Returns the rendered QR image for a QR code or a digital business card.

API key required. Scope: qr:read or cards:read. Campaign-scoped keys are refused. Plan: Pro, or the Business card plan.

Request

Request headers
HeaderRequiredValue
AuthorizationRequiredBearer YOUR_API_KEY. X-API-Key: YOUR_API_KEY is accepted instead.
Path parameters
NameTypeRequiredDescription
idstringRequiredA QR code id or a card id.

Query parameters

Query parameters
NameTypeRequiredDescription
formatstringOptionalFile format. svg and pdf stay sharp at any print size. One of png, svg, pdf, jpeg, webp. Default: png.
sizeintegerOptionalWidth in pixels, 128 to 4096. A framed code is taller than it is wide. pdf is one page at 300 dpi. Default: 512.
transparentbooleanOptionaltrue leaves the background clear. png, webp and svg only. Default: false.
downloadbooleanOptionaltrue answers with Content-Disposition: attachment so a browser saves the file. Default: false.

Example request

curl "https://api.qrbold.com/api/public/v1/qr-codes/cmf3k2a9x0001/image?format=png&size=1024" \
  -H "Authorization: Bearer $QRBOLD_API_KEY" \
  --output qr.png

Response

200 The image bytes, with a matching Content-Type and a suggested filename. Cached privately for an hour.

Errors

Errors specific to Download a QR image
StatusCodeWhenRetry?
422validation_failedThe request body or the query string did not pass validation.Only after changing the request or the account
404resource_not_foundNothing with that id exists in this account.No

Every endpoint can also answer 401 invalid_api_key, 403 forbidden, 403 upgrade_required_api, 404 unknown_endpoint, 429 rate limited and 500 internal_error. One failing response is shown below.

422 response
{
  "error": {
    "type": "invalid_request",
    "code": "validation_failed",
    "message": "One or more fields are invalid.",
    "details": [
      {
        "field": "fields.links.0.type",
        "message": "Invalid enum value",
        "code": "invalid_enum_value"
      },
      {
        "field": "shortCode",
        "message": "Slugs can only contain letters, numbers, and hyphens",
        "code": "invalid_string"
      }
    ]
  }
}

Good to know

  • The image encodes exactly the url reported by the card or QR code object, drawn with the design saved in the dashboard.
  • This link needs your API key, so it cannot be used as an image address in a web page or an email. Download the file and host it, or generate the image yourself from url.

Related