# analysis.getDailySummary
Call this API at the server side. For more information, see Server API.
This API supports Cloud Calls. The WeChat DevTools version must be
1.02.1904090or later (download the latest stable version here), and thewx-server-sdkversion must be0.4.0or later.
Obtains the data summary of user visits to a Mini Program.
Calling methods:
# HTTPS Call
# Request Address
POST https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend?access_token=ACCESS_TOKEN
# Request Parameters
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| access_token | string | Yes | Credentials to call API | |
| begin_date | string | Yes | Start date, in the format of yyyymmdd. | |
| end_date | string | Yes | End date, in the format of yyyymmdd. Only the data of one day can be queried, and the maximum value is the previous day. |
# Return Value
# Object
JSON data package that is returned
| Attribute | Type | Description |
|---|---|---|
| list | Array.<Object> | Data list. |
list is composed as follows
| Property | Type | Description |
|---|---|---|
| ref_date | string | Date, in the format of yyyymmdd. |
| visit_total | number | Total number of users |
| share_pv | number | Number of forwards |
| share_uv | number | Number of forwarders |
# Request Data Example
{
"begin_date" : "20170313",
"end_date" : "20170313"
}
# Return Data Example
{
"list": [
{
"ref_date": "20170313",
"visit_total": 391,
"share_pv": 572,
"share_uv": 383
}
]
}
# Cloud Call
Cloud call is a capability provided by Mini Program·Cloud Base that allows you to call WeChat APIs in a cloud function. It must be used via
wx-server-sdkin the cloud function.
# API Calling Method
openapi.analysis.getDailySummary
You need to configure the permissions for the
analysis.getDailySummaryAPI viaconfig.json. Details
# Request Parameters
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| beginDate | string | Yes | Start date, in the format of yyyymmdd. | |
| endDate | string | Yes | End date, in the format of yyyymmdd. Only the data of one day can be queried, and the maximum value is the previous day. |
# Return Value
# Object
JSON data package that is returned
| Attribute | Type | Description |
|---|---|---|
| list | Array.<Object> | Data list. |
list is composed as follows
| Property | Type | Description |
|---|---|---|
| refDate | string | Date, in the format of yyyymmdd. |
| visitTotal | number | Total number of users |
| sharePv | number | Number of forwards |
| shareUv | number | Number of forwarders |
# Request Data Example
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'
})
console.log(result)
return result
} catch (err) {
console.log(err)
return err
}
}
# Return Data Example
{
"list": [
{
"refDate": "20170313",
"visitTotal": 391,
"sharePv": 572,
"shareUv": 383
}
],
"errMsg": "openapi.analysis.getDailySummary:ok"
}