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

WeChat gadget getDaily Summary


May 19, 2021 WeChat Mini Program Development Document


Table of contents


analysis.getDailySummary

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:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

POST https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend?access_token=ACCESS_TOKEN

Request parameters

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

Returns a value

Object

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

An example of requesting data

{
  "begin_date" : "20170313",
  "end_date" : "20170313"
}

Return an example of the data

{
  "list": [
    {
      "ref_date": "20170313",
      "visit_total": 391,
      "share_pv": 572,
      "share_uv": 383
    }
  ]
}

Cloud calls

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.

The interface method

openapi.analysis.getDailySummary
You need to configure the permissions for the analysis.getDailySummary API in config.json, details

Request parameters

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

Returns a value

Object

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

An example of requesting data

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
  }
}

Return an example of the data

{
  "list": [
    {
      "refDate": "20170313",
      "visitTotal": 391,
      "sharePv": 572,
      "shareUv": 383
    }
  ],
  "errMsg": "openapi.analysis.getDailySummary:ok"
}