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

WeChat gadgets access trends


May 19, 2021 WeChat Mini Program Development Document


Table of contents


analysis.getDailyVisitTrend

This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. D eveloper tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0

Get trends in user access to gadget data day

How to call:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

POST https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?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
session_cnt number Number of opens
visit_pv number Number of visits
visit_uv number Number of visitors
visit_uv_new number The number of new users
stay_time_uv number Length of stay per capita (floating point type, in seconds)
stay_time_session number Duration of second stay (floating point type, in seconds)
visit_depth number Average access depth (floating-point type)

An example of requesting data

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

Return an example of the data

{
  "list": [
    {
      "ref_date": "20170313",
      "session_cnt": 142549,
      "visit_pv": 472351,
      "visit_uv": 55500,
      "visit_uv_new": 5464,
      "stay_time_session": 0,
      "visit_depth": 1.9838
    }
  ]
}

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.getDailyVisitTrend
Permissions for the analysis.getDailyVisitTrend API need to be configured 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
sessionCnt number Number of opens
visitPv number Number of visits
visitUv number Number of visitors
visitUvNew number The number of new users
stayTimeUv number Length of stay per capita (floating point type, in seconds)
stayTimeSession number Duration of second stay (floating point type, in seconds)
visitDepth number Average access depth (floating-point type)

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.getDailyVisitTrend({
        beginDate: '20170313',
        endDate: '20170313'
      })
    return result
  } catch (err) {
    return err
  }
}

Return an example of the data

{
  "list": [
    {
      "refDate": "20170313",
      "sessionCnt": 142549,
      "visitPv": 472351,
      "visitUv": 55500,
      "visitUvNew": 5464,
      "stayTimeSession": 0,
      "visitDepth": 1.9838
    }
  ],
  "errMsg": "openapi.analysis.getDailyVisitTrend:ok"
}

analysis.getMonthlyVisitTrend

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 monthly trends in user access to small program data (the most recent data available for the last natural month)

How to call:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

POST https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyvisittrend?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, which is the first day of the natural month. The format is yyyymmdd
end_date string Is The end date, the last day of the natural month, limits the query to one month's data. 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 Time, format yyyymm, e.g. "201702"
session_cnt number Number of opens (summary within natural months)
visit_pv number Number of visits (summary within natural months)
visit_uv number Number of visitors (heavy within natural months)
visit_uv_new number Number of new users (weighted within natural months)
stay_time_uv number Length of stay per capita (floating point type, in seconds)
stay_time_session number Duration of second stay (floating point type, in seconds)
visit_depth number Average access depth (floating-point type)

Description of the access period

To limit queries to data for a natural month, the time must be entered as a natural month: e.g. 20170301, 20170331

An example of requesting data

{
  "begin_date" : "20170301",
  "end_date" : "20170331"
}

Return an example of the data

{
  "list": [
    {
      "ref_date": "201703",
      "session_cnt": 126513,
      "visit_pv": 426113,
      "visit_uv": 48659,
      "visit_uv_new": 6726,
      "stay_time_session": 56.4112,
      "visit_depth": 2.0189
    }
  ]
}

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.getMonthlyVisitTrend
The permissions for the analysis.getMonthlyVisitTrend API need to be configured in config.json, details

Request parameters

Property Type The default Required Description
beginDate string Is The start date, which is the first day of the natural month. The format is yyyymmdd
endDate string Is The end date, the last day of the natural month, limits the query to one month's data. 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 Time, format yyyymm, e.g. "201702"
sessionCnt number Number of opens (summary within natural months)
visitPv number Number of visits (summary within natural months)
visitUv number Number of visitors (heavy within natural months)
visitUvNew number Number of new users (weighted within natural months)
stayTimeUv number Length of stay per capita (floating point type, in seconds)
stayTimeSession number Duration of second stay (floating point type, in seconds)
visitDepth number Average access depth (floating-point type)

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.getMonthlyVisitTrend({
        beginDate: '20170301',
        endDate: '20170331'
      })
    return result
  } catch (err) {
    return err
  }
}

Return an example of the data

{
  "list": [
    {
      "refDate": "201703",
      "sessionCnt": 126513,
      "visitPv": 426113,
      "visitUv": 48659,
      "visitUvNew": 6726,
      "stayTimeSession": 56.4112,
      "visitDepth": 2.0189
    }
  ],
  "errMsg": "openapi.analysis.getMonthlyVisitTrend:ok"
}

analysis.getWeeklyVisitTrend

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 trends in user access to the gadget data week

How to call:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

POST https://api.weixin.qq.com/datacube/getweanalysisappidweeklyvisittrend?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, which is Monday. The format is yyyymmdd
end_date string Is The end date, which is Sunday, limits the query to one week's data. 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 Time, format yyymmdd-yyyymmdd, e.g. "20170306-20170312"
session_cnt number Number of opens (natural week summary)
visit_pv number Number of visits (natural week summary)
visit_uv number Number of visitors (heavy during the natural week)
visit_uv_new number Number of new users (natural week to go heavy)
stay_time_uv number Length of stay per capita (floating point type, in seconds)
stay_time_session number Duration of second stay (floating point type, in seconds)
visit_depth number Average access depth (floating-point type)

Description of the access period

Limited query data for a natural week, the time must be entered according to the nature week: e.g. 20170306 (Monday), 20170312 (Sunday)

An example of requesting data

{
  "begin_date" : "20170306",
  "end_date" : "20170312"
}

Return an example of the data

{
  "list": [
    {
      "ref_date": "20170306-20170312",
      "session_cnt": 986780,
      "visit_pv": 3251840,
      "visit_uv": 189405,
      "visit_uv_new": 45592,
      "stay_time_session": 54.5346,
      "visit_depth": 1.9735
    }
  ]
}

Cloud calls

It 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.getWeeklyVisitTrend
The permissions for the analysis.getWeeklyVisitTrend API need to be configured in config.json, details

Request parameters

Property Type The default Required Description
beginDate string Is The start date, which is Monday. The format is yyyymmdd
endDate string Is The end date, which is Sunday, limits the query to one week's data. 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 Time, format yyymmdd-yyyymmdd, e.g. "20170306-20170312"
sessionCnt number Number of opens (natural week summary)
visitPv number Number of visits (natural week summary)
visitUv number Number of visitors (heavy during the natural week)
visitUvNew number Number of new users (natural week to go heavy)
stayTimeUv number Length of stay per capita (floating point type, in seconds)
stayTimeSession number Duration of second stay (floating point type, in seconds)
visitDepth number Average access depth (floating-point type)

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.getWeeklyVisitTrend({
        beginDate: '20170306',
        endDate: '20170312'
      })
    return result
  } catch (err) {
    return err
  }
}

Return an example of the data

{
  "list": [
    {
      "refDate": "20170306-20170312",
      "sessionCnt": 986780,
      "visitPv": 3251840,
      "visitUv": 189405,
      "visitUvNew": 45592,
      "stayTimeSession": 54.5346,
      "visitDepth": 1.9735
    }
  ],
  "errMsg": "openapi.analysis.getWeeklyVisitTrend:ok"
}