# NetFlows ## Get network traffic time series `client.Radar.NetFlows.Timeseries(ctx, query) (*NetFlowsTimeseriesResponse, error)` **get** `/radar/netflows/timeseries` Retrieves network traffic (NetFlows) over time. ### Parameters - `query NetFlowsTimeseriesParams` - `AggInterval param.Field[NetFlowsTimeseriesParamsAggInterval]` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://edgetunnel-b2h.pages.dev/radar/concepts/aggregation-intervals/). When omitted, the interval is auto-selected from the requested date range; finer intervals are only available for shorter ranges. If the requested interval is too granular for the date range, the request is rejected. - `const NetFlowsTimeseriesParamsAggInterval15m NetFlowsTimeseriesParamsAggInterval = "15m"` - `const NetFlowsTimeseriesParamsAggInterval1h NetFlowsTimeseriesParamsAggInterval = "1h"` - `const NetFlowsTimeseriesParamsAggInterval1d NetFlowsTimeseriesParamsAggInterval = "1d"` - `const NetFlowsTimeseriesParamsAggInterval1w NetFlowsTimeseriesParamsAggInterval = "1w"` - `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[NetFlowsTimeseriesParamsFormat]` Format in which results will be returned. - `const NetFlowsTimeseriesParamsFormatJson NetFlowsTimeseriesParamsFormat = "JSON"` - `const NetFlowsTimeseriesParamsFormatCsv NetFlowsTimeseriesParamsFormat = "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). - `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. - `Normalization param.Field[NetFlowsTimeseriesParamsNormalization]` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). `PERCENTAGE_CHANGE` requires exactly one comparison series (e.g. a `control` date range). - `const NetFlowsTimeseriesParamsNormalizationPercentageChange NetFlowsTimeseriesParamsNormalization = "PERCENTAGE_CHANGE"` - `const NetFlowsTimeseriesParamsNormalizationMin0Max NetFlowsTimeseriesParamsNormalization = "MIN0_MAX"` - `Product param.Field[[]NetFlowsTimeseriesParamsProduct]` Filters the results by network traffic product types. - `const NetFlowsTimeseriesParamsProductHTTP NetFlowsTimeseriesParamsProduct = "HTTP"` - `const NetFlowsTimeseriesParamsProductAll NetFlowsTimeseriesParamsProduct = "ALL"` ### Returns - `type NetFlowsTimeseriesResponse struct{…}` - `Meta NetFlowsTimeseriesResponseMeta` Metadata for the results. - `AggInterval NetFlowsTimeseriesResponseMetaAggInterval` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://edgetunnel-b2h.pages.dev/radar/concepts/aggregation-intervals/). - `const NetFlowsTimeseriesResponseMetaAggIntervalFifteenMinutes NetFlowsTimeseriesResponseMetaAggInterval = "FIFTEEN_MINUTES"` - `const NetFlowsTimeseriesResponseMetaAggIntervalOneHour NetFlowsTimeseriesResponseMetaAggInterval = "ONE_HOUR"` - `const NetFlowsTimeseriesResponseMetaAggIntervalOneDay NetFlowsTimeseriesResponseMetaAggInterval = "ONE_DAY"` - `const NetFlowsTimeseriesResponseMetaAggIntervalOneWeek NetFlowsTimeseriesResponseMetaAggInterval = "ONE_WEEK"` - `const NetFlowsTimeseriesResponseMetaAggIntervalOneMonth NetFlowsTimeseriesResponseMetaAggInterval = "ONE_MONTH"` - `ConfidenceInfo NetFlowsTimeseriesResponseMetaConfidenceInfo` - `Annotations []NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotation` - `DataSource NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAll NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIBots NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBGP NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBots NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceCT NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNS NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDos NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFw NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFwPg NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTP NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceIQI NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceNet NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceSpeed NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeEvent NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeGeneral NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeOutage NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePipeline NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly NetFlowsTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "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 []NetFlowsTimeseriesResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization NetFlowsTimeseriesResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `const NetFlowsTimeseriesResponseMetaNormalizationPercentage NetFlowsTimeseriesResponseMetaNormalization = "PERCENTAGE"` - `const NetFlowsTimeseriesResponseMetaNormalizationMin0Max NetFlowsTimeseriesResponseMetaNormalization = "MIN0_MAX"` - `const NetFlowsTimeseriesResponseMetaNormalizationMinMax NetFlowsTimeseriesResponseMetaNormalization = "MIN_MAX"` - `const NetFlowsTimeseriesResponseMetaNormalizationRawValues NetFlowsTimeseriesResponseMetaNormalization = "RAW_VALUES"` - `const NetFlowsTimeseriesResponseMetaNormalizationPercentageChange NetFlowsTimeseriesResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const NetFlowsTimeseriesResponseMetaNormalizationRollingAverage NetFlowsTimeseriesResponseMetaNormalization = "ROLLING_AVERAGE"` - `const NetFlowsTimeseriesResponseMetaNormalizationOverlappedPercentage NetFlowsTimeseriesResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const NetFlowsTimeseriesResponseMetaNormalizationRatio NetFlowsTimeseriesResponseMetaNormalization = "RATIO"` - `Units []NetFlowsTimeseriesResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Serie0 NetFlowsTimeseriesResponseSerie0` - `Timestamps []Time` - `Values []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.Timeseries(context.TODO(), radar.NetFlowsTimeseriesParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Meta) } ``` #### Response ```json { "result": { "meta": { "aggInterval": "FIFTEEN_MINUTES", "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" } ] }, "serie_0": { "timestamps": [ "2019-12-27T18:11:19.117Z" ], "values": [ "10" ] } }, "success": true } ``` ## Get network traffic summary `client.Radar.NetFlows.Summary(ctx, query) (*NetFlowsSummaryResponse, error)` **get** `/radar/netflows/summary` Retrieves the distribution of network traffic (NetFlows) by HTTP vs other protocols. ### Parameters - `query NetFlowsSummaryParams` - `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[NetFlowsSummaryParamsFormat]` Format in which results will be returned. - `const NetFlowsSummaryParamsFormatJson NetFlowsSummaryParamsFormat = "JSON"` - `const NetFlowsSummaryParamsFormatCsv NetFlowsSummaryParamsFormat = "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). - `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. ### Returns - `type NetFlowsSummaryResponse struct{…}` - `Meta NetFlowsSummaryResponseMeta` Metadata for the results. - `ConfidenceInfo NetFlowsSummaryResponseMetaConfidenceInfo` - `Annotations []NetFlowsSummaryResponseMetaConfidenceInfoAnnotation` - `DataSource NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceAll NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceAIBots NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceBGP NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceBots NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceCT NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceDNS NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceDos NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceFw NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceFwPg NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceHTTP NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceIQI NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceNet NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceSpeed NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventTypeEvent NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventTypeGeneral NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventTypeOutage NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventTypePipeline NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly NetFlowsSummaryResponseMetaConfidenceInfoAnnotationsEventType = "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 []NetFlowsSummaryResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization NetFlowsSummaryResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `const NetFlowsSummaryResponseMetaNormalizationPercentage NetFlowsSummaryResponseMetaNormalization = "PERCENTAGE"` - `const NetFlowsSummaryResponseMetaNormalizationMin0Max NetFlowsSummaryResponseMetaNormalization = "MIN0_MAX"` - `const NetFlowsSummaryResponseMetaNormalizationMinMax NetFlowsSummaryResponseMetaNormalization = "MIN_MAX"` - `const NetFlowsSummaryResponseMetaNormalizationRawValues NetFlowsSummaryResponseMetaNormalization = "RAW_VALUES"` - `const NetFlowsSummaryResponseMetaNormalizationPercentageChange NetFlowsSummaryResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const NetFlowsSummaryResponseMetaNormalizationRollingAverage NetFlowsSummaryResponseMetaNormalization = "ROLLING_AVERAGE"` - `const NetFlowsSummaryResponseMetaNormalizationOverlappedPercentage NetFlowsSummaryResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const NetFlowsSummaryResponseMetaNormalizationRatio NetFlowsSummaryResponseMetaNormalization = "RATIO"` - `Units []NetFlowsSummaryResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Summary0 NetFlowsSummaryResponseSummary0` - `HTTP string` A numeric string. - `Other string` A numeric 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.Summary(context.TODO(), radar.NetFlowsSummaryParams{ }) 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": { "HTTP": "10", "OTHER": "10" } }, "success": true } ``` ## 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 } ``` ## Get time series distribution of network traffic by dimension `client.Radar.NetFlows.TimeseriesGroups(ctx, dimension, query) (*NetFlowsTimeseriesGroupsResponse, error)` **get** `/radar/netflows/timeseries_groups/{dimension}` Retrieves the distribution of NetFlows traffic, grouped by the specified dimension over time. ### Parameters - `dimension NetFlowsTimeseriesGroupsParamsDimension` Specifies the NetFlows attribute by which to group the results. - `const NetFlowsTimeseriesGroupsParamsDimensionAdm1 NetFlowsTimeseriesGroupsParamsDimension = "ADM1"` - `const NetFlowsTimeseriesGroupsParamsDimensionAs NetFlowsTimeseriesGroupsParamsDimension = "AS"` - `const NetFlowsTimeseriesGroupsParamsDimensionLocation NetFlowsTimeseriesGroupsParamsDimension = "LOCATION"` - `const NetFlowsTimeseriesGroupsParamsDimensionProduct NetFlowsTimeseriesGroupsParamsDimension = "PRODUCT"` - `query NetFlowsTimeseriesGroupsParams` - `AggInterval param.Field[NetFlowsTimeseriesGroupsParamsAggInterval]` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://edgetunnel-b2h.pages.dev/radar/concepts/aggregation-intervals/). When omitted, the interval is auto-selected from the requested date range; finer intervals are only available for shorter ranges. If the requested interval is too granular for the date range, the request is rejected. - `const NetFlowsTimeseriesGroupsParamsAggInterval15m NetFlowsTimeseriesGroupsParamsAggInterval = "15m"` - `const NetFlowsTimeseriesGroupsParamsAggInterval1h NetFlowsTimeseriesGroupsParamsAggInterval = "1h"` - `const NetFlowsTimeseriesGroupsParamsAggInterval1d NetFlowsTimeseriesGroupsParamsAggInterval = "1d"` - `const NetFlowsTimeseriesGroupsParamsAggInterval1w NetFlowsTimeseriesGroupsParamsAggInterval = "1w"` - `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[NetFlowsTimeseriesGroupsParamsFormat]` Format in which results will be returned. - `const NetFlowsTimeseriesGroupsParamsFormatJson NetFlowsTimeseriesGroupsParamsFormat = "JSON"` - `const NetFlowsTimeseriesGroupsParamsFormatCsv NetFlowsTimeseriesGroupsParamsFormat = "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. - `Normalization param.Field[NetFlowsTimeseriesGroupsParamsNormalization]` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). `PERCENTAGE_CHANGE` requires exactly one comparison series (e.g. a `control` date range). - `const NetFlowsTimeseriesGroupsParamsNormalizationPercentage NetFlowsTimeseriesGroupsParamsNormalization = "PERCENTAGE"` - `const NetFlowsTimeseriesGroupsParamsNormalizationMin0Max NetFlowsTimeseriesGroupsParamsNormalization = "MIN0_MAX"` - `const NetFlowsTimeseriesGroupsParamsNormalizationPercentageChange NetFlowsTimeseriesGroupsParamsNormalization = "PERCENTAGE_CHANGE"` - `Product param.Field[[]NetFlowsTimeseriesGroupsParamsProduct]` Filters the results by network traffic product types. - `const NetFlowsTimeseriesGroupsParamsProductHTTP NetFlowsTimeseriesGroupsParamsProduct = "HTTP"` - `const NetFlowsTimeseriesGroupsParamsProductAll NetFlowsTimeseriesGroupsParamsProduct = "ALL"` ### Returns - `type NetFlowsTimeseriesGroupsResponse struct{…}` - `Meta NetFlowsTimeseriesGroupsResponseMeta` Metadata for the results. - `AggInterval NetFlowsTimeseriesGroupsResponseMetaAggInterval` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://edgetunnel-b2h.pages.dev/radar/concepts/aggregation-intervals/). - `const NetFlowsTimeseriesGroupsResponseMetaAggIntervalFifteenMinutes NetFlowsTimeseriesGroupsResponseMetaAggInterval = "FIFTEEN_MINUTES"` - `const NetFlowsTimeseriesGroupsResponseMetaAggIntervalOneHour NetFlowsTimeseriesGroupsResponseMetaAggInterval = "ONE_HOUR"` - `const NetFlowsTimeseriesGroupsResponseMetaAggIntervalOneDay NetFlowsTimeseriesGroupsResponseMetaAggInterval = "ONE_DAY"` - `const NetFlowsTimeseriesGroupsResponseMetaAggIntervalOneWeek NetFlowsTimeseriesGroupsResponseMetaAggInterval = "ONE_WEEK"` - `const NetFlowsTimeseriesGroupsResponseMetaAggIntervalOneMonth NetFlowsTimeseriesGroupsResponseMetaAggInterval = "ONE_MONTH"` - `ConfidenceInfo NetFlowsTimeseriesGroupsResponseMetaConfidenceInfo` - `Annotations []NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotation` - `DataSource NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAll NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAIBots NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceBGP NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceBots NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceCT NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNS NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDos NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceFw NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceFwPg NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTP NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceIQI NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceNet NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceSpeed NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeEvent NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeGeneral NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeOutage NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypePipeline NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly NetFlowsTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "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 []NetFlowsTimeseriesGroupsResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization NetFlowsTimeseriesGroupsResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationPercentage NetFlowsTimeseriesGroupsResponseMetaNormalization = "PERCENTAGE"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationMin0Max NetFlowsTimeseriesGroupsResponseMetaNormalization = "MIN0_MAX"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationMinMax NetFlowsTimeseriesGroupsResponseMetaNormalization = "MIN_MAX"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationRawValues NetFlowsTimeseriesGroupsResponseMetaNormalization = "RAW_VALUES"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationPercentageChange NetFlowsTimeseriesGroupsResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationRollingAverage NetFlowsTimeseriesGroupsResponseMetaNormalization = "ROLLING_AVERAGE"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationOverlappedPercentage NetFlowsTimeseriesGroupsResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const NetFlowsTimeseriesGroupsResponseMetaNormalizationRatio NetFlowsTimeseriesGroupsResponseMetaNormalization = "RATIO"` - `Units []NetFlowsTimeseriesGroupsResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Serie0 NetFlowsTimeseriesGroupsResponseSerie0` - `Timestamps []Time` ### 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.TimeseriesGroups( context.TODO(), radar.NetFlowsTimeseriesGroupsParamsDimensionAdm1, radar.NetFlowsTimeseriesGroupsParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Meta) } ``` #### Response ```json { "result": { "meta": { "aggInterval": "FIFTEEN_MINUTES", "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" } ] }, "serie_0": { "timestamps": [ "2023-08-08T10:15:00Z" ] } }, "success": true } ``` # Top ## Get top ASes by network traffic `client.Radar.NetFlows.Top.Ases(ctx, query) (*NetFlowsTopAsesResponse, error)` **get** `/radar/netflows/top/ases` Retrieves the top autonomous systems by network traffic (NetFlows). ### Parameters - `query NetFlowsTopAsesParams` - `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[NetFlowsTopAsesParamsFormat]` Format in which results will be returned. - `const NetFlowsTopAsesParamsFormatJson NetFlowsTopAsesParamsFormat = "JSON"` - `const NetFlowsTopAsesParamsFormatCsv NetFlowsTopAsesParamsFormat = "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). - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `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. ### Returns - `type NetFlowsTopAsesResponse struct{…}` - `Meta NetFlowsTopAsesResponseMeta` Metadata for the results. - `ConfidenceInfo NetFlowsTopAsesResponseMetaConfidenceInfo` - `Annotations []NetFlowsTopAsesResponseMetaConfidenceInfoAnnotation` - `DataSource NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceAll NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceAIBots NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceBGP NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceBots NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceCT NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceDNS NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceDos NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceFw NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceFwPg NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceHTTP NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceIQI NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceNet NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceSpeed NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventTypeEvent NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventTypeGeneral NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventTypeOutage NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventTypePipeline NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly NetFlowsTopAsesResponseMetaConfidenceInfoAnnotationsEventType = "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 []NetFlowsTopAsesResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization NetFlowsTopAsesResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `const NetFlowsTopAsesResponseMetaNormalizationPercentage NetFlowsTopAsesResponseMetaNormalization = "PERCENTAGE"` - `const NetFlowsTopAsesResponseMetaNormalizationMin0Max NetFlowsTopAsesResponseMetaNormalization = "MIN0_MAX"` - `const NetFlowsTopAsesResponseMetaNormalizationMinMax NetFlowsTopAsesResponseMetaNormalization = "MIN_MAX"` - `const NetFlowsTopAsesResponseMetaNormalizationRawValues NetFlowsTopAsesResponseMetaNormalization = "RAW_VALUES"` - `const NetFlowsTopAsesResponseMetaNormalizationPercentageChange NetFlowsTopAsesResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const NetFlowsTopAsesResponseMetaNormalizationRollingAverage NetFlowsTopAsesResponseMetaNormalization = "ROLLING_AVERAGE"` - `const NetFlowsTopAsesResponseMetaNormalizationOverlappedPercentage NetFlowsTopAsesResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const NetFlowsTopAsesResponseMetaNormalizationRatio NetFlowsTopAsesResponseMetaNormalization = "RATIO"` - `Units []NetFlowsTopAsesResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Top0 []NetFlowsTopAsesResponseTop0` - `ClientASN float64` - `ClientAsName string` - `Value string` A numeric 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.Top.Ases(context.TODO(), radar.NetFlowsTopAsesParams{ }) 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" } ] }, "top_0": [ { "clientASN": 16509, "clientASName": "AMAZON-02", "value": "10" } ] }, "success": true } ``` ## Get top locations by network traffic `client.Radar.NetFlows.Top.Locations(ctx, query) (*NetFlowsTopLocationsResponse, error)` **get** `/radar/netflows/top/locations` Retrieves the top locations by network traffic (NetFlows). ### Parameters - `query NetFlowsTopLocationsParams` - `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[NetFlowsTopLocationsParamsFormat]` Format in which results will be returned. - `const NetFlowsTopLocationsParamsFormatJson NetFlowsTopLocationsParamsFormat = "JSON"` - `const NetFlowsTopLocationsParamsFormatCsv NetFlowsTopLocationsParamsFormat = "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). - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `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. ### Returns - `type NetFlowsTopLocationsResponse struct{…}` - `Meta NetFlowsTopLocationsResponseMeta` Metadata for the results. - `ConfidenceInfo NetFlowsTopLocationsResponseMetaConfidenceInfo` - `Annotations []NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotation` - `DataSource NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceAll NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceAIBots NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceBGP NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceBots NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceCT NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceDNS NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceDos NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceFw NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceFwPg NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceHTTP NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceIQI NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceNet NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceSpeed NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventTypeEvent NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventTypeGeneral NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventTypeOutage NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventTypePipeline NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly NetFlowsTopLocationsResponseMetaConfidenceInfoAnnotationsEventType = "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 []NetFlowsTopLocationsResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization NetFlowsTopLocationsResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `const NetFlowsTopLocationsResponseMetaNormalizationPercentage NetFlowsTopLocationsResponseMetaNormalization = "PERCENTAGE"` - `const NetFlowsTopLocationsResponseMetaNormalizationMin0Max NetFlowsTopLocationsResponseMetaNormalization = "MIN0_MAX"` - `const NetFlowsTopLocationsResponseMetaNormalizationMinMax NetFlowsTopLocationsResponseMetaNormalization = "MIN_MAX"` - `const NetFlowsTopLocationsResponseMetaNormalizationRawValues NetFlowsTopLocationsResponseMetaNormalization = "RAW_VALUES"` - `const NetFlowsTopLocationsResponseMetaNormalizationPercentageChange NetFlowsTopLocationsResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const NetFlowsTopLocationsResponseMetaNormalizationRollingAverage NetFlowsTopLocationsResponseMetaNormalization = "ROLLING_AVERAGE"` - `const NetFlowsTopLocationsResponseMetaNormalizationOverlappedPercentage NetFlowsTopLocationsResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const NetFlowsTopLocationsResponseMetaNormalizationRatio NetFlowsTopLocationsResponseMetaNormalization = "RATIO"` - `Units []NetFlowsTopLocationsResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Top0 []NetFlowsTopLocationsResponseTop0` - `ClientCountryAlpha2 string` - `ClientCountryName string` - `Value string` A numeric 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.Top.Locations(context.TODO(), radar.NetFlowsTopLocationsParams{ }) 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" } ] }, "top_0": [ { "clientCountryAlpha2": "US", "clientCountryName": "United States", "value": "10" } ] }, "success": true } ```