Documentation API Docs StatusCode Report QueryStatusCodeDistribution

QueryStatusCodeDistribution

Update time: 2026-07-13 15:50:13

Applicable Products

universal

API Description

This interface is used to count the edge status code data of multiple domain names. Users can select the query time range and domain name list to obtain data. The returned content includes the status code distribution of each domain name and its corresponding number of requests. It helps users analyze the domain name access status and optimize content distribution strategies.

Call frequency

Single user trigger frequency: 300/5min

Request parameter(s)

Body Params

JSON
NameDescription
*dateFromString
Start time: 1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM; 2.Must be a time that is 183 days earlier than the current time, and the time must be earlier than the current time and dateTo; 3.Period between dataFrom and dateTo cannot be longer than 7 days(technical support can be contacted to adjust); 4.dateFrom and dateTo can be either both are specified or neither is specifies; 5.If neither dateFrom nor dateTo is specified, then by default, data in the last 24 hour is queried
*dateToString
End time: 1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM; 2.Must be greater than dateFrom; if it's greater than the current time, then the current time is assigned as the value;
*domainList
Domain names: 1.Domain number limits can be adjusted depending on different accounts. The default value is 20 2.Query all domain names under account when this entry is not passed
*dataIntervalString
Data granularity, 5m: granularity of 5 minutes
*groupByList
Group dimension 1.The value can be selected is domain; 2.The data is displayed according to the specified dimension;
*dataPaddingBoolean
1.If 0 is added, the value is true or false, which is false by default 2.When the value of data adding is true, data is added to time points without data 3.When the dataPadding value is false, no treatment will be done
*queryByString
Query dimension. Optional values: statusCode, statusCodeType. Default value is statuscode. 1.statusCode: returns the status code details; 2.statusCodeType: returns the requests of eachstatus code type (such as the number of requests corresponding to success, redirect, not modified, permission, not found, server error, and other)

Response parameter(s)

Body Params

JSON
NameDescription
resultList
result
domainString
Domain
statusCodeDataList
statusCodeData
statusCodeString
Status code
totalRequestString
totalRequest
statusCodeTypeString
Success, Redirect, Not-Modified, Permission, Not-Found, Server Error, Other
requestDataList
requestData
timestampString
DateTime, the format is yyyy-MM-dd HH:mm; the data value of every time slice represents the data value within the previous time granularity range.
valueString
Number of requests for status codes

Error code

Error code(code)Description(message)HTTP statusSemantic
MissingBodyRequest body has not specified400Request body has not specified
NotAcceptableAccept as request header is not   supported, as interface only supports json and xml formats, with json as the   default format400Accept as request header is not   supported, as interface only supports json and xml formats, with json as the   default format
InvalidHTTPRequestIncorrect format of request body400Incorrect format of request body
InvalidDatePerioddataFrom or dateTo not compliant   to specifications400dataFrom or dateTo not compliant   to specifications
DateSpanErrorPeriod between dataFrom and   dateTo is longer than 7 days400Period between dataFrom and   dateTo is longer than 7 days
PARAM_INVALIDParameter groupBy not compliant   to specifications400Parameter groupBy not compliant   to specifications
NumberLimitExceededNumber of specified domains   exceed upper limit400Number of specified domains   exceed upper limit
InternalErrorSystem has encountered an error500System has encountered an error
PARAM_INVALIDparam: domain is null or invalid.400param: domain is null or invalid.
PARAM_INVALIDparam: dataInterval is null or invalid.400param: dataInterval is null or invalid.
PARAM_INVALIDparam: dataPadding is null or invalid.400param: dataPadding is null or invalid.

Example

JSON
JSON
Request example
Copy Copy success
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.atomile.com/api/report/status-code" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{"dateFrom": "2019-01-01T23:55:00+00:00","dateTo": "2019-01-02T00:10:00+00:00","domain": ["www.111.com","www.222.com"],"dataInterval": "5m","groupBy": ["domain"],"dataPadding":true,"queryBy":"statusCode"
}'
Response example
Copy Copy success
{
    "result":[
        {
            "domain":"www.111.com",
            "statusCodeData":[
                {
                    "statusCode":"200",
                    "totalRequest":"1332",
                    "requestData":[
                        {
                            "timestamp":"2019-01-01 00:05",
                            "value":"844"
                        },
                        {
                            "timestamp":"2019-01-02 00:00",
                            "value":"0"
                        },
                        {
                            "timestamp":"2019-01-02 00:05",
                            "value":"10"
                        },
                        {
                            "timestamp":"2019-01-02 00:10",
                            "value":"200"
                        }
                    ]
                },
                {
                    "statusCode":"400",
                    "totalRequest":"1332",
                    "requestData":[
                        {
                            "timestamp":"2019-01-01 00:05",
                            "value":"641"
                        },
                        {
                            "timestamp":"2019-01-02 00:00",
                            "value":"0"
                        },
                        {
                            "timestamp":"2019-01-02 00:05",
                            "value":"140"
                        },
                        {
                            "timestamp":"2019-01-02 00:10",
                            "value":"200"
                        }
                    ]
                }
            ]
        },
        {
            "domain":"www.222.com",
            "statusCodeData":[
                {
                    "statusCode":"200",
                    "totalRequest":"1332",
                    "requestData":[
                        {
                            "timestamp":"2019-01-01 00:05",
                            "value":"785"
                        },
						{
                            "timestamp":"2019-01-02 00:00",
                            "value":"0"
                        },
                        {
                            "timestamp":"2019-01-02 00:05",
                            "value":"230"
                        },
                        {
                            "timestamp":"2019-01-02 00:10",
                            "value":"200"
                        }
                    ]
                }
            ]
        }
    ]
}