ReportCountryServerBandwidthService

갱신 시간: 2025-05-19 13:53:37

This interface is used to query the bandwidth details of the country to which the server IP belongs. The user needs to provide the time range, domain name, country code, and data granularity. The return content includes the edge traffic and bandwidth values at each time point in the specified time period. This interface helps users understand the current service traffic distribution and usage in different countries around the world.

  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): Log Download,Dynamic Web Acceleration,Content Acceleration,Media Acceleration Live Broadcast,Flood Shield 2.0,Flood Shield,Media Acceleration,Low Latency Streaming,Web Application Firewall,Media Acceleration-Live
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. Can not exceed the current time; 3. The latest half year (183 days) data can be obtained at most.
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. The end time is greater than the start time. 3. If the end time is greater than the current time, the current time is taken. 4. DateFrom and dateTo are not uploaded, defaulting to query the past 24 hours; if only one is not uploaded, throw an exception; 5. Maximum query interval allowed: 7 days, that is, the difference between dateFrom and dateTo can not exceed 7 days.
domainList
Domains: 1.Domain is not uploaded: Query all domain names of the account (More than 20 domains will error,you can contact technical support for adjustment); 2.Domain is uploaded: Up to 20 domains are supported(you can contact technical support for adjustment).
countryCodeList
Country area: 1. countryCode is not uploaded: Query all country areas by default; 2. countryCode is uploaded: Multiple can be uploaded, such as cn, in. Please refer to the appendix description section of the overview page.
dataIntervalString
Data granularity: 5m: 5 minute granularity; Default value is 5m. 1h: 1 hour granularity.

응답 파라미터

Body 파라미터

파라미터 이름설명
domainString
Domain
countryDataList
countryCodeString
Country area
detailListList
timestampString
Time: 1. When the data query granularity is 5m, then the format is yyyy-MM-dd HH:mm; ach time slice value represents the value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 00:05, and the last one is (yyyy-MM-dd+1) 00:00; 2. When the data query granularity is 1h, the format is yyyy-MM-dd HH; Each time slice value represents the value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 01, and the last one is (yyyy-MM-dd+1) 00; 3. Return the time slices that contained in start time and in end time.
valueString
Bandwidth value, unit Mbps
flowString
Flow, unit MB

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
24102019The request was rejected because the number of domain exceeds the limit.400The request was rejected because the number of domain exceeds the limit.
24102006The date specified is invalid.400The date specified is invalid.
24102021Date format error.400Date format error.
24102008domain is null or invalid.400param: domain is null or invalid.
24102500System error400We encountered an internal error. Please try again

예제

JSON
JSON
요청 예제
복사 복사 완료
#!/bin/bash
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/server/country-bandwidth" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{"dateFrom":"2022-07-22T00:00:00+00:00",
"dateTo":"2022-07-22T23:00:00+00:00",
"domain":["www.example1.com","www.example2.com"],
"countryCode":["hk"]
}'
응답 예제
복사 복사 완료
{
  "code": "0",
  "message": "success",
  "data": [
    {
      "domain": "www.example1.com",
      "countryData": [
        {
          "countryCode": "hk",
          "detailList": [
            {
              "timestamp": "2022-07-22 14:00",
              "value": "0.52",
              "flow": "19.67"
            },
            {
              "timestamp": "2022-07-22 15:00",
              "value": "1.05",
              "flow": "39.54"
            },
            {
              "timestamp": "2022-07-22 16:00",
              "value": "0.54",
              "flow": "20.39"
            },
            {
              "timestamp": "2022-07-22 17:00",
              "value": "0.80",
              "flow": "29.99"
            }
          ]
        }
      ]
    },
    {
      "domain": "www.example2.com",
      "countryData": [
        {
          "countryCode": "hk",
          "detailList": [
            {
              "timestamp": "2022-07-22 14:00",
              "value": "0.66",
              "flow": "24.93"
            },
            {
              "timestamp": "2022-07-22 15:00",
              "value": "1.14",
              "flow": "42.76"
            },
            {
              "timestamp": "2022-07-22 16:00",
              "value": "0.94",
              "flow": "35.25"
            },
            {
              "timestamp": "2022-07-22 17:00",
              "value": "0.98",
              "flow": "36.81"
            }
          ]
        }
      ]
    }
  ]
}
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.