Skip to content
Start here

Get bots HTTP requests time series

client.Radar.Bots.Timeseries(ctx, query) (*BotTimeseriesResponse, error)
GET/radar/bots/timeseries

Retrieves bots HTTP request volume 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
query BotTimeseriesParams
AggInterval param.Field[BotTimeseriesParamsAggInterval]Optional

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to 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 BotTimeseriesParamsAggInterval15m BotTimeseriesParamsAggInterval = "15m"
const BotTimeseriesParamsAggInterval1h BotTimeseriesParamsAggInterval = "1h"
const BotTimeseriesParamsAggInterval1d BotTimeseriesParamsAggInterval = "1d"
const BotTimeseriesParamsAggInterval1w BotTimeseriesParamsAggInterval = "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[[]BotTimeseriesParamsBotCategory]Optional

Filters results by bot category.

const BotTimeseriesParamsBotCategorySearchEngineCrawler BotTimeseriesParamsBotCategory = "SEARCH_ENGINE_CRAWLER"
const BotTimeseriesParamsBotCategorySearchEngineOptimization BotTimeseriesParamsBotCategory = "SEARCH_ENGINE_OPTIMIZATION"
const BotTimeseriesParamsBotCategoryMonitoringAndAnalytics BotTimeseriesParamsBotCategory = "MONITORING_AND_ANALYTICS"
const BotTimeseriesParamsBotCategoryAdvertisingAndMarketing BotTimeseriesParamsBotCategory = "ADVERTISING_AND_MARKETING"
const BotTimeseriesParamsBotCategorySocialMediaMarketing BotTimeseriesParamsBotCategory = "SOCIAL_MEDIA_MARKETING"
const BotTimeseriesParamsBotCategoryPagePreview BotTimeseriesParamsBotCategory = "PAGE_PREVIEW"
const BotTimeseriesParamsBotCategoryAcademicResearch BotTimeseriesParamsBotCategory = "ACADEMIC_RESEARCH"
const BotTimeseriesParamsBotCategorySecurity BotTimeseriesParamsBotCategory = "SECURITY"
const BotTimeseriesParamsBotCategoryAccessibility BotTimeseriesParamsBotCategory = "ACCESSIBILITY"
const BotTimeseriesParamsBotCategoryWebhooks BotTimeseriesParamsBotCategory = "WEBHOOKS"
const BotTimeseriesParamsBotCategoryFeedFetcher BotTimeseriesParamsBotCategory = "FEED_FETCHER"
const BotTimeseriesParamsBotCategoryAICrawler BotTimeseriesParamsBotCategory = "AI_CRAWLER"
const BotTimeseriesParamsBotCategoryAggregator BotTimeseriesParamsBotCategory = "AGGREGATOR"
const BotTimeseriesParamsBotCategoryAIAssistant BotTimeseriesParamsBotCategory = "AI_ASSISTANT"
const BotTimeseriesParamsBotCategoryAISearch BotTimeseriesParamsBotCategory = "AI_SEARCH"
const BotTimeseriesParamsBotCategoryArchiver BotTimeseriesParamsBotCategory = "ARCHIVER"
BotKind param.Field[[]BotTimeseriesParamsBotKind]Optional

Filters results by bot kind. Deprecated: the Verified Bot / Signed Agent distinction is being removed.

const BotTimeseriesParamsBotKindAgent BotTimeseriesParamsBotKind = "AGENT"
const BotTimeseriesParamsBotKindBot BotTimeseriesParamsBotKind = "BOT"
BotOperator param.Field[[]string]Optional

Filters results by bot operator.

BotVerificationStatus param.Field[[]BotTimeseriesParamsBotVerificationStatus]Optional

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

const BotTimeseriesParamsBotVerificationStatusVerified BotTimeseriesParamsBotVerificationStatus = "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). 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]Optional

Filters results by relative date range ending at the current time, with each value producing a separate series. Use <n>d for days (up to 364d) or <n>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]Optional

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[BotTimeseriesParamsFormat]Optional

Format in which results will be returned.

const BotTimeseriesParamsFormatJson BotTimeseriesParamsFormat = "JSON"
const BotTimeseriesParamsFormatCsv BotTimeseriesParamsFormat = "CSV"
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 BotTimeseriesResponse struct{…}
Meta BotTimeseriesResponseMeta

Metadata for the results.

AggInterval BotTimeseriesResponseMetaAggInterval

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

One of the following:
const BotTimeseriesResponseMetaAggIntervalFifteenMinutes BotTimeseriesResponseMetaAggInterval = "FIFTEEN_MINUTES"
const BotTimeseriesResponseMetaAggIntervalOneHour BotTimeseriesResponseMetaAggInterval = "ONE_HOUR"
const BotTimeseriesResponseMetaAggIntervalOneDay BotTimeseriesResponseMetaAggInterval = "ONE_DAY"
const BotTimeseriesResponseMetaAggIntervalOneWeek BotTimeseriesResponseMetaAggInterval = "ONE_WEEK"
const BotTimeseriesResponseMetaAggIntervalOneMonth BotTimeseriesResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo BotTimeseriesResponseMetaConfidenceInfo
Annotations []BotTimeseriesResponseMetaConfidenceInfoAnnotation
DataSource BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAll BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIBots BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBGP BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBots BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceCT BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNS BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDos BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFw BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFwPg BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTP BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceIQI BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceNet BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceSpeed BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI BotTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeEvent BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeGeneral BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeOutage BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePipeline BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly BotTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

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

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

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

DateRange []BotTimeseriesResponseMetaDateRange
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 BotTimeseriesResponseMetaNormalization

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

One of the following:
const BotTimeseriesResponseMetaNormalizationPercentage BotTimeseriesResponseMetaNormalization = "PERCENTAGE"
const BotTimeseriesResponseMetaNormalizationMin0Max BotTimeseriesResponseMetaNormalization = "MIN0_MAX"
const BotTimeseriesResponseMetaNormalizationMinMax BotTimeseriesResponseMetaNormalization = "MIN_MAX"
const BotTimeseriesResponseMetaNormalizationRawValues BotTimeseriesResponseMetaNormalization = "RAW_VALUES"
const BotTimeseriesResponseMetaNormalizationPercentageChange BotTimeseriesResponseMetaNormalization = "PERCENTAGE_CHANGE"
const BotTimeseriesResponseMetaNormalizationRollingAverage BotTimeseriesResponseMetaNormalization = "ROLLING_AVERAGE"
const BotTimeseriesResponseMetaNormalizationOverlappedPercentage BotTimeseriesResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const BotTimeseriesResponseMetaNormalizationRatio BotTimeseriesResponseMetaNormalization = "RATIO"
Units []BotTimeseriesResponseMetaUnit

Measurement units for the results.

Name string
Value string

Get bots HTTP requests time series

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.Timeseries(context.TODO(), radar.BotTimeseriesParams{

  })
  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",
            "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"
        }
      ]
    }
  },
  "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",
            "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"
        }
      ]
    }
  },
  "success": true
}