## Get time series distribution of bots HTTP requests by dimension. `client.Radar.Bots.TimeseriesGroups(ctx, dimension, query) (*BotTimeseriesGroupsResponse, error)` **get** `/radar/bots/timeseries_groups/{dimension}` Retrieves the distribution of HTTP requests from bots, grouped by the specified dimension over time. ### Parameters - `dimension BotTimeseriesGroupsParamsDimension` Specifies the attribute by which to group the results. - `const BotTimeseriesGroupsParamsDimensionBot BotTimeseriesGroupsParamsDimension = "BOT"` - `const BotTimeseriesGroupsParamsDimensionBotKind BotTimeseriesGroupsParamsDimension = "BOT_KIND"` - `const BotTimeseriesGroupsParamsDimensionBotOperator BotTimeseriesGroupsParamsDimension = "BOT_OPERATOR"` - `const BotTimeseriesGroupsParamsDimensionBotCategory BotTimeseriesGroupsParamsDimension = "BOT_CATEGORY"` - `query BotTimeseriesGroupsParams` - `AggInterval param.Field[BotTimeseriesGroupsParamsAggInterval]` 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 BotTimeseriesGroupsParamsAggInterval15m BotTimeseriesGroupsParamsAggInterval = "15m"` - `const BotTimeseriesGroupsParamsAggInterval1h BotTimeseriesGroupsParamsAggInterval = "1h"` - `const BotTimeseriesGroupsParamsAggInterval1d BotTimeseriesGroupsParamsAggInterval = "1d"` - `const BotTimeseriesGroupsParamsAggInterval1w BotTimeseriesGroupsParamsAggInterval = "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. - `Bot param.Field[[]string]` Filters results by bot name. - `BotCategory param.Field[[]BotTimeseriesGroupsParamsBotCategory]` Filters results by bot category. - `const BotTimeseriesGroupsParamsBotCategorySearchEngineCrawler BotTimeseriesGroupsParamsBotCategory = "SEARCH_ENGINE_CRAWLER"` - `const BotTimeseriesGroupsParamsBotCategorySearchEngineOptimization BotTimeseriesGroupsParamsBotCategory = "SEARCH_ENGINE_OPTIMIZATION"` - `const BotTimeseriesGroupsParamsBotCategoryMonitoringAndAnalytics BotTimeseriesGroupsParamsBotCategory = "MONITORING_AND_ANALYTICS"` - `const BotTimeseriesGroupsParamsBotCategoryAdvertisingAndMarketing BotTimeseriesGroupsParamsBotCategory = "ADVERTISING_AND_MARKETING"` - `const BotTimeseriesGroupsParamsBotCategorySocialMediaMarketing BotTimeseriesGroupsParamsBotCategory = "SOCIAL_MEDIA_MARKETING"` - `const BotTimeseriesGroupsParamsBotCategoryPagePreview BotTimeseriesGroupsParamsBotCategory = "PAGE_PREVIEW"` - `const BotTimeseriesGroupsParamsBotCategoryAcademicResearch BotTimeseriesGroupsParamsBotCategory = "ACADEMIC_RESEARCH"` - `const BotTimeseriesGroupsParamsBotCategorySecurity BotTimeseriesGroupsParamsBotCategory = "SECURITY"` - `const BotTimeseriesGroupsParamsBotCategoryAccessibility BotTimeseriesGroupsParamsBotCategory = "ACCESSIBILITY"` - `const BotTimeseriesGroupsParamsBotCategoryWebhooks BotTimeseriesGroupsParamsBotCategory = "WEBHOOKS"` - `const BotTimeseriesGroupsParamsBotCategoryFeedFetcher BotTimeseriesGroupsParamsBotCategory = "FEED_FETCHER"` - `const BotTimeseriesGroupsParamsBotCategoryAICrawler BotTimeseriesGroupsParamsBotCategory = "AI_CRAWLER"` - `const BotTimeseriesGroupsParamsBotCategoryAggregator BotTimeseriesGroupsParamsBotCategory = "AGGREGATOR"` - `const BotTimeseriesGroupsParamsBotCategoryAIAssistant BotTimeseriesGroupsParamsBotCategory = "AI_ASSISTANT"` - `const BotTimeseriesGroupsParamsBotCategoryAISearch BotTimeseriesGroupsParamsBotCategory = "AI_SEARCH"` - `const BotTimeseriesGroupsParamsBotCategoryArchiver BotTimeseriesGroupsParamsBotCategory = "ARCHIVER"` - `BotKind param.Field[[]BotTimeseriesGroupsParamsBotKind]` Filters results by bot kind. Deprecated: the Verified Bot / Signed Agent distinction is being removed. - `const BotTimeseriesGroupsParamsBotKindAgent BotTimeseriesGroupsParamsBotKind = "AGENT"` - `const BotTimeseriesGroupsParamsBotKindBot BotTimeseriesGroupsParamsBotKind = "BOT"` - `BotOperator param.Field[[]string]` Filters results by bot operator. - `BotVerificationStatus param.Field[[]BotTimeseriesGroupsParamsBotVerificationStatus]` Filters results by bot verification status (Verified vs. Unverified). - `const BotTimeseriesGroupsParamsBotVerificationStatusVerified BotTimeseriesGroupsParamsBotVerificationStatus = "VERIFIED"` - `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[BotTimeseriesGroupsParamsFormat]` Format in which results will be returned. - `const BotTimeseriesGroupsParamsFormatJson BotTimeseriesGroupsParamsFormat = "JSON"` - `const BotTimeseriesGroupsParamsFormatCsv BotTimeseriesGroupsParamsFormat = "CSV"` - `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. ### Returns - `type BotTimeseriesGroupsResponse struct{…}` - `Meta BotTimeseriesGroupsResponseMeta` Metadata for the results. - `AggInterval BotTimeseriesGroupsResponseMetaAggInterval` 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 BotTimeseriesGroupsResponseMetaAggIntervalFifteenMinutes BotTimeseriesGroupsResponseMetaAggInterval = "FIFTEEN_MINUTES"` - `const BotTimeseriesGroupsResponseMetaAggIntervalOneHour BotTimeseriesGroupsResponseMetaAggInterval = "ONE_HOUR"` - `const BotTimeseriesGroupsResponseMetaAggIntervalOneDay BotTimeseriesGroupsResponseMetaAggInterval = "ONE_DAY"` - `const BotTimeseriesGroupsResponseMetaAggIntervalOneWeek BotTimeseriesGroupsResponseMetaAggInterval = "ONE_WEEK"` - `const BotTimeseriesGroupsResponseMetaAggIntervalOneMonth BotTimeseriesGroupsResponseMetaAggInterval = "ONE_MONTH"` - `ConfidenceInfo BotTimeseriesGroupsResponseMetaConfidenceInfo` - `Annotations []BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotation` - `DataSource BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAll BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAIBots BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceBGP BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceBots BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceCT BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNS BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDos BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceFw BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceFwPg BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTP BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceIQI BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceNet BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceSpeed BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeEvent BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeGeneral BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeOutage BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypePipeline BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "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 []BotTimeseriesGroupsResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization BotTimeseriesGroupsResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://edgetunnel-b2h.pages.dev/radar/concepts/normalization/). - `const BotTimeseriesGroupsResponseMetaNormalizationPercentage BotTimeseriesGroupsResponseMetaNormalization = "PERCENTAGE"` - `const BotTimeseriesGroupsResponseMetaNormalizationMin0Max BotTimeseriesGroupsResponseMetaNormalization = "MIN0_MAX"` - `const BotTimeseriesGroupsResponseMetaNormalizationMinMax BotTimeseriesGroupsResponseMetaNormalization = "MIN_MAX"` - `const BotTimeseriesGroupsResponseMetaNormalizationRawValues BotTimeseriesGroupsResponseMetaNormalization = "RAW_VALUES"` - `const BotTimeseriesGroupsResponseMetaNormalizationPercentageChange BotTimeseriesGroupsResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const BotTimeseriesGroupsResponseMetaNormalizationRollingAverage BotTimeseriesGroupsResponseMetaNormalization = "ROLLING_AVERAGE"` - `const BotTimeseriesGroupsResponseMetaNormalizationOverlappedPercentage BotTimeseriesGroupsResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const BotTimeseriesGroupsResponseMetaNormalizationRatio BotTimeseriesGroupsResponseMetaNormalization = "RATIO"` - `Units []BotTimeseriesGroupsResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Serie0 BotTimeseriesGroupsResponseSerie0` - `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.Bots.TimeseriesGroups( context.TODO(), radar.BotTimeseriesGroupsParamsDimensionBot, radar.BotTimeseriesGroupsParams{ }, ) 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 } ```