Followers Data API
Back

From WeChat Official Account Admin Platform
Jump to: navigation, search

Through these data APIs, developers can obtain data similar to but more flexible than data provided on the WeChat Official Account Admin Platform web site and then perform additional advanced processing as required.

The Data APIs are only available to developers with a certified official account.

Notes:

1. Official account data provided from the data APIs only includes data after December 1, 2014. Any data provided from  before this date will likely be inaccurate.
2. In order to speed up subsequent user access and reduce API calling time, we suggest developers store data obtained through API calls in their own databases.

Followers data APIs contain API calls used to obtain followers data from data statistical modules on the WeChat Official Account Admin Platform. The provided APIs are as follows (followers attribute data APIs are not yet available):

API Name Maximum Time Span API Calling URL (https Required)
Obtain followers increase/decrease data (getusersummary) 7 https://api.weixin.qq.com/datacube/getusersummary?access_token=ACCESS_TOKEN
Obtain accumulated followers data (getusercumulate) 7 https://api.weixin.qq.com/datacube/getusercumulate?access_token=ACCESS_TOKEN

The maximum time span indicates the maximum time range for obtaining data during one API calling event. For example, if the maximum time span is 7, data from up to 7 days can be obtained once. Please obtain the actual value of access_token through "Obtain access_token".

Request Description

Followers data APIs (including all APIs in the list) should use the HTTP POST method to send parameters to the corresponding API calling URL. A sample set of parameters is provided below:

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

Calling Parameter Description

Parameter Required Description
access_token Yes Access token providing authorization to the calling API
begin_date Yes Start date for queried data. The difference between begin_date and end_date should be less than the maximum time span (for example, if the maximum time span is 1, begin_date and end_date should be identical); otherwise, an error will be reported.
end_date Yes End date for queried data, yesterday’s date as the maximum possible value

Return Description

An example of a successful JSON response from the getusersummary API is provided below:

{ 
    "list": [ 
        { 
            "ref_date": "2014-12-07", 
            "user_source": 0, 
            "new_user": 0, 
            "cancel_user": 0
        }
	// Below would be data with ref_date being a value between begin_date and end_date
    ]
}

An example of a successful JSON response from the getusercumulate API is provided below:

{ 
    "list": [ 
        { 
            "ref_date": "2014-12-07", 
            "cumulate_user": 1217056
        }, 
	// Below would be data with ref_date being a value between begin_date and end_date
    ]
}

Return Parameter Description

Parameter Description
ref_date Date of the data
user_source Method by which followers were added:

0: other, 17: shared name card, 30: scanned QR code, 35: searched account name (searched on the Add Contacts screen), 39: queried official account, 43: top-right menu within webview

new_user Number of added followers
cancel_user Number of unfollows, new_user minus cancel_user is the net-increased number followers
cumulate_user Total number of followers

An error code will be returned upon failure. For details about error codes, please see Return Codes.

Developer Guide
Custom-defined Menu
WeChat JS-SDK