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.

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.

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).

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[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
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"
          }
        ],
        "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"
          }
        ],
        "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
}