Skip to content
Start here

Get network traffic distribution by dimension

client.Radar.NetFlows.SummaryV2(ctx, dimension, query) (*NetFlowsSummaryV2Response, error)
GET/radar/netflows/summary/{dimension}

Retrieves the distribution of network traffic (NetFlows) by the specified dimension.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse

Specifies the NetFlows attribute by which to group the results.

One of the following:
const NetFlowsSummaryV2ParamsDimensionAdm1 NetFlowsSummaryV2ParamsDimension = "ADM1"
const NetFlowsSummaryV2ParamsDimensionAs NetFlowsSummaryV2ParamsDimension = "AS"
const NetFlowsSummaryV2ParamsDimensionLocation NetFlowsSummaryV2ParamsDimension = "LOCATION"
const NetFlowsSummaryV2ParamsDimensionProduct NetFlowsSummaryV2ParamsDimension = "PRODUCT"
query NetFlowsSummaryV2Params
ASN param.Field[[]string]optional

Filters results by Autonomous System. Specify one or more Autonomous System Numbers (ASNs) as a comma-separated list. Prefix with - to exclude ASNs from results. For example, -174, 3356 excludes results from AS174, but includes results from AS3356.

Continent param.Field[[]string]optional

Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude continents from results. For example, -EU,NA excludes results from EU, but includes results from NA.

DateEnd param.Field[[]Time]optional

End of the date range (inclusive).

DateRange param.Field[[]string]optional

Filters results by date range. For example, use 7d and 7dcontrol to compare this week with the previous week. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]optional

Start of the date range.

Format param.Field[NetFlowsSummaryV2ParamsFormat]optional

Format in which results will be returned.

const NetFlowsSummaryV2ParamsFormatJson NetFlowsSummaryV2ParamsFormat = "JSON"
const NetFlowsSummaryV2ParamsFormatCsv NetFlowsSummaryV2ParamsFormat = "CSV"
GeoID param.Field[[]string]optional

Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. Prefix with - to exclude geoIds from results. For example, -2267056,360689 excludes results from the 2267056 (Lisbon), but includes results from 5128638 (New York).

LimitPerGroup param.Field[int64]optional

Limits the number of objects per group to the top items within the specified time range. When item count exceeds the limit, extra items appear grouped under an "other" category.

Location param.Field[[]string]optional

Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude locations from results. For example, -US,PT excludes results from the US, but includes results from PT.

Name param.Field[[]string]optional

Array of names used to label the series in the response.

Product param.Field[[]NetFlowsSummaryV2ParamsProduct]optional

Filters the results by network traffic product types.

const NetFlowsSummaryV2ParamsProductHTTP NetFlowsSummaryV2ParamsProduct = "HTTP"
const NetFlowsSummaryV2ParamsProductAll NetFlowsSummaryV2ParamsProduct = "ALL"
ReturnsExpand Collapse
type NetFlowsSummaryV2Response struct{…}
Meta NetFlowsSummaryV2ResponseMeta

Metadata for the results.

ConfidenceInfo NetFlowsSummaryV2ResponseMetaConfidenceInfo
Annotations []NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotation
DataSource NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAll NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIBots NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceBGP NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceBots NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceCT NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNS NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDos NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceFw NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceFwPg NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTP NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceIQI NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceNet NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceSpeed NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeEvent NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeGeneral NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeOutage NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypePipeline NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []NetFlowsSummaryV2ResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization NetFlowsSummaryV2ResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const NetFlowsSummaryV2ResponseMetaNormalizationPercentage NetFlowsSummaryV2ResponseMetaNormalization = "PERCENTAGE"
const NetFlowsSummaryV2ResponseMetaNormalizationMin0Max NetFlowsSummaryV2ResponseMetaNormalization = "MIN0_MAX"
const NetFlowsSummaryV2ResponseMetaNormalizationMinMax NetFlowsSummaryV2ResponseMetaNormalization = "MIN_MAX"
const NetFlowsSummaryV2ResponseMetaNormalizationRawValues NetFlowsSummaryV2ResponseMetaNormalization = "RAW_VALUES"
const NetFlowsSummaryV2ResponseMetaNormalizationPercentageChange NetFlowsSummaryV2ResponseMetaNormalization = "PERCENTAGE_CHANGE"
const NetFlowsSummaryV2ResponseMetaNormalizationRollingAverage NetFlowsSummaryV2ResponseMetaNormalization = "ROLLING_AVERAGE"
const NetFlowsSummaryV2ResponseMetaNormalizationOverlappedPercentage NetFlowsSummaryV2ResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const NetFlowsSummaryV2ResponseMetaNormalizationRatio NetFlowsSummaryV2ResponseMetaNormalization = "RATIO"
Units []NetFlowsSummaryV2ResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 map[string, string]

Get network traffic distribution by dimension

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.NetFlows.SummaryV2(
    context.TODO(),
    radar.NetFlowsSummaryV2ParamsDimensionAdm1,
    radar.NetFlowsSummaryV2Params{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z"
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "Germany": "25.084366",
      "United States": "50.168733"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z"
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "Germany": "25.084366",
      "United States": "50.168733"
    }
  },
  "success": true
}