Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API to get users in the past 30 days WeChat movement steps


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.getWeRunData(OBJECT)


Base library 1.2.0 starts to support, and low versions need to be compatible

To get the user's number of WeChat motion steps over the past 30 days, you need to call the wx.login interface first.

OBJECT parameter description:

The name of the argument Type Required Description
success Function Whether The interface calls a successful callback function
fail Function Whether The interface calls the failed callback function
complete Function Whether Callback function at end of interface call (call succeeds, fails are executed)

Success returns a description of the parameters:

The name of the argument Type Description
errMsg String The result of the call
encryptedData String Encrypted data for complete user information, including sensitive data, can be found in the encryption data decryption algorithm
iv String Initial vector of an encryption algorithm, see Encryption data decision algorithm

Sample code:

wx.getWeRunData({
    success(res) {
        const encryptedData = res.encryptedData
    }
})

EncryptedData decrypts the following JSON structure, see Encryption data decision algorithm

Attributes type illustrate
stepInfoList ObjectArray The number of WeChat sports steps in the past 30 days

The STEPINFO structure is as follows

Attributes type illustrate
timestamp Number Timestamp, indicating the time of data
step Number WeChat sports step

{
    "stepInfoList": [
        {
            "timestamp": 1445866601,
            "step": 100
        },
        {
            "timestamp": 1445866602,
            "step": 100
        }
    ]
}