EdgeNext
Documentation home

EdgeNext Documentation

Product guides, setup instructions, and technical references.

CDN

Per-Domain Page View Count

API Endpoint

Request URL: stat/pv/eachDomain (GET)

API Request Domain: cdn.api.edgenext.com
API Version: v2

API Description

This API is used to query PV (Page View) statistics for multiple accelerated domains. The response returns PV (Page View) data for each accelerated domain separately.

Currently, only requests that meet the following conditions are counted:

  • HTTP status codes: 1xx, 2xx, and 304
  • Content-Type: "text/html", "text/asp", and "text/plain"

The default data aggregation interval is 5 minutes. The API request rate limit can be found in the response headers (Response Header).

Request Parameters

Common Parameters

The user's authentication token is required. Please contact the on-call support team to obtain a valid token.

GET Request Parameters

Request parameters should be added to the query string of the URL.

Example:

?key1=value1&key2=value2
Parameter Name Data Type Required Description
domains string Yes Specifies the accelerated domains to query. A maximum of 10 accelerated domains can be queried in a single request. Multiple accelerated domains should be separated by commas (,). When multiple accelerated domains are specified, the API returns PV (Page View) statistics for each accelerated domain separately.
start_time string Yes Specifies the start time of the query range. Format: YYYY-mm-dd or YYYY-mm-dd HH:ii Example: 2020-06-01 represents 2020-06-01 00:00:00 as the start time. The start time must not be later than the current time. The interval between start_time and end_time must not exceed 31 days.
end_time string Yes Specifies the end time of the query range. Format: YYYY-mm-dd or YYYY-mm-dd HH:ii Example: 2020-06-01 represents 2020-06-01 23:59:59 as the end time. The end time must be later than the start time. The interval between start_time and end_time must not exceed 31 days.
stat_is_forward string No Specifies the meaning of the query timestamp. 0: The timestamp points forward. For example, 2020-06-01 10:00 represents the interval [2020-06-01 10:00:00, 2020-06-01 10:04:59]. 1: The timestamp points backward. For example, 2020-06-01 10:05 represents the interval [2020-06-01 10:00:00, 2020-06-01 10:04:59]. If omitted, the default value is 0.
grad string No Specifies the data aggregation interval. minute5: 5-minute interval hour: Hourly interval day: Daily interval If omitted, the default value is minute5.
query_area string No Specifies the query scope. all: Query both domestic and overseas regions cn: Query domestic regions abroad: Query overseas regions If omitted, the default value is all.

Request Example

# The request URL must be URL encoded.

curl -X GET "https://cdn.api.edgenext.com/v2/stat/pv/eachDomain?token=xxx\
&domains=example.com\
&start_time=2020-06-01%2010:00\
&end_time=2020-06-01%2011:00"

Response Example

JSON format

Successful Response

{
    "code": 0, // code is 0 when the response is successful.
    "data": {
        "example.com": {
            "domain": "example.com",
            "data": [
                [
                    1500393600, // Timestamp, sorted in ascending order.
                    10 // Number of PV requests.
                ],
                [
                    1500393900,
                    22
                ],
                [
                    1500394200,
                    12
                ],
                [
                    1500479400,
                    19
                ]
            ]
        }
    }
}

Error Response

{
    "code": 400101,
    "message": "domain(life.com) is invalid"
}

Response Headers

Example:

HTTP/1.0 200 OK

Api-Id:                272604011
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute  // Rate limit granularity (minute/hour/day).
X-Ratelimit-Limit:     150     // Maximum number of requests allowed within the current rate limit period.
X-Ratelimit-Remaining: 150     // Remaining number of requests available within the current rate limit period.
X-Retry-After:         16      // Number of seconds until the current rate limit period is reset.

HTTP Status Code Description

HTTP Status Code Description
404 The requested URL is invalid.
401 Authentication failed. The token may be invalid.
400 Invalid request parameters.
200 Request completed successfully and the requested data is returned.
5xx Server-side error. Please contact the on-call support team.

Need help? Contact our support team at support@edgenext.com.

Back to documentation home