Data statistics interface-message analysis data interface

Data statistics interface-message 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 beta 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 message analysis data interface belongs to the message and menu 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 message analysis data interface refers to the interface used to obtain the message analysis data in the data statistics module of the official website of the public platform. The specific interface list is as follows (there is no message keyword data interface):

Interface Name ***Time span Interface call address (must use https)
Get message sending profile data (getupstreammsg) 7 https://api.weixin.qq.com/datacube/getupstreammsg?access_token=ACCESS_TOKEN
Get message delivery hourly data (getupstreammsghour) 1 https://api.weixin.qq.com/datacube/getupstreammsghour?access_token=ACCESS_TOKEN
Get weekly message sending data (getupstreammsgweek) 30 https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token=ACCESS_TOKEN
Get the monthly data of message sending (getupstreammsgmonth) 30 https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token=ACCESS_TOKEN
Get message sending distribution data (getupstreammsgdist) 15 https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token=ACCESS_TOKEN
Get the weekly data of message distribution (getupstreammsgdistweek) 30 https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token=ACCESS_TOKEN
Get the monthly data of message distribution (getupstreammsgdistmonth) 30 https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?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".

Regarding weekly and monthly data, please note that the data of each monthly/weekly periodic data is marked on the last day of the month/week (the 1st of the month or Monday). You can only get the data of that period by calling the interface after a month/week. For example, on December 1, calling the monthly data acquisition interface with (November 1st-November 5th) as (begin_date and end_date) can get the monthly data of November 1st (i.e. the monthly data of November).

Interface call request description

The message 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-08"
}

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

To obtain the message sending profile data interface, you need to POST the following data packet to the corresponding interface call address:


  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-07",
  5. "msg_type": 1,
  6. "msg_user": 282,
  7. "msg_count": 817
  8. }
  9. // There will be data of different msg_type with the same ref_date, and data of different ref_date (within the time range) later.
  10. ]
  11. }

To obtain the message distribution time-sharing data interface, you need to POST the following data packet to the corresponding interface call address:

  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-07",
  5. "ref_hour": 0,
  6. "msg_type": 1,
  7. "msg_user": 9,
  8. "msg_count": 10
  9. }
  10. //There will be data of different msg_types in the same ref_hour and data of different ref_hours in the future. ref_date is fixed because the maximum time span is 1
  11. ]
  12. }
  13.  
  14. The JSON data packet returned by the interface for obtaining weekly data of message sending is as follows:
  15.  
  16. {
  17. "list": [
  18. {
  19. "ref_date": "2014-12-08",
  20. "msg_type": 1,
  21. "msg_user": 16,
  22. "msg_count": 27
  23. }
  24. //Subsequently, there will be data with different msg_type and different ref_date under the same ref_date
  25. ]
  26. }

The JSON data packet returned by the interface for obtaining monthly data of message sending is as follows:


  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-11-01",
  5. "msg_type": 1,
  6. "msg_user": 7989,
  7. "msg_count": 42206
  8. }
  9. //Subsequently, there will be data with different msg_type and different ref_date under the same ref_date
  10. ]
  11. }

The JSON data packet returned by the interface for getting message sending distribution data is as follows:


  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-07",
  5. "count_interval": 1,
  6. "msg_user": 246
  7. }
  8. //Subsequently, there will be data with different count_intervals under the same ref_date, and data with different ref_dates
  9. ]
  10. }

The JSON data packet returned by the interface for obtaining weekly data of message sending distribution is as follows:


  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-07",
  5. "count_interval": 1,
  6. "msg_user": 246
  7. }
  8. //Subsequently, there will be data with different count_intervals under the same ref_date, and data with different ref_dates
  9. ]
  10. }

The JSON data packet returned by the interface for obtaining the monthly data of message sending distribution is as follows:


  1. {
  2. "list": [
  3. {
  4. "ref_date": "2014-12-07",
  5. "count_interval": 1,
  6. "msg_user": 246
  7. }
  8. //Subsequently, there will be data with different count_intervals under the same ref_date, and data with different ref_dates
  9. ]
  10. }

Return parameter description

parameter illustrate
ref_date The date of the data must be between begin_date and end_date
ref_hour The hours of the data, from 000 to 2300, represent [000,100) to [2300,2400), i.e. the first and last hours of the day.
msg_type Message type, meanings are as follows:

1 represents text 2 represents picture 3 represents voice 4 represents video 6 represents third-party application message (link message)

msg_user The number of users who sent messages upstream (sent to the official account)
msg_count The total number of messages sent upstream
count_interval The interval of the number of messages sent on that day. 0 represents "0", 1 represents "1-5", 2 represents "6-10", and 3 represents "more than 10 times"
int_page_read_count Number of times the image and text page is read
ori_page_read_user Number of readers of the original page (the page entered by clicking "Read original text" on the graphic page). If there is no original page, the data here is 0

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-graphic and text analysis data interface

>>:  Data statistics interface - interface analysis data interface

Recommend

An event planning and execution form template

one Over the years of work, I have participated i...

How do jackets achieve both waterproofness and breathability?

In outdoor sports, as a high-performance protecti...

Short video operation topic selection guide

When operating short videos, topic selection, dir...

Born for massive film and television resources: TCL iQIYI TV+L48A71C review

Competition in the smart TV industry is becoming i...

E-commerce system, how to design a coupon system?

When it comes to e-commerce platforms, everyone k...

Tutorial: How to reduce the size of iOS app?

Q: How can I make my program installation package...

The deepest well in the world is 12,262 meters deep.

On Russia's Kola Peninsula, in the wilderness...

Android Pay announced, launching in Australia in 2016

[[159325]] On December 16, Google's mobile pa...