Development Document

Per-Domain Page View Count Download PDF Document

Endpoint

Request URL: stat/pv/eachDomain (GET)

Endpoint Domain Name: cdn.api.baishan.com
Endpoint Version: v2

Endpoint Description

Per domain name receive PV(Page View).

Notice: Currently PV statistics only count codes 1xx 2xx and 304 and Content-Type: "text/html", "text/asp", "text/plain"

API Parameters

Notice: Please request the API token from your account team.

Request Parameters (GET)

Add request parameters to the URL query strings, i.e. ?key1=value1&key2=value2.

ParameterData TypeRequirementDescription
domainsstringRequiredDomain names. Separate domain names by a comma (,). Up to 10 domain names at a time. all means all domains names, For example, aa.qingcdn.com,bb.qingcdn.com
start_timestringRequiredStart time in the format of YYYY-mm-dd or YYYY- mm-dd HH:ii. For example, 2017-04-26 retrieves bandwidth/traffic data starting at 2017-04-26 00:00.
end_timestringRequiredEnd time in the format of YYYY-mm-dd or YYYY- mm-dd HH:ii. For example, 2017-04-26 retrieves bandwidth/traffic data ending at 2017-04-26 23:59. The end time has to be greater than start time but must be within the range of 31 days.
gradstringNot RequiredGranularity of the data. minute5 by default. The options are minute5 (5 minutes), hour, or day.
stat_is_forwardintNot Required0 (default): pointing backward, for example, 2016- 03-16 10:00 means [2016-03-16 10:00, 2016-03- 16 10:04]. 1: pointing forward, for example, 2016-03-16 10:05 means [2016-03-16 10:00, 2016-03-16 10:04].

Sample Request:

curl -X GET
"https://cdn.api.baishan.com/v2/stat/pv/eachDomain?token={token}&domains=aa.qingcdn.com,bb.qingcdn.com&start_time=2017-07-19&end_time=2017-07-19"

Sample Response

Json format.

{
    "code": 0,
    "data": {
        "aa.qingcdn.com": {
            "domain": "aa.qingcdn.com",
            "data": [
                [
                    1500393600,//Time stamp, minute5 granularity
                    10 //Request numbers
                ],
                [
                    1500393900,
                    22
                ],
                [
                    1500394200,
                    12
                ],
                [
                    1500479400,
                    19
                ]
            ]
        }
    }
}

Response Header

HTTP/1.0 200 OK
Api-Id:                272604011
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute
X-Ratelimit-Limit:     150 //150 requests (calls) per minute maximum
X-Ratelimit-Remaining: 150 //150 calls left for the current minute
X-Retry-After:         16 //the rate limit resets in 16 seconds
 
 

HTTP Status Codes

Error CodeDescription
404Bad request URLs.
401Authorization Error: Invalid token or lack of access.
400Bad request parameters.
200Success.
5xxPlease contact your account team.
CopyRight © 2015-2022 BaishanCloud . All Rights Reserved.