# Dxplaination of the ad data analysis interface

Open data interfaces to all Service Account, Weixin Mini Program, MiniGame developers who become traffic masters.Through the data interface, developers can access data similar to, but more flexible, statistical modules on the public platform's official website, and can perform advanced processing as needed.

Please note:

  1. The interface-side database only stores data after January 1, 2016, and previous data will not be retrieved, and even if it is found, it will be untrusted and dirty;

  2. It is recommended that developers save the data in their own databases after calling the interface to obtain the data, to maximize the efficiency of access and also to reduce unnecessary losses from the WeChat side interface calls.

  3. Due to the large amount of data, all interfaces take a page-by-page approach, with a maximum page acquisition of 90.(eg: total_num is 100, then when page = 1, page_size = 10, the first 10 entries are returned;)Page = 1, page_size = 20, then the first 20 entries are returned;Page = 2, page_size = 10, then return articles 11 to 20)

  4. Instructions for changing the ad space enumeration value

    • Since multiple interfaces use ad space parameters, to ensure consistency of the experience and readability of the parameters,We made some changes so that all the interfaces support the ad-slot type name (ad_slot) and passing parameters, adding this name to represent the relevant meaning when repackaging.The previous parameter slot_id can also be used and passed back. Specifically:
Ad_slot type name (ad_slot) Types of ad space
SLOT_ID_BIZ_BOTTOM Service Account Bottom Ads
SLOT_ID_BIZ_MID_CONTEXT Service Account Advertisement in text
SLOT_ID_BIZ_VIDEO_END Service Account Video post
SLOT_ID_BIZ_SPONSOR Service Account Alternative advertising
SLOT_ID_BIZ_CPS Service Account Rebate Goods
SLOT_ID_WEAPP_BANNER Weixin Mini Program banner
SLOT_ID_WEAPP_REWARD_VIDEO Weixin Mini Program Motivational Video
SLOT_ID_WEAPP_INTERSTITIAL Weixin Mini Program Plug-in advertising
SLOT_ID_WEAPP_VIDEO_FEEDS Weixin Mini Program Video advertising
SLOT_ID_WEAPP_VIDEO_BEGIN Weixin Mini Program Video pre-post
SLOT_ID_WEAPP_BOX Weixin Mini Program Plaid advertising



# Interface Overview

The ad data analysis interface is currently available to obtain some of the ad data shown on the Public Platform → Traffic Owners → Data Statistics page and some of the revenue data shown in the Public Platform > Traffic owners → Financial Management page. The list of interfaces associated with Service Account is as follows:

Interface Name use Maximum time span Interface call address (must use https)
publisher_adpos_general Get Service Account Classified Advertising Data 90 days https://api.weixin.qq.com/publisher/stat?action=publisher_adpos_general&access_token=ACCESS_TOKEN
publisher_cps_general Get Service Account Rebate Product Data 60 days https://api.weixin.qq.com/publisher/stat?action=publisher_cps_general&access_token=ACCESS_TOKEN
publisher_settlement Get Service Account settlement income data and settlement entity information nothing https://api.weixin.qq.com/publisher/stat?action=publisher_settlement&access_token=ACCESS_TOKEN



# Dxplaination of Interface Call Request

# 1. Get Service Account Subdivision advertising data (publisher_adpos_general)

You need to add the following GET request parameters to the appropriate interface call address:

parameter Do I have to? Introductions
page yes Back to the next few pages of data
page_size yes When the page returns the number of data entries
start_date yes Get the start time of the data yyyy-mm-dd
end_date yes Get the end time of the data yyyy-mm-dd
ad_slot no Ad space type name

Note: If you do not pass the advertising type name, the default will return data for all types of advertising (except for rebate commercial advertising).



Returns parameter explaination (publisher_adpos_general)

parameter Introductions
err_msg Return an error message
ret Error code
list: slot_id Type ID
list: ad_slot Ad space type name
list: date date
list: req_succ_count Pullout amount
list: exposure_count Exposures
list: exposure_rate Exposure
list: click_count Clicks
list: click_rate click-through rate
list: income Income (in percentages)
list: ecpm Ad's 1,000 exposure gains (in points)
summary: req_succ_count Total pullout
summary: exposure_count Total Exposure
summary: exposure_rate Total Exposure
summary: click_count Total hits
summary: click_rate Total click rate
summary: income Total income (in percentages)
summary: ecpm Ad's 1,000 exposure gains (in points)
total_num List returns the total number of bars



Return packet example (publisher_adpos_general)

{
    "base_resp":{
        "err_msg":"ok",
        "ret":0
    },
    "list":[
        {
            "slot_id":3030046789020061,
            "ad_slot":"SLOT_ID_WEAPP_INTERSTITIAL",
            "date":"2020-04-13",
            "req_succ_count":443610,
            "exposure_count":181814,
            "exposure_rate":0.409850995,
            "click_count":10095,
            "click_rate":0.055523777,
            "income":52175,
            "ecpm":286.969100289
        }
    ],
    "summary":{
        "req_succ_count":4406394,
        "exposure_count":1797225,
        "exposure_rate":0.407867522,
        "click_count":100167,
        "click_rate":0.055734257,
        "income":578003,
        "ecpm":321.608591022
    },
    "total_num":1
}



# II. Get Service Account Rebate Product Data (publisher_cps_general)

You need to add the following GET request parameters to the appropriate interface call address:

parameter Do I have to? Introductions
page yes Back to the next few pages of data
page_size yes When the page returns the number of data entries
start_date yes Get the start time of the data yyyy-mm-dd
end_date yes Get the end time of the data yyyy-mm-dd

Please note: Rebate commercial advertising does not need to pass advertising parameters.



Returns a parameter explaination (publisher_cps_general)

parameter Introductions
err_msg Return an error message
ret Error code
list: date date
list: exposure_count Exposures
list: click_count Clicks
list: click_rate click-through rate
list: order_count Order volume
list: order_rate Order placement rate
list: total_fee Order Amount (in percentages)
list: total_commission Estimated revenue (in percentages)
summary: exposure_count Total Exposure
summary: click_count Total hits
summary: click_rate Total click rate
summary: order_count Total order volume
summary: order_rate Total placing rate
summary: total_fee Total Amount of Order (in percentages)
summary: total_commission Total estimated income (in percentages)
total_num Request to return the total number of items



Return packet example (publisher_cps_general)

{
    "base_resp":{
        "err_msg":"ok",
        "ret":0
    },
    "list":[
        {
            "date":"20XX-XX-XX",
            "exposure_count":15153,
            "click_count":396,
            "click_rate":38.265151515,
            "order_count":3,
            "order_rate":0.007575758,
            "total_fee":162900,
            "total_commission":25021
        }
    ],
    "summary":{
        "exposure_count":117143,
        "click_count":3442,
        "click_rate":34.033410808,
        "order_count":18,
        "order_rate":0.005229518,
        "total_fee":924082,
        "total_commission":133030
    },
    "total_num":7
}



# III. Obtaining Service Account settlement income data and settlement entity information (publisher_settlement)

You need to add the following GET request parameters to the appropriate interface call address:

parameter Do I have to? Introductions
page yes Number of pages returned from data
page_size yes Return number of data entries per page
start_date yes Get the start time of the data yyyy-mm-dd
end_date yes Get the end time of the data yyyy-mm-dd

Please note: As long as it coincides with the start and end of the data obtained, the data corresponding to the settlement interval will be returned.For example, a request for data from 11 February to 26 March would return data from the four clearing areas for the first half of February, the second half of January, and the first half and second half of March.



Returns parameter explaination (publisher_settlement)

parameter Introductions
err_msg Return an error message
ret Error code
body Subject Name
revenue_all Cumulative income
penalty_all Amount of deduction
settled_revenue_all Amounts settled
settlement_list: date Time of data update
settlement_list: zone Date Interval
settlement_list: month Income Month
settlement_list: order 1 = first month, 2 = second month
settlement_list: sett_status 1 = In settlement;2 and 3 = settled;4 = In payment; 5 = Payment has been made
settlement_list: settled_revenue Income settled within the range
settlement_list: sett_no Statement of Payment Number
settlement_list: mail_send_cnt Number of requests for replacement bills of settlement
settlement_list: slot_revenue: slot_id Ad space that generates revenue
settlement_list: slot_revenue: slot_settled_revenue The amount settled for this ad space
total_num Request to return the total number of items



Return packet example (publisher_settlement)

{
    "base_resp":{
        "err_msg":"ok",
        "ret":0
    },
    "body":"深圳市腾讯计算机系统有限公司",
    "penalty_all":0,
    "revenue_all":5178368698,
    "settled_revenue_all":2613696765,
    "settlement_list":[
        {
            "date":"2020-03-25",
            "zone":"2020年3月1日至15日"
            "month":"202003",
            "order":1,
            "sett_status":1,
            "settled_revenue":718926045,
            "sett_no":"XXX",
            "mail_send_cnt":"0",
            "slot_revenue":[
                {
                    "slot_id":"SLOT_ID_WEAPP_BANNER",
                    "slot_settled_revenue":34139443
                },
                {
                    "slot_id":"SLOT_ID_WEAPP_REWARD_VIDEO",
                    "slot_settled_revenue":684786602
                }
            ]
        }
    ],
    "total_num":1
}



# Error code explaination

Error code returns values meaning
45009 The request is too frequent. Please try again later
45010 An invalid interface name
1701 Parameter Error
2009 An invalid traffic master