Skip to content
Start here

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.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

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

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

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

Specifies the attribute by which to group the results.

One of the following:
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]optional

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

const BotTimeseriesGroupsParamsAggInterval15m BotTimeseriesGroupsParamsAggInterval = "15m"
const BotTimeseriesGroupsParamsAggInterval1h BotTimeseriesGroupsParamsAggInterval = "1h"
const BotTimeseriesGroupsParamsAggInterval1d BotTimeseriesGroupsParamsAggInterval = "1d"
const BotTimeseriesGroupsParamsAggInterval1w BotTimeseriesGroupsParamsAggInterval = "1w"
ASN param.Field[[]string]optional

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

Bot param.Field[[]string]optional

Filters results by bot name.

BotCategory param.Field[[]BotTimeseriesGroupsParamsBotCategory]optional

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]optional

Filters results by bot kind.

const BotTimeseriesGroupsParamsBotKindAgent BotTimeseriesGroupsParamsBotKind = "AGENT"
const BotTimeseriesGroupsParamsBotKindBot BotTimeseriesGroupsParamsBotKind = "BOT"
BotOperator param.Field[[]string]optional

Filters results by bot operator.

BotVerificationStatus param.Field[[]BotTimeseriesGroupsParamsBotVerificationStatus]optional

Filters results by bot verification status (Verified vs. Unverified).

const BotTimeseriesGroupsParamsBotVerificationStatusVerified BotTimeseriesGroupsParamsBotVerificationStatus = "VERIFIED"
Continent param.Field[[]string]optional

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

DateEnd param.Field[[]Time]optional

End of the date range (inclusive).

DateRange param.Field[[]string]optional

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

DateStart param.Field[[]Time]optional

Start of the date range.

Format param.Field[BotTimeseriesGroupsParamsFormat]optional

Format in which results will be returned.

const BotTimeseriesGroupsParamsFormatJson BotTimeseriesGroupsParamsFormat = "JSON"
const BotTimeseriesGroupsParamsFormatCsv BotTimeseriesGroupsParamsFormat = "CSV"
LimitPerGroup param.Field[int64]optional

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

Location param.Field[[]string]optional

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

Name param.Field[[]string]optional

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

ReturnsExpand Collapse
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.

One of the following:
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.

One of the following:
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
formatdate-time
EventType BotTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
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
formaturi
StartDate Time
formatdate-time
Level int64

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

DateRange []BotTimeseriesGroupsResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization BotTimeseriesGroupsResponseMetaNormalization

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

One of the following:
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

Get time series distribution of bots HTTP requests by dimension.

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.Bots.TimeseriesGroups(
    context.TODO(),
    radar.BotTimeseriesGroupsParamsDimensionBot,
    radar.BotTimeseriesGroupsParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "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"
          }
        ],
        "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
}
Returns Examples
{
  "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"
          }
        ],
        "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
}