Web Application Firewall

GetTrafficByProtocol

更新時間: 2025-10-30 19:45:11

This API is used to query traffic data for multiple domains under a specified transmission protocol, covering data from all edge nodes. Users must specify parameters such as domain, start and end time, and transmission protocol, and can select data granularity and grouping dimensions. By default, the query returns HTTPS protocol traffic data, with output showing traffic values for each domain at different time points. This interface is suitable for scenarios requiring the query and analysis of multi-domain traffic across various transmission protocols.

  • データ遅延: 5~15min
  • 単一ユーザーの使用頻度: 300/5min
  • 使用できるプロダクト: Content Acceleration,Bot Shield,Dynamic Web Acceleration,Flood Shield,Media Acceleration Live Broadcast,Web Application Firewall,Media Acceleration,Media Acceleration-Live,Flood Shield 2.0
API認証の詳細については、以下を参照してください:API認証の概要

リクエストパラメータ

Body パラメータ

パラメータ名説明
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 no more than 183 days prior to the current time, and must be earlier than both the current time and `dateTo`. 3.The period between `dateFrom` and `dateTo` cannot exceed 7 days (contact technical support for adjustments). 4.Either both `dateFrom` and `dateTo` must be specified, or neither should be specified. 5.If neither dateFrom nor dateTo is specified, then by default, data for the last 24 hours 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. 3.If it is greater than the current time, it will be reset to the current time.
*domainList
Domain names. The number of allowed domains can be adjusted based on the account type, with a default limit of 20.
granularityString
デフォルト値:5m
選択可能な値:1m5m1h1d
**Data granularity** 1m: 1minute 5m: 5minutes 1h: 1hour 1d: 1day
protocolTypeString
デフォルト値:https
選択可能な値:httphttps
Transmission protocol: 1.Options: http, https. 2.If no value is specified, https is used as the default. 3.If http is queried, `httpFlowData` is displayed in the response; if https is queried, `httpsFlowData` is displayed.
groupByList
選択可能な値:domain
Group dimension: 1.Only 'domain' is a valid value. 2.If provided, detailed data will be displayed according to this dimension.

レスポンスパラメータ

Body パラメータ

パラメータ名説明
resultList
The query result set.
domainString
The domain name.
dataSeriesList
Time-series data list.
timestampString
Timestamp, in yyyy-MM-dd HH:mm format. Each timestamp's data value represents the aggregated data within the preceding time granularity interval. The first timestamp for a day is yyyy-MM-dd 00:05, and the last is (yyyy-MM-dd+1) 00:00.
trafficString
Traffic value: Unit: MB. Retains two decimal places.

エラーコード

エラーコード(code)説明(message)HTTPステータスコード意味
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
MissingBodyRequest body has not specified400Request body has not specified
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
NumberLimitExceededNumber of queried domains exceeds   limits set to the account400Number of queried domains exceeds   limits set to the account
PARAM_INVALIDParameter groupBy not compliant   to specifications400Parameter groupBy not compliant   to specifications
InternalErrorSystem has encountered an error500System has encountered an error
PARAM_INVALIDParameter domain does not comply with the specification400Parameter domain does not comply with the specification
PARAM_INVALIDParameter granularity does not comply with the specification400Parameter granularity does not comply with the specification
PARAM_INVALIDParameter protocolType does not comply with the specification400Parameter protocolType does not comply with the specification

入力例

JSON
JSON
リクエスト例
コピー コピー完了
#!/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.cdnetworks.com/api/report/traffic/protocol" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
    "dateFrom":"2017-07-05T00:00:00+00:00",
    "dateTo":"2017-07-05T23:00:00+00:00",
    "domain":[
        "test.com"
    ],
    "granularity":"5m",
    "protocolType":"https",
    "groupBy":[
        "domain"
    ]
}'
レスポンス例
コピー コピー完了
{
      "result":[
          {
              "domain":"test.com",
              "dataSeries":[
                  {
                      "timestamp":"2017-07-05 00:00",
                      "traffic":"1.20"
                  },
                  {
                       "timestamp":"2017-07-05 00:05",
                       "traffic":"12.37"
                  }
              ]
          }
      ]
  }