Skip to content
Start here

Get HTTP requests by bot class time series

client.Radar.HTTP.TimeseriesGroups.BotClass(ctx, query) (*HTTPTimeseriesGroupBotClassResponse, error)
GET/radar/http/timeseries_groups/bot_class

Retrieves the distribution of HTTP requests classified as automated or human over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ for more information.

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 HTTPTimeseriesGroupBotClassParams
AggInterval param.Field[HTTPTimeseriesGroupBotClassParamsAggInterval]Optional

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

const HTTPTimeseriesGroupBotClassParamsAggInterval15m HTTPTimeseriesGroupBotClassParamsAggInterval = "15m"
const HTTPTimeseriesGroupBotClassParamsAggInterval1h HTTPTimeseriesGroupBotClassParamsAggInterval = "1h"
const HTTPTimeseriesGroupBotClassParamsAggInterval1d HTTPTimeseriesGroupBotClassParamsAggInterval = "1d"
const HTTPTimeseriesGroupBotClassParamsAggInterval1w HTTPTimeseriesGroupBotClassParamsAggInterval = "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.

BrowserFamily param.Field[[]HTTPTimeseriesGroupBotClassParamsBrowserFamily]Optional

Filters results by browser family.

const HTTPTimeseriesGroupBotClassParamsBrowserFamilyChrome HTTPTimeseriesGroupBotClassParamsBrowserFamily = "CHROME"
const HTTPTimeseriesGroupBotClassParamsBrowserFamilyEdge HTTPTimeseriesGroupBotClassParamsBrowserFamily = "EDGE"
const HTTPTimeseriesGroupBotClassParamsBrowserFamilyFirefox HTTPTimeseriesGroupBotClassParamsBrowserFamily = "FIREFOX"
const HTTPTimeseriesGroupBotClassParamsBrowserFamilySafari HTTPTimeseriesGroupBotClassParamsBrowserFamily = "SAFARI"
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.

DeviceType param.Field[[]HTTPTimeseriesGroupBotClassParamsDeviceType]Optional

Filters results by device type.

const HTTPTimeseriesGroupBotClassParamsDeviceTypeDesktop HTTPTimeseriesGroupBotClassParamsDeviceType = "DESKTOP"
const HTTPTimeseriesGroupBotClassParamsDeviceTypeMobile HTTPTimeseriesGroupBotClassParamsDeviceType = "MOBILE"
const HTTPTimeseriesGroupBotClassParamsDeviceTypeOther HTTPTimeseriesGroupBotClassParamsDeviceType = "OTHER"
Format param.Field[HTTPTimeseriesGroupBotClassParamsFormat]Optional

Format in which results will be returned.

const HTTPTimeseriesGroupBotClassParamsFormatJson HTTPTimeseriesGroupBotClassParamsFormat = "JSON"
const HTTPTimeseriesGroupBotClassParamsFormatCsv HTTPTimeseriesGroupBotClassParamsFormat = "CSV"
GeoID param.Field[[]string]Optional

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

HTTPProtocol param.Field[[]HTTPTimeseriesGroupBotClassParamsHTTPProtocol]Optional

Filters results by HTTP protocol (HTTP vs. HTTPS).

const HTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTP HTTPTimeseriesGroupBotClassParamsHTTPProtocol = "HTTP"
const HTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTPS HTTPTimeseriesGroupBotClassParamsHTTPProtocol = "HTTPS"
HTTPVersion param.Field[[]HTTPTimeseriesGroupBotClassParamsHTTPVersion]Optional

Filters results by HTTP version.

const HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv1 HTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv1"
const HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv2 HTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv2"
const HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv3 HTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv3"
IPVersion param.Field[[]HTTPTimeseriesGroupBotClassParamsIPVersion]Optional

Filters results by IP version (Ipv4 vs. IPv6).

const HTTPTimeseriesGroupBotClassParamsIPVersionIPv4 HTTPTimeseriesGroupBotClassParamsIPVersion = "IPv4"
const HTTPTimeseriesGroupBotClassParamsIPVersionIPv6 HTTPTimeseriesGroupBotClassParamsIPVersion = "IPv6"
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.

OS param.Field[[]HTTPTimeseriesGroupBotClassParamsOS]Optional

Filters results by operating system.

const HTTPTimeseriesGroupBotClassParamsOSWindows HTTPTimeseriesGroupBotClassParamsOS = "WINDOWS"
const HTTPTimeseriesGroupBotClassParamsOSMacosx HTTPTimeseriesGroupBotClassParamsOS = "MACOSX"
const HTTPTimeseriesGroupBotClassParamsOSIos HTTPTimeseriesGroupBotClassParamsOS = "IOS"
const HTTPTimeseriesGroupBotClassParamsOSAndroid HTTPTimeseriesGroupBotClassParamsOS = "ANDROID"
const HTTPTimeseriesGroupBotClassParamsOSChromeos HTTPTimeseriesGroupBotClassParamsOS = "CHROMEOS"
const HTTPTimeseriesGroupBotClassParamsOSLinux HTTPTimeseriesGroupBotClassParamsOS = "LINUX"
const HTTPTimeseriesGroupBotClassParamsOSSmartTv HTTPTimeseriesGroupBotClassParamsOS = "SMART_TV"
TLSVersion param.Field[[]HTTPTimeseriesGroupBotClassParamsTLSVersion]Optional

Filters results by TLS version.

const HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_0"
const HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_1"
const HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_2"
const HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_3"
const HTTPTimeseriesGroupBotClassParamsTLSVersionTlSvQuic HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSvQUIC"
ReturnsExpand Collapse
type HTTPTimeseriesGroupBotClassResponse struct{…}
Meta HTTPTimeseriesGroupBotClassResponseMeta

Metadata for the results.

AggInterval HTTPTimeseriesGroupBotClassResponseMetaAggInterval

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

One of the following:
const HTTPTimeseriesGroupBotClassResponseMetaAggIntervalFifteenMinutes HTTPTimeseriesGroupBotClassResponseMetaAggInterval = "FIFTEEN_MINUTES"
const HTTPTimeseriesGroupBotClassResponseMetaAggIntervalOneHour HTTPTimeseriesGroupBotClassResponseMetaAggInterval = "ONE_HOUR"
const HTTPTimeseriesGroupBotClassResponseMetaAggIntervalOneDay HTTPTimeseriesGroupBotClassResponseMetaAggInterval = "ONE_DAY"
const HTTPTimeseriesGroupBotClassResponseMetaAggIntervalOneWeek HTTPTimeseriesGroupBotClassResponseMetaAggInterval = "ONE_WEEK"
const HTTPTimeseriesGroupBotClassResponseMetaAggIntervalOneMonth HTTPTimeseriesGroupBotClassResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfo
Annotations []HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotation
DataSource HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceAll HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceAIBots HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceBGP HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceBots HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceCT HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDNS HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDos HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceFw HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceFwPg HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTP HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceIQI HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceNet HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceSpeed HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventTypeEvent HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventTypeGeneral HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventTypeOutage HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventTypePipeline HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly HTTPTimeseriesGroupBotClassResponseMetaConfidenceInfoAnnotationsEventType = "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 []HTTPTimeseriesGroupBotClassResponseMetaDateRange
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 HTTPTimeseriesGroupBotClassResponseMetaNormalization

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

One of the following:
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationPercentage HTTPTimeseriesGroupBotClassResponseMetaNormalization = "PERCENTAGE"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationMin0Max HTTPTimeseriesGroupBotClassResponseMetaNormalization = "MIN0_MAX"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationMinMax HTTPTimeseriesGroupBotClassResponseMetaNormalization = "MIN_MAX"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationRawValues HTTPTimeseriesGroupBotClassResponseMetaNormalization = "RAW_VALUES"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationPercentageChange HTTPTimeseriesGroupBotClassResponseMetaNormalization = "PERCENTAGE_CHANGE"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationRollingAverage HTTPTimeseriesGroupBotClassResponseMetaNormalization = "ROLLING_AVERAGE"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationOverlappedPercentage HTTPTimeseriesGroupBotClassResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const HTTPTimeseriesGroupBotClassResponseMetaNormalizationRatio HTTPTimeseriesGroupBotClassResponseMetaNormalization = "RATIO"
Units []HTTPTimeseriesGroupBotClassResponseMetaUnit

Measurement units for the results.

Name string
Value string
Serie0 HTTPTimeseriesGroupBotClassResponseSerie0
Bot []string
Human []string
Timestamps []Time

Get HTTP requests by bot class time series

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.HTTP.TimeseriesGroups.BotClass(context.TODO(), radar.HTTPTimeseriesGroupBotClassParams{

  })
  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"
        }
      ]
    },
    "serie_0": {
      "bot": [
        "10"
      ],
      "human": [
        "10"
      ],
      "timestamps": [
        "2019-12-27T18:11:19.117Z"
      ]
    }
  },
  "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"
        }
      ]
    },
    "serie_0": {
      "bot": [
        "10"
      ],
      "human": [
        "10"
      ],
      "timestamps": [
        "2019-12-27T18:11:19.117Z"
      ]
    }
  },
  "success": true
}