## 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. ### Parameters - `dimension NetFlowsSummaryV2ParamsDimension` Specifies the NetFlows attribute by which to group the results. - `const NetFlowsSummaryV2ParamsDimensionAdm1 NetFlowsSummaryV2ParamsDimension = "ADM1"` - `const NetFlowsSummaryV2ParamsDimensionAs NetFlowsSummaryV2ParamsDimension = "AS"` - `const NetFlowsSummaryV2ParamsDimensionLocation NetFlowsSummaryV2ParamsDimension = "LOCATION"` - `const NetFlowsSummaryV2ParamsDimensionProduct NetFlowsSummaryV2ParamsDimension = "PRODUCT"` - `query NetFlowsSummaryV2Params` - `ASN param.Field[[]string]` 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]` 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]` End of the date range (inclusive). Alternative to `dateRange`; provide together with `dateStart`. When requesting comparison series, every series must resolve to the same duration as the main series. Each `dateStart`/`dateEnd` is floored to the nearest 15 minutes before evaluation, so windows whose durations match only before alignment may be rejected. - `DateRange param.Field[[]string]` Filters results by relative date range ending at the current time, with each value producing a separate series. Use `d` for days (up to `364d`) or `w` for weeks (up to `52w`). Append `control` to request the equivalent previous period for comparison: the comparison window is shifted back by the current window's length rounded up to a whole number of weeks, so it keeps the same weekday alignment and does not overlap the current window (e.g. `7dcontrol` covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass `7d` and `7dcontrol` to compare this week with the previous week. All series must resolve to the same duration as the main series; relative ranges (including `control`) satisfy this automatically. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). - `DateStart param.Field[[]Time]` Start of the date range. Alternative to `dateRange`; provide together with `dateEnd`. When requesting comparison series, every series must resolve to the same duration as the main series. Each `dateStart`/`dateEnd` is floored to the nearest 15 minutes before evaluation, so windows whose durations match only before alignment may be rejected. - `Format param.Field[NetFlowsSummaryV2ParamsFormat]` Format in which results will be returned. - `const NetFlowsSummaryV2ParamsFormatJson NetFlowsSummaryV2ParamsFormat = "JSON"` - `const NetFlowsSummaryV2ParamsFormatCsv NetFlowsSummaryV2ParamsFormat = "CSV"` - `GeoID param.Field[[]string]` 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]` 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. Only supported on high-cardinality dimensions; otherwise the request is rejected. Minimum value is 2. - `Location param.Field[[]string]` 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]` Array of names used to label the series in the response. - `Product param.Field[[]NetFlowsSummaryV2ParamsProduct]` Filters the results by network traffic product types. - `const NetFlowsSummaryV2ParamsProductHTTP NetFlowsSummaryV2ParamsProduct = "HTTP"` - `const NetFlowsSummaryV2ParamsProductAll NetFlowsSummaryV2ParamsProduct = "ALL"` ### Returns - `type NetFlowsSummaryV2Response struct{…}` - `Meta NetFlowsSummaryV2ResponseMeta` Metadata for the results. - `ConfidenceInfo NetFlowsSummaryV2ResponseMetaConfidenceInfo` - `Annotations []NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotation` - `DataSource NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `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` - `EventType NetFlowsSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `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` - `StartDate Time` - `Tags []string` - `Level int64` Provides an indication of how much confidence Cloudflare has in the data. - `DateRange []NetFlowsSummaryV2ResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization NetFlowsSummaryV2ResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `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]` ### Example ```go 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) } ``` #### Response ```json { "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", "tags": [ "BOT_CLASS" ] } ], "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 } ```