百度智能云

All Product Document

          CDN Abroad

          Traffic Query Interface

          Interface

          This interface is used for query traffic.

          Method Path Description
          GET /v2/abroad/stat/flow Query domain name traffic records

          Request parameter

          Parameter Optional Type Description
          domain Optional String Domain name queried, if not specified, it returns the sum of traffic of all domain names of the user.
          endTime Optional Timestamp End value of the time range queried, the default is the current time. The maximum time span between endTime and startTime is 90 days.
          startTime Optional Timestamp Start time of the time range queried, the default is 24 hours ahead of the endTime.
          period Optional Int Granularity of the query result, in seconds, you can select 60, 300, 3,600 and 86,400, and the default is 300.
          region Optional String Country queried

          Response parameter

          Parameter Type Description
          details list<FlowDetails> Data details

          FlowDetails content

          Parameter Type Description
          timestamp Timestamp Timing
          flow Int Number of transmitted bytes in the statistical period
          bps Int Average bps in the statistical period

          Request example

          GET /v2/abroad/stat/flow?domain=xxx.com&startTime=2019-04-08T09:40:00Z&endTime=2019-04-08T10:00:00Z&period=300 

          Response example

          { 
              "status": "ok", 
              "details": [ 
                  { 
                      "timestamp": "2019-04-08T09:40:00Z", 
                      "key": "total", 
                      "flow": 809, 
                      "bps": 21 
                  }, 
                  { 
                      "timestamp": "2019-04-08T09:45:00Z", 
                      "key": "total", 
                      "flow": 4738, 
                      "bps": 126 
                  }, 
                  { 
                      "timestamp": "2019-04-08T09:50:00Z" 
                  }, 
                  { 
                      "timestamp": "2019-04-08T09:55:00Z" 
                  } 
              ] 
          }
          Previous
          PV, QPS Query Interface
          Next
          Query Interface for Forward-to-Origin