Skip to content
barcoder

Standards/wechat-mini-program-code

WeChat Mini Program Code

TypeBranded Visual Code
PrimaryCN
Completeness65%medium

Overview

The WeChat Mini Program Code (小程序码, xiǎochéngxù mǎ) is the round, petal-patterned code that Tencent's WeChat (Weixin in mainland China) uses to open a Mini Program, the small apps that run inside WeChat. A person points WeChat's "Scan" (扫一扫) at the code, or long-presses a picture of it inside WeChat, and the linked Mini Program page opens 111. Developers cannot draw the code themselves: it is generated by Tencent's servers through an authenticated API, only for a published Mini Program, and every generated code stays valid permanently 1.

It is a proprietary symbology, not an open standard. Tencent has not published how the code encodes data; a Tencent design engineer said in 2017 that the mapping of its regions was "not yet public" 11. Chinese users nicknamed it the "chrysanthemum code" (菊花码) 12.

History

Mini Programs before the code (January–April 2017). WeChat opened the Mini Program platform on 9 January 2017; Tencent called them "mini programs" because, per Tech in Asia's report, Apple would not allow the word "app" 1213. At first a Mini Program could be entered only by scanning its code with WeChat's "Scan" 11; during the late-2016 public beta it could not be opened by long-pressing a QR code inside WeChat at all 12. On 14 April 2017 WeChat opened "long-press to recognise a Mini Program QR code" 1112.

Launch (18 April 2017). Four days later, on the evening of 18 April 2017, WeChat released the Mini Program Code. Unlike the generic QR codes used until then, it could only be made through the WeChat Official Accounts Platform, and its shape changed "from square to round"; it still supported Moments posts and long-press recognition 812. Hu Renjie, deputy general manager of the WeChat Open Platform, said on 20 April that a separate code was introduced to protect users' information security and privacy and to give the brand's mark prominence in the code 9. By 22 April a Mini Program could open another Mini Program by long-pressing its code, a path that at first worked only for the new round codes, not for ordinary Mini Program QR codes or Official Account codes 10.

Patent. Tencent Technology (Shenzhen) filed Chinese patent application 201710208336.0 on 31 March 2017 for a two-dimensional code whose code elements form radially distributed strips around a central image, with a circular finder pattern; it was granted in the US as US10878213B2 on 29 December 2020 18. The patent does not name Mini Programs.

Current documentation. Tencent's guide now also documents a "one item, one code" (一物一码) route for printed product codes that open a Mini Program page without a quantity limit 1, and the APIs take an env_version parameter so a code can open the trial or development build instead of the released one 2; when these were introduced is not stated. The current developer guide was last edited on 23 July 2026 and the three API pages on 4 November 2026 12.

Technical specification

What the code looks like. Data are carried in short and long rays (射线) arranged around a central round logo area, which by default shows the Mini Program's avatar. There are three finder points, and a fixed WeChat Mini Program logo sits at the lower right 11. An early design draft had only two finder points 11.

Versions and error correction (per Tencent's design team). A Tencent CDC front-end engineer, Chen Jieting, described the internals in September 2017 11:

Property Value
Capacities 3 versions: 36, 54 and 72 rays
Error-correction levels L (about 10% of codewords recoverable), M (about 15%), Q (about 25%), H (about 35%)
Masking Data are XORed with 32 masks and the best-looking result is kept, to balance the "petals"
Regions Central custom logo area, lower-right official logo area, data area, and coloured "functional" areas holding version and error-correction information
Choice of version and level Picked by WeChat's backend; the API does not let the developer choose

She said the central logo carries no data, so unlike a QR code with a pasted-on logo, nothing has to be recovered by error correction there 11. Tencent has not published the bit layout, so whether the URL path is stored in the code or looked up on Tencent's servers is not documented.

What the patent describes. US10878213B2 describes one embodiment in detail: a circle of radius 26 units, a central image region of diameter 9 units, circular finder patterns, and 36 long strips (12 elements, one every 10°) staggered with 36 short strips (7 elements, offset by 5°), starting at 12 o'clock. The element nearest the centre in each long strip holds format information (version, error-correction level, mask), the outermost element is an edge element that gives the round outline, and about 500 elements carry codewords. Error correction uses Reed-Solomon at levels L, M, Q and H; the patent's table puts the 500-element capacity at 68/55/41/32 characters (L/M/Q/H) with a 45-symbol character set, or 61/49/37/28 with a 67-symbol URL alphabet 18. Dropping the short strips is given as a lower-capacity option, matching the 36-ray version 18. The patent's error-correction table gives H as 30%, where the engineer's talk said about 35% 1811. Tencent has not said the shipping code follows this embodiment exactly.

Generation APIs. All are HTTPS POST calls with a JSON body and an access_token. They should be called from a server, not from the Mini Program or a web page; on success they return the image bytes, and on failure a JSON error 234.

Interface Endpoint (cloud call) Output Target Quota
A, getQRCode /wxa/getwxacode (wxacode.get) Round code path, up to 1,024 characters, may include a query string Shares 100,000 codes with C
B, getUnlimitedQRCode /wxa/getwxacodeunlimit (wxacode.getUnlimited) Round code page (no query) plus scene, up to 32 characters Unlimited; 5,000 calls per minute
C, createQRCode /cgi-bin/wxaapp/createwxaqrcode (wxacode.createQRCode) Square QR code (not recommended) path, up to 128 characters Shares 100,000 codes with A

Sources: 1234. Interface A reports the codes used so far in an HTTP header, Num-Used, and returns error 45029 when the quota is used up 3.

Parameters.

  • width: 280 to 1,280 px, default 430 23.
  • auto_color (default false): picks the line colour automatically 2. Tencent's engineer said it follows the main colour of the central logo 11.
  • line_color: decimal RGB, default black, used when auto_color is false 2.
  • is_hyaline: transparent background, default false 2. Interface C takes only path and width 4.
  • env_version: release (default), trial or develop 23.
  • For interface B, check_path (default true) requires page to exist in the published version. When it is false, unpublished pages are allowed, up to 60,000 2.
  • scene allows digits, upper- and lower-case letters and !#$&'()*+,/:;=?@-._~. The % sign is not allowed, so Chinese text cannot be URL-encoded into it 2.
  • scancode_time is reserved and cannot be set 2.

Reading the parameters. With interface B the Mini Program receives scene as a query parameter on launch and must run decodeURIComponent on it 2. A personal (individual-owner) Mini Program must pass entity verification before it can generate codes (errors 85411–85413) 234.

Scanning. WeChat reports how a user arrived through launch "scene" values. Scanning a Mini Program Code is 1047, long-pressing one in an image is 1048, and picking one from the photo album is 1049. Ordinary QR codes have their own values (1011–1013), and "one item, one code" codes use 1124–1126 5. Inside a Mini Program, wx.scanCode can be limited to wxCode (Mini Program codes) among its scan types. It returns WX_CODE as the type, plus a path when the code belongs to the current Mini Program 7. According to the 2017 talk, long-press recognition in WeChat's web view screenshots the screen and looks for a code in it, while in the image viewer the picture, possibly compressed, is uploaded for recognition 11.

Use cases

  • Shops and services. WeChat promoted Mini Programs from the start as a platform "connecting offline" 12. A code printed on a poster, table or package opens a specific page; interface B's scene value carries an ID such as a table or product number to that page 2.
  • Mass-printed codes. Tencent recommends interface B for very large numbers of codes and advises generating them in advance because of the per-minute limit 1. For product packaging it offers "one item, one code", which it says is more secure and can be printed smaller than an ordinary link QR code 1.
  • Sharing on Moments. Before Mini Programs could be shared to Moments, developers made share images carrying a Mini Program Code, which friends opened by long-pressing the image 11.
  • Jumping between Mini Programs. From April 2017 a Mini Program code shown inside another Mini Program could be long-pressed to open it 10.
  • Mini Games. The same APIs serve Mini Games; a game can pass a query-only path such as ?foo=bar 3.

No public figures exist for how many Mini Program Codes have been generated or scanned. Tencent reports only Mini Program activity in general (see Status).

Implementations

No open encoder or decoder exists. No GitHub repository re-implements the round symbology, and none decodes it. A GitHub search for 小程序码 returns Mini Program demos and generators for ordinary QR codes. ZXing, the most widely used open barcode library, lists QR Code, Data Matrix, Aztec, PDF 417, MaxiCode and the RSS/DataBar formats as its 2D formats, and the Mini Program Code is not among them 21. In January 2024 the maintainer of Umi-OCR, an open-source OCR tool with about 48,000 GitHub stars, declined to support Mini Program codes. He said they use a private protocol with encrypted content that only WeChat's own interfaces can parse; that is his statement, not something Tencent has published 19.

API clients. Server SDKs wrap Tencent's three generation endpoints and return the PNG Tencent sends back:

Repository Language Stars Last push What it does
wechatpy/wechatpy Python 4,312 May 2026 create_qrcode, get_wxa_code, get_wxa_code_unlimited call the three endpoints 22
silenceper/wechat Go 5,316 Nov 2026 CreateWXAQRCode, GetWXACode, GetWXACodeUnlimit 23

Star counts and push dates were read from the GitHub API on 6 Nov 2026. Barcoder has no playground for this code because there is no open encoder to build one on.

Comparison

Against a plain QR code. A QR Code can be made by anyone and read by any scanner. The Mini Program Code can only be made through WeChat and read by WeChat 11. Tencent's guide recommends the round code because it is easier to recognise and supports extra features such as showing the "follow Official Account" component; it labels its own square Mini Program QR code (interface C) "not recommended" 1. The 2017 talk listed the reasons: the user knows a Mini Program will open, the code is safer because only WeChat makes and reads it, the WeChat logo builds the brand, and the central logo costs no error correction 11. The trade-off is reach: an ordinary QR code works outside WeChat, the round code does not.

Against a URL QR code linked to a Mini Program. Organisations (companies, media, government) whose Mini Programs are configured for it can make an ordinary QR code that encodes a web link open their Mini Program, without reprinting existing codes. The rule matches protocol, domain and a sub-path prefix registered in the Mini Program admin console, and the domain must have an ICP filing. The full link reaches the page as the q parameter, together with scancode_time 6. This keeps codes readable by other apps; the round code needs no domain at all.

Against the WeChat Pay QR code. A merchant's WeChat Pay QR for "Native" payment is a standard QR code. The merchant's server receives a code_url such as weixin://pay.weixin.qq.com/bizpayurl/up?pr=… from the order API and turns it into a QR image itself 20. A Mini Program Code, by contrast, is an image Tencent renders and returns 2.

Against other branded codes. Chen Jieting placed it alongside the custom codes Facebook and Snap had already launched, which correspond to Messenger Code and Snapcode 11. As with those, the brand owner controls both the generator and the scanner.

Fun facts

  • The design started as "a flower" with two finder points; the released code has three 11.
  • The same 2017 talk cites Visualead, an Israeli start-up whose QR codes removed nearly 70% of the modules and in which Alibaba invested in 2015, as a precursor of shaped codes 11.

Status

Active. Tencent's developer documentation for the code and its three APIs was being maintained in 2026, with edits on 23 July and 4 November 2026 12. Mini Programs had more than 200 million daily active users in mid-2018 14 and 450 million on average in 2021, per Tencent figures reported by Reuters 15. Tencent said Mini Programs exceeded 1.1 billion monthly active users as of the second quarter of 2023 16. In its June 2026 corporate overview Tencent describes an "ecosystem of millions of Mini Programs" 24. Its 2025 annual results (18 March 2026) report rapid growth in engagement with Mini Shops, Mini Games and content Mini Programs, and 1,418 million combined Weixin and WeChat monthly users 17. Tencent has not published any count of codes generated or scanned.

Sources

Deployments

No country reports mention this standard by name.

source · content/standards/wechat-mini-program-code/index.md