Data statistics interface - interface analysis data interface

Data statistics interface - interface analysis data interface

WeChat public platform launched an invitation-based internal test of the data interface on January 6, 2015. Through the data interface, developers can obtain data similar to the statistical module of the official WeChat public platform website but more flexible, and can also perform advanced processing as needed.

During the invitation internal test, in order to ensure service quality, the data interface is only open to third-party platform developers. You can become a third-party platform developer by accessing the WeChat Open Platform and authorizing the public account login. The third-party platform can help operators manage public accounts and help authorized public accounts call data interfaces. In the permission set division of the public account login authorization mechanism, the interface analysis data interface belongs to the account management permission set.

The time for opening the data interface to all public account developers will be notified separately.

Please note:

1. The database of the public account data on the interface side only stores data after December 1, 2014. Data before that date cannot be queried. Even if data is found, it is unreliable and dirty data.
2. After calling the interface to obtain data, developers should save the data in their own database, which will speed up the next user's access and reduce unnecessary losses in calling the interface on the WeChat side.

The interface analysis data interface refers to the interface used to obtain the interface analysis data in the data statistics module of the official website of the public platform. The specific interface list includes the following:

Interface Name ***Time span Interface call address (must use https)
Get interface analysis data (getinterfacesummary) 30 https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=ACCESS_TOKEN
Get interface analysis hourly data (getinterfacesummaryhour) 1 https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token=ACCESS_TOKEN

***Time span refers to the time range in which data can be obtained when an API is called. For example, ***Time span of 7 means that a maximum of 7 days of data can be obtained at one time. The actual value of access_token can be obtained through "Get access_token".


Interface call request description

The interface analysis data interface (including all interfaces in the interface list) needs to POST the following sample data packet to the corresponding interface call address:

  1. {
  2. "begin_date": "2014-12-07",
  3. "end_date": "2014-12-07"
  4. }

Call parameter description

parameter Is it necessary illustrate
access_token yes Call interface credentials
begin_date yes Get the starting date of the data. The difference between begin_date and end_date must be less than the "*** time span" (for example, when the *** time span is 1, the difference between begin_date and end_date can only be 0 to be less than 1), otherwise an error will be reported.
end_date yes Get the end date of the data. The maximum value that end_date can be set to is yesterday.

Return Description

Under normal circumstances, the return JSON data packet of the interface for obtaining interface analysis data is as follows:

  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-07",
  5. "callback_count": 36974,
  6. "fail_count": 67,
  7. "total_time_cost": 14994291,
  8. "max_time_cost": 5044
  9. }
  10. //There will be data with different ref_date (between begin_date and end_date) later
  11. ]
  12. }

Under normal circumstances, the return JSON data packet of the interface for obtaining the time-sharing data analysis interface is as follows:

  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-01",
  5. "ref_hour": 0,
  6. "callback_count": 331,
  7. "fail_count": 18,
  8. "total_time_cost": 167870,
  9. "max_time_cost": 5042
  10. }
  11. //There will be data with different ref_hours later
  12. ]
  13. }

Return parameter description

parameter illustrate
ref_date Date of data
ref_hour Data hour
callback_count The number of times the user's message is passively replied to after receiving the message through the server configuration address
fail_count Number of failures of the above action
total_time_cost The total time consumed is divided by callback_count to get the average time consumed.
max_time_cost ***time consuming

WeChat will return error codes and other information when an error occurs. For specific error code queries, please see: Global Return Code Description

<<:  Data statistics interface-message analysis data interface

>>:  WeChat JS-SDK Description (1)

Recommend

iOS 16.2 finally supports 120Hz high refresh rate!

​The day before yesterday, Apple pushed the iOS 1...

Who is the king of volcanoes in China?

January 15, 2022 Tonga, a South Pacific island na...

Toutiao | Advertising Optimization Guide (Practical)

As one of the mainstream forms of mobile Internet...

What are the ways to promote Xiaohongshu?

When it comes to Xiaohongshu’s promotion methods,...

Why does lactose intolerance not affect drinking yogurt?

Calcium is an important nutrient that is indispen...

Apple releases first developer preview of iOS 11.4 beta

Not long ago, Apple officially pushed out iOS 11....

How much does it cost to develop a dance school mini program in Linyi?

The factors that affect the quotation of Linyi Da...