Development Document

HTTP Status Code Statistics Download PDF Document

Endpoint

Request URL: stat/httpcode (GET)

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

Endpoint Description

Use this API to retrieve status code metrics of one multiple host names. When multiple host names are queried together, the sum will be returned.

Notice: The API gateway limits a single request to no more than one scalar value: Number of domain names * Number of data points per day * Number of days <= 2880, greater than this value will prompt: Single request exceed limit.

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.

Sample Request:

curl -X GET 'https://cdn.api.baishan.com/v2/stat/httpcode?token=xxx&domains=test1.qingcdn.com,test2.qingcdn.com&start_time=2017-10-12 13:00&end_time=2017-10-12 13:20'

Sample Response

Json format.

{
    "code": 0, //Code 0 means success
    "data": [
        [
            1507784400,
            {
                "0": 2,
                "200": 860,
                "302": 72,
                "304": 1,
                "403": 1217
            }
        ],
        [
            1507784700,
            {
                "200": 252,
                "301": 4,
                "302": 66,
                "304": 33,
                "403": 10,
                "404": 3
            }
        ],
        [
            1507785000,
            {
                "0": 25,
                "200": 608,
                "302": 85,
                "304": 80,
                "404": 4
            }
        ],
        [
            1507785300,
            {
                "0": 2,
                "200": 693,
                "302": 111,
                "304": 2,
                "404": 69
            }
        ],
        [
            1507785600,
            {
                "0": 2,
                "200": 762,
                "301": 4,
                "302": 133,
                "304": 90,
                "404": 113
            }
        ]
    ]
}
响

Response Header

HTTP/1.0 200 OK
Api-Id:                14426827
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute  //Unit of the request number limit
X-Ratelimit-Limit:     150  // 150 requests (calls) per minutes maximum
X-Ratelimit-Remaining: 10   //10 calls left for the current minute
X-Retry-After:         20  //the rate limit resets in 20 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.