Graphical and text analysis data interface
Graphic and text analysis data interface
WeChat public platform launched an invitation-only internal test of the data interface on January 6, 2015. 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 image and text analysis data interface belongs to the group sending and notification permissions.
The time to open the data interface to all public account developers will be notified separately.
Please note:
1、接口侧的公众号数据的数据库中仅存储了2014年12月1日之后的数据,将查询不到在此之前的日期,即使有查到,也是不可信的脏数据; 2、请开发者在调用接口获取数据后,将数据保存在自身数据库中,即加快下次用户的访问速度,也降低了微信侧接口调用的不必要损耗。 3、额外注意,获取图文群发每日数据接口的结果中,只有中间页阅读人数+原文页阅读人数+分享转发人数+分享转发次数+收藏次数 >=3的结果才会得到统计,过小的阅读量的图文消息无法统计。
The graphic analysis data interface refers to the interface used to obtain graphic analysis data in the data statistics module of the official website of the public platform. The specific interface list is as follows:
Interface name | Maximum time span | Interface calling address (must use https) |
---|---|---|
Get Daily data for graphic group sending (getarticlesummary) | 1 | https://api.weixin.qq.com/datacube/getarticlesummary?access_token=ACCESS_TOKEN |
Get the total data of group text and graphics (getarticletotal) | 1 | https://api.weixin.qq.com/datacube/getarticletotal?access_token=ACCESS_TOKEN |
Get graphic and text statistical data (getuserread) | 3 | https://api.weixin.qq.com/datacube/getuserread?access_token=ACCESS_TOKEN |
Get graphic and text statistical time-sharing data (getuserreadhour) | 1 | https://api.weixin.qq.com/datacube/getuserreadhour?access_token=ACCESS_TOKEN |
Get image and text sharing forwarding data (getusershare) | 7 | https://api.weixin.qq.com/datacube/getusershare? access_token=ACCESS_TOKEN |
Get image and text sharing and forwarding time-sharing data (getusersharehour) | 1 | https://api.weixin.qq.com/datacube/getusersharehour?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
Graphic and text analysis data interface (including all interfaces in the interface list) needs to call the corresponding interface address and POST the following sample data packet :
{ "begin_date": "2014-12-08", "end_date": "2014-12-08" }
Call parameter description
Parameter | Is it required | Description |
---|---|---|
access_token | Yes | Call 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 returned JSON data packet of the daily data interface for obtaining image and text mass sending is as follows:
{ "list": [ { "ref_date": "2014-12-08", "msgid": "10000050_1", "title": "12月27日 DiLi日报", "int_page_read_user": 23676, "int_page_read_count": 25615, "ori_page_read_user": 29, "ori_page_read_count": 34, "share_user": 122, "share_count": 994, "add_to_fav_user": 1, "add_to_fav_count": 3 } //后续会列出该日期内所有被阅读过的文章(仅包括群发的文章)在当天的阅读次数等数据 ] }
Under normal circumstances, obtaining images and texts The JSON data packet returned by the group total data interface is as follows (please note that in details, the value corresponding to each day is the total volume of articles up to that day (not the volume on that day)). Additional attention should be paid to the difference between getting the daily data of graphic and text mass distribution (getarticlesummary) and getting the total data of graphic and text mass distribution (getarticletotal) as follows:
1、前者获取的是某天所有被阅读过的文章(仅包括群发的文章)在当天的阅读次数等数据。 2、后者获取的是,某天群发的文章,从群发日起到接口调用日(但最多统计发表日后7天数据),每天的到当天的总等数据。例如某篇文章是12月1日发出的,发出后在1日、2日、3日的阅读次数分别为1万,则getarticletotal获取到的数据为,距发出到12月1日24时的总阅读量为1万,距发出到12月2日24时的总阅读量为2万,距发出到12月1日24时的总阅读量为3万。
{ "list": [ { "ref_date": "2014-12-14", "msgid": "202457380_1", "title": "马航丢画记", "details": [ { "stat_date": "2014-12-14", "target_user": 261917, "int_page_read_user": 23676, "int_page_read_count": 25615, "ori_page_read_user": 29, "ori_page_read_count": 34, "share_user": 122, "share_count": 994, "add_to_fav_user": 1, "add_to_fav_count": 3, "int_page_from_session_read_user": 657283, "int_page_from_session_read_count": 753486, "int_page_from_hist_msg_read_user": 1669, "int_page_from_hist_msg_read_count": 1920, "int_page_from_feed_read_user": 367308, "int_page_from_feed_read_count": 433422, "int_page_from_friends_read_user": 15428, "int_page_from_friends_read_count": 19645, "int_page_from_other_read_user": 477, "int_page_from_other_read_count": 703, "feed_share_from_session_user": 63925, "feed_share_from_session_cnt": 66489, "feed_share_from_feed_user": 18249, "feed_share_from_feed_cnt": 19319, "feed_share_from_other_user": 731, "feed_share_from_other_cnt": 775 }, //后续还会列出所有stat_date符合“ref_date(群发的日期)到接口调用日期”(但最多只统计7天)的数据 ] }, //后续还有ref_date(群发的日期)在begin_date和end_date之间的群发文章的数据 ] }
Under normal circumstances, the interface for obtaining graphic and text statistical data The returned JSON data packet is as follows:
{ "list": [ { "ref_date": "2014-12-07", "int_page_read_user": 45524, "int_page_read_count": 48796, "ori_page_read_user": 11, "ori_page_read_count": 35, "share_user": 11, "share_count": 276, "add_to_fav_user": 5, "add_to_fav_count": 15 }, //后续还有ref_date在begin_date和end_date之间的数据 ] }
Under normal circumstances, the returned JSON data packet of the interface for obtaining graphic and text statistical time-sharing data is as follows:
{ { "list": [ { "ref_date": "2015-07-14", "ref_hour": 0, "user_source": 0, "int_page_read_user": 6391, "int_page_read_count": 7836, "ori_page_read_user": 375, "ori_page_read_count": 440, "share_user": 2, "share_count": 2, "add_to_fav_user": 0, "add_to_fav_count": 0 }, { "ref_date": "2015-07-14", "ref_hour": 0, "user_source": 1, "int_page_read_user": 1, "int_page_read_count": 1, "ori_page_read_user": 0, "ori_page_read_count": 0, "share_user": 0, "share_count": 0, "add_to_fav_user": 0, "add_to_fav_count": 0 }, { "ref_date": "2015-07-14", "ref_hour": 0, "user_source": 2, "int_page_read_user": 3, "int_page_read_count": 3, "ori_page_read_user": 0, "ori_page_read_count": 0, "share_user": 0, "share_count": 0, "add_to_fav_user": 0, "add_to_fav_count": 0 }, { "ref_date": "2015-07-14", "ref_hour": 0, "user_source": 4, "int_page_read_user": 42, "int_page_read_count": 100, "ori_page_read_user": 0, "ori_page_read_count": 0, "share_user": 0, "share_count": 0, "add_to_fav_user": 0, "add_to_fav_count": 0 } //后续还有ref_hour逐渐增大,以列举1天24小时的数据 ] }
Under normal circumstances, the returned graphic and text sharing forwarding data is obtained The return JSON data packet of the interface is as follows:
{ "list": [ { "ref_date": "2014-12-07", "share_scene": 1, "share_count": 207, "share_user": 11 }, { "ref_date": "2014-12-07", "share_scene": 5, "share_count": 23, "share_user": 11 } //后续还有不同share_scene(分享场景)的数据,以及ref_date在begin_date和end_date之间的数据 ] }
Under normal circumstances, the return JSON data packet of the interface for obtaining image and text sharing and forwarding daily data is as follows:
{ "list": [ { "ref_date": "2014-12-07", "ref_hour": 1200, "share_scene": 1, "share_count": 72, "share_user": 4 } //后续还有不同share_scene的数据,以及ref_hour逐渐增大的数据。由于最大时间跨度为1,所以ref_date此处固定 ] }
Return parameter description
Parameters | Description |
---|---|
ref_date | The date of the data must be between begin_date and end_date |
ref_hour | The hour of data, including from 000 to 2300, represents [000,100) to [2300,2400) respectively, that is, the first hour of each day And the date of the last hour |
stat_date | In the getarticletotal interface, ref_date refers to the date the article group was issued, and stat_date is the data statistics date |
msgid | Please note: the msgid here is actually composed of msgid (image and text message id, which is the msg_data_id returned after the group sending interface is called) and index (message sequence index) ), such as 12003_3, where 12003 is msgid, which is the id of a message sent in a group; 3 is index. Assume that the group message contains 5 articles (because there may be multiple pictures and texts), and 3 represents one of the 5 articles. The title of the third |
title | graphic message |
int_page_read_user | graphic page ( The number of readers of the page that clicks on the group text card to enter) |
int_page_read_count | The number of reads of the graphic page |
ori_page_read_user | The number of readers of the original text page (the page entered by clicking "Read Original Text" on the picture and text page). If there is no original text page, the data here is 0 |
ori_page_read_count | The number of reads of the original page |
share_scene | Shared scene 1 represents forwarding by friends 2 represents friends Circle 3 represents Tencent Weibo 255 represents the number of people shared by other |
share_user | |
share_count | Number of shares |
add_to_fav_user | Number of people who have collected |
add_to_fav_count | Number of collections |
Get detailed field explanations in the total data interface for image and text mass sending | intpagefromsessionreaduser Number of public account session readers |
target_user | The number of recipients is generally approximately equal to the total number of fans (fans who cannot receive messages due to blacklists or other abnormal circumstances need to be excluded) |
user_source | This field is only available when obtaining image and text reading time-sharing data, and represents where the user enters to read the image and text. 0: Conversation; 1. Friends; 2. Moments; 3. Tencent Weibo; 4. Historical message page; 5. Others |
WeChat will return an error code when there is an error For information such as specific error codes, please see: Global Return Code Description