Interface analysis data interface


Interface analysis data interface

1474943553927450.jpg


# WeChat public platform was launched on January 6, 2015 The data interface is invited for internal testing. Through the data interface, developers can obtain similar but more flexible data to the statistics module of the official website of the public platform, and can also perform advanced processing as needed.

In the permission set division of the official account login authorization mechanism, the interface analysis data interface belongs to the account service permissions.

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

Please note:

1、接口侧的公众号数据的数据库中仅存储了2014年12月1日之后的数据,将查询不到在此之前的日期,即使有查到,也是不可信的脏数据;
2、请开发者在调用接口获取数据后,将数据保存在自身数据库中,即加快下次用户的访问速度,也降低了微信侧接口调用的不必要损耗。

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 (such as no user attribute data interface):

Interface nameMaximum time spanInterface calling address (must use https)
Get Interface analysis data (getinterfacesummary)30https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=ACCESS_TOKEN
Get interface analysis time-sharing data (getinterfacesummaryhour)1https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token=ACCESS_TOKEN

The maximum time span refers to the maximum time range that can obtain data when an interface is called. For example, the maximum time span is 7, which means that up to 7 days of data can be obtained at one time. Please obtain the actual value of access_token through "Get access_token".


Interface call request description

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:

{ 
    "begin_date": "2014-12-07", 
    "end_date": "2014-12-07"
}

Call parameter description

ParameterIs it requiredDescription
access_tokenYesCall interface credentials
begin_date is the starting date for to obtain data. The difference between begin_date and end_date must be less than "maximum "Time span" (for example, when the maximum 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 It is the end date of to obtain data. The maximum value allowed for end_date is yesterday

Return instructions

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

{ 
   "list": [ 
       { 
           "ref_date": "2014-12-07", 
           "callback_count": 36974, 
           "fail_count": 67, 
           "total_time_cost": 14994291, 
           "max_time_cost": 5044
       }
	//后续还有不同ref_date(在begin_date和end_date之间)的数据
   ]
}

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

{ 
   "list": [ 
       { 
           "ref_date": "2014-12-01", 
           "ref_hour": 0, 
           "callback_count": 331, 
           "fail_count": 18, 
           "total_time_cost": 167870, 
           "max_time_cost": 5042
       }
	//后续还有不同ref_hour的数据
   ]
}

Return parameter description

ParametersDescription
ref_dateThe date of the data
ref_hourHour of data
callback_countThe number of passive replies to user messages after obtaining the message through the server configuration address
fail_countThe number of failures of the above actions
total_time_costThe total time taken, divided by callback_count is the average Time-consuming
max_time_costMaximum time-consuming

In case of error, WeChat will return error code and other information, specific For error code query, please see: Global Return Code Description