Skip to content
Start here

Get HTTP requests by bot class summary

client.Radar.HTTP.Summary.BotClass(ctx, query) (*HTTPSummaryBotClassResponse, error)
GET/radar/http/summary/bot_class

Retrieves the distribution of bot-generated HTTP requests to genuine human traffic, as classified by Cloudflare. 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 HTTPSummaryBotClassParams
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[[]HTTPSummaryBotClassParamsBrowserFamily]Optional

Filters results by browser family.

const HTTPSummaryBotClassParamsBrowserFamilyChrome HTTPSummaryBotClassParamsBrowserFamily = "CHROME"
const HTTPSummaryBotClassParamsBrowserFamilyEdge HTTPSummaryBotClassParamsBrowserFamily = "EDGE"
const HTTPSummaryBotClassParamsBrowserFamilyFirefox HTTPSummaryBotClassParamsBrowserFamily = "FIREFOX"
const HTTPSummaryBotClassParamsBrowserFamilySafari HTTPSummaryBotClassParamsBrowserFamily = "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[[]HTTPSummaryBotClassParamsDeviceType]Optional

Filters results by device type.

const HTTPSummaryBotClassParamsDeviceTypeDesktop HTTPSummaryBotClassParamsDeviceType = "DESKTOP"
const HTTPSummaryBotClassParamsDeviceTypeMobile HTTPSummaryBotClassParamsDeviceType = "MOBILE"
const HTTPSummaryBotClassParamsDeviceTypeOther HTTPSummaryBotClassParamsDeviceType = "OTHER"
Format param.Field[HTTPSummaryBotClassParamsFormat]Optional

Format in which results will be returned.

const HTTPSummaryBotClassParamsFormatJson HTTPSummaryBotClassParamsFormat = "JSON"
const HTTPSummaryBotClassParamsFormatCsv HTTPSummaryBotClassParamsFormat = "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[[]HTTPSummaryBotClassParamsHTTPProtocol]Optional

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

const HTTPSummaryBotClassParamsHTTPProtocolHTTP HTTPSummaryBotClassParamsHTTPProtocol = "HTTP"
const HTTPSummaryBotClassParamsHTTPProtocolHTTPS HTTPSummaryBotClassParamsHTTPProtocol = "HTTPS"
HTTPVersion param.Field[[]HTTPSummaryBotClassParamsHTTPVersion]Optional

Filters results by HTTP version.

const HTTPSummaryBotClassParamsHTTPVersionHttPv1 HTTPSummaryBotClassParamsHTTPVersion = "HTTPv1"
const HTTPSummaryBotClassParamsHTTPVersionHttPv2 HTTPSummaryBotClassParamsHTTPVersion = "HTTPv2"
const HTTPSummaryBotClassParamsHTTPVersionHttPv3 HTTPSummaryBotClassParamsHTTPVersion = "HTTPv3"
IPVersion param.Field[[]HTTPSummaryBotClassParamsIPVersion]Optional

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

const HTTPSummaryBotClassParamsIPVersionIPv4 HTTPSummaryBotClassParamsIPVersion = "IPv4"
const HTTPSummaryBotClassParamsIPVersionIPv6 HTTPSummaryBotClassParamsIPVersion = "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[[]HTTPSummaryBotClassParamsOS]Optional

Filters results by operating system.

const HTTPSummaryBotClassParamsOSWindows HTTPSummaryBotClassParamsOS = "WINDOWS"
const HTTPSummaryBotClassParamsOSMacosx HTTPSummaryBotClassParamsOS = "MACOSX"
const HTTPSummaryBotClassParamsOSIos HTTPSummaryBotClassParamsOS = "IOS"
const HTTPSummaryBotClassParamsOSAndroid HTTPSummaryBotClassParamsOS = "ANDROID"
const HTTPSummaryBotClassParamsOSChromeos HTTPSummaryBotClassParamsOS = "CHROMEOS"
const HTTPSummaryBotClassParamsOSLinux HTTPSummaryBotClassParamsOS = "LINUX"
const HTTPSummaryBotClassParamsOSSmartTv HTTPSummaryBotClassParamsOS = "SMART_TV"
TLSVersion param.Field[[]HTTPSummaryBotClassParamsTLSVersion]Optional

Filters results by TLS version.

const HTTPSummaryBotClassParamsTLSVersionTlSv1_0 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_0"
const HTTPSummaryBotClassParamsTLSVersionTlSv1_1 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_1"
const HTTPSummaryBotClassParamsTLSVersionTlSv1_2 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_2"
const HTTPSummaryBotClassParamsTLSVersionTlSv1_3 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_3"
const HTTPSummaryBotClassParamsTLSVersionTlSvQuic HTTPSummaryBotClassParamsTLSVersion = "TLSvQUIC"
ReturnsExpand Collapse
type HTTPSummaryBotClassResponse struct{…}
Meta HTTPSummaryBotClassResponseMeta

Metadata for the results.

ConfidenceInfo HTTPSummaryBotClassResponseMetaConfidenceInfo
Annotations []HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation
DataSource HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceAll HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceAIBots HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceBGP HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceBots HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceCT HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDNS HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceDos HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceFw HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceFwPg HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTP HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceIQI HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceNet HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceSpeed HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventTypeEvent HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventTypeGeneral HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventTypeOutage HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventTypePipeline HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationsEventType = "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 []HTTPSummaryBotClassResponseMetaDateRange
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 HTTPSummaryBotClassResponseMetaNormalization

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

One of the following:
const HTTPSummaryBotClassResponseMetaNormalizationPercentage HTTPSummaryBotClassResponseMetaNormalization = "PERCENTAGE"
const HTTPSummaryBotClassResponseMetaNormalizationMin0Max HTTPSummaryBotClassResponseMetaNormalization = "MIN0_MAX"
const HTTPSummaryBotClassResponseMetaNormalizationMinMax HTTPSummaryBotClassResponseMetaNormalization = "MIN_MAX"
const HTTPSummaryBotClassResponseMetaNormalizationRawValues HTTPSummaryBotClassResponseMetaNormalization = "RAW_VALUES"
const HTTPSummaryBotClassResponseMetaNormalizationPercentageChange HTTPSummaryBotClassResponseMetaNormalization = "PERCENTAGE_CHANGE"
const HTTPSummaryBotClassResponseMetaNormalizationRollingAverage HTTPSummaryBotClassResponseMetaNormalization = "ROLLING_AVERAGE"
const HTTPSummaryBotClassResponseMetaNormalizationOverlappedPercentage HTTPSummaryBotClassResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const HTTPSummaryBotClassResponseMetaNormalizationRatio HTTPSummaryBotClassResponseMetaNormalization = "RATIO"
Units []HTTPSummaryBotClassResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 HTTPSummaryBotClassResponseSummary0
Bot string

A numeric string.

Human string

A numeric string.

Get HTTP requests by bot class summary

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.Summary.BotClass(context.TODO(), radar.HTTPSummaryBotClassParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "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"
        }
      ]
    },
    "summary_0": {
      "bot": "10",
      "human": "10"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "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"
        }
      ]
    },
    "summary_0": {
      "bot": "10",
      "human": "10"
    }
  },
  "success": true
}