필터

Overview

The QR Code API is an HTTP API that can be use for creating custom QR Codes programmatically. Every QR Code will contain a unique Branch link which you can deep link and track analytics with.

📘

QR 코드 API

Access to Branch's QR Code API and SDK requires premium product access. Please reach out to your account manager or https://branch.io/pricing/ to activate.

Create a QR Code

엔드 포인트

POST /v2/qr-code
Content-Type: application/json

사용량 제한

  • 25 requests per second
  • 100 requests per minute
  • 1000 requests per hour

파라미터

파라미터유형정의
branch_key (REQUIRED)StringThe Branch key of the originating app; from your Branch Settings Dashboard
data (Optional)JSONThe dictionary to embed link data behind the QR Code. Accessed as session or install parameters from the SDK. Use the data dictionary for all link control parameters that you'll find here.
Branch analytics parameters (Optional)String대시보드에서 데이터가 일관되고 읽기 쉽게 표시되도록 조직적인 분석 레이블 구조로 링크에 태그를 지정하는 것이 중요합니다.
qr_code_settingsJSONIf this nor any of the key/value pairs are not present, we will utilize your app defaults. See table below for setting details.

qr_code_settings

파라미터유형정의
code_colorStringHex color value of the QR Code itself.
background_colorStringHex color value of the background of the QR code itself.
marginInteger (Pixels)The number of pixels you want for the margin. Min 1px. Max 20px.
widthInteger (Pixels)Output size of QR Code image. Min 300px. Max 2000px. (Only applicable to JPEG/PNG)
image_formatStringPNG, JPEG, or JPG
center_logo_urlString (HTTP URL)URL to the image you want as a center logo e.g. “https://cdn.branch.io/branch-assets/1598575682753-og_image.png”
code_pattern정수Instead of the generic/standard QR-Code pattern we’re used to seeing, customers can now use (1) standard, (2) squares, (3) circles, (4) triangles, (5) diamonds, (6) hexagons, and (7) octagons.
finder_pattern정수The finder pattern refers to the shape seen in the top left, top right, and bottom left of a QR-Code. Users can now choose between a square, a rounded square, or a circle. 1 = square, 2 = rounded rectangle, 3 = circle
finder_pattern_colorStringHex color value of the Finder Pattern as per the https://htmlcolorcodes.com/
background_image_urlStringWe can lay the QR-Code on top of a background image. Users can send a background_image_opacity to adjust how visible and prominent the background image is.
background_image_opacity정수The opacity percentage of the background image.
code_pattern_urlStringDirect link to an image to be used as the code-pattern itself on the QR Code.
finder_eye_colorStringHex color value of the finder eye as per the https://htmlcolorcodes.com/

샘플 요청

curl --request POST \
     --url https://api2.branch.io/v2/qr-code \
     --header 'accept: image/*' \
     --header 'content-type: application/json' \
     --data '
{
     "qr_code_settings": {
          "code_pattern": 1,
          "finder_pattern": 1,
          "image_format": "png",
          "center_logo_url": "https://cdn.branch.io/branch-assets/1598575682753-og_image.png",
          "width": 300,
          "margin": 1,
          "code_color": "#000000",
          "background_color": "#FFFFFF",
          "finder_pattern_color": "#000000",
          "finder_eye_color": "#000000"
     },
     "branch_key": "key_live_xxxx"
}
'

📘

Image Ouput

Note that the output of this cURL requests will be saved in the current directory as the file name indicated at the end of the request e.g. qr_code.png.

Result

700