Development Document

Origin Error Ratio Download PDF Document

Endpoint

Request URL: stat/originErrRatio (GET)

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

Endpoint Description

Use this API to retrieve origin error rate, such as 4xx rate and 5xx rate.

Notice: The data granularity is 1-minute. Each request is limited to a 1-day range. The call frequency information can be found in the response headers.

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/originErrRatio?token=xxx&domain=aa.qingcdn.com&start_time=2017-11-02%2000:00&end_time=2017-11-03%2000:10"

Sample Response

Json format.

{
    "code": 0,//code 0 means success
    "data": [
        [
            1509552000,//Timestamp
            {
                "4xx": 0.0038,//4xx error rate(404,401,403 etc.)
                "5xx": 0//5xx error rate

            }
        ],
        [
            1509552060,
            {
                "4xx": 0.0032,
                "5xx": 0
            }
        ],
        [
            1509552120,
            {
                "4xx": 0.0033,
                "5xx": 0
            }
        ],
        ...
    ]
}

Response Header

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