May 19, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0
Get an overview of the user's access to the gadget data
How to call:
POST https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
begin_date | string | Is | The start date. The format is yyyymmdd | |
end_date | string | Is | End date, limit queries to 1 day of data, allow setting the maximum value for yesterday. The format is yyyymmdd |
The returned JSON packet
Property | Type | Description |
---|---|---|
list | Array.<Object> | The list of data |
The structure of the list
Property | Type | Description |
---|---|---|
ref_date | string | Date, in yyyymmdd |
visit_total | number | The cumulative number of users |
share_pv | number | Number of forwards |
share_uv | number | The number of forwards |
{
"begin_date" : "20170313",
"end_date" : "20170313"
}
{
"list": [
{
"ref_date": "20170313",
"visit_total": 391,
"share_pv": 572,
"share_uv": 383
}
]
}
Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.
openapi.analysis.getDailySummary
You need to configure the permissions for the analysis.getDailySummary API in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
beginDate | string | Is | The start date. The format is yyyymmdd | |
endDate | string | Is | End date, limit queries to 1 day of data, allow setting the maximum value for yesterday. The format is yyyymmdd |
The returned JSON packet
Property | Type | Description |
---|---|---|
list | Array.<Object> | The list of data |
The structure of the list
Property | Type | Description |
---|---|---|
refDate | string | Date, in yyyymmdd |
visitTotal | number | The cumulative number of users |
sharePv | number | Number of forwards |
shareUv | number | The number of forwards |
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.analysis.getDailySummary({
beginDate: '20170313',
endDate: '20170313'
})
return result
} catch (err) {
return err
}
}
{
"list": [
{
"refDate": "20170313",
"visitTotal": 391,
"sharePv": 572,
"shareUv": 383
}
],
"errMsg": "openapi.analysis.getDailySummary:ok"
}