Skip to content
Start here

Get top locations by HTTP requests for a bot class

client.Radar.HTTP.Locations.BotClass.Get(ctx, botClass, query) (*HTTPLocationBotClassGetResponse, error)
GET/radar/http/top/locations/bot_class/{bot_class}

Retrieves the top locations, by HTTP requests, of the requested bot class.

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
One of the following:
const HTTPLocationBotClassGetParamsBotClassLikelyAutomated HTTPLocationBotClassGetParamsBotClass = "LIKELY_AUTOMATED"
const HTTPLocationBotClassGetParamsBotClassLikelyHuman HTTPLocationBotClassGetParamsBotClass = "LIKELY_HUMAN"
query HTTPLocationBotClassGetParams
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[[]HTTPLocationBotClassGetParamsBrowserFamily]Optional

Filters results by browser family.

const HTTPLocationBotClassGetParamsBrowserFamilyChrome HTTPLocationBotClassGetParamsBrowserFamily = "CHROME"
const HTTPLocationBotClassGetParamsBrowserFamilyEdge HTTPLocationBotClassGetParamsBrowserFamily = "EDGE"
const HTTPLocationBotClassGetParamsBrowserFamilyFirefox HTTPLocationBotClassGetParamsBrowserFamily = "FIREFOX"
const HTTPLocationBotClassGetParamsBrowserFamilySafari HTTPLocationBotClassGetParamsBrowserFamily = "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[[]HTTPLocationBotClassGetParamsDeviceType]Optional

Filters results by device type.

const HTTPLocationBotClassGetParamsDeviceTypeDesktop HTTPLocationBotClassGetParamsDeviceType = "DESKTOP"
const HTTPLocationBotClassGetParamsDeviceTypeMobile HTTPLocationBotClassGetParamsDeviceType = "MOBILE"
const HTTPLocationBotClassGetParamsDeviceTypeOther HTTPLocationBotClassGetParamsDeviceType = "OTHER"
Format param.Field[HTTPLocationBotClassGetParamsFormat]Optional

Format in which results will be returned.

const HTTPLocationBotClassGetParamsFormatJson HTTPLocationBotClassGetParamsFormat = "JSON"
const HTTPLocationBotClassGetParamsFormatCsv HTTPLocationBotClassGetParamsFormat = "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[[]HTTPLocationBotClassGetParamsHTTPProtocol]Optional

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

const HTTPLocationBotClassGetParamsHTTPProtocolHTTP HTTPLocationBotClassGetParamsHTTPProtocol = "HTTP"
const HTTPLocationBotClassGetParamsHTTPProtocolHTTPS HTTPLocationBotClassGetParamsHTTPProtocol = "HTTPS"
HTTPVersion param.Field[[]HTTPLocationBotClassGetParamsHTTPVersion]Optional

Filters results by HTTP version.

const HTTPLocationBotClassGetParamsHTTPVersionHttPv1 HTTPLocationBotClassGetParamsHTTPVersion = "HTTPv1"
const HTTPLocationBotClassGetParamsHTTPVersionHttPv2 HTTPLocationBotClassGetParamsHTTPVersion = "HTTPv2"
const HTTPLocationBotClassGetParamsHTTPVersionHttPv3 HTTPLocationBotClassGetParamsHTTPVersion = "HTTPv3"
IPVersion param.Field[[]HTTPLocationBotClassGetParamsIPVersion]Optional

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

const HTTPLocationBotClassGetParamsIPVersionIPv4 HTTPLocationBotClassGetParamsIPVersion = "IPv4"
const HTTPLocationBotClassGetParamsIPVersionIPv6 HTTPLocationBotClassGetParamsIPVersion = "IPv6"
Limit param.Field[int64]Optional

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
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[[]HTTPLocationBotClassGetParamsOS]Optional

Filters results by operating system.

const HTTPLocationBotClassGetParamsOSWindows HTTPLocationBotClassGetParamsOS = "WINDOWS"
const HTTPLocationBotClassGetParamsOSMacosx HTTPLocationBotClassGetParamsOS = "MACOSX"
const HTTPLocationBotClassGetParamsOSIos HTTPLocationBotClassGetParamsOS = "IOS"
const HTTPLocationBotClassGetParamsOSAndroid HTTPLocationBotClassGetParamsOS = "ANDROID"
const HTTPLocationBotClassGetParamsOSChromeos HTTPLocationBotClassGetParamsOS = "CHROMEOS"
const HTTPLocationBotClassGetParamsOSLinux HTTPLocationBotClassGetParamsOS = "LINUX"
const HTTPLocationBotClassGetParamsOSSmartTv HTTPLocationBotClassGetParamsOS = "SMART_TV"
TLSVersion param.Field[[]HTTPLocationBotClassGetParamsTLSVersion]Optional

Filters results by TLS version.

const HTTPLocationBotClassGetParamsTLSVersionTlSv1_0 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_0"
const HTTPLocationBotClassGetParamsTLSVersionTlSv1_1 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_1"
const HTTPLocationBotClassGetParamsTLSVersionTlSv1_2 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_2"
const HTTPLocationBotClassGetParamsTLSVersionTlSv1_3 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_3"
const HTTPLocationBotClassGetParamsTLSVersionTlSvQuic HTTPLocationBotClassGetParamsTLSVersion = "TLSvQUIC"
ReturnsExpand Collapse
type HTTPLocationBotClassGetResponse struct{…}
Meta HTTPLocationBotClassGetResponseMeta

Metadata for the results.

ConfidenceInfo HTTPLocationBotClassGetResponseMetaConfidenceInfo
Annotations []HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation
DataSource HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceAll HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceAIBots HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceBGP HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceBots HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceCT HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceDNS HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceDos HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceFw HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceFwPg HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTP HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceIQI HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceNet HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceSpeed HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventTypeEvent HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventTypeGeneral HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventTypeOutage HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventTypePipeline HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationsEventType = "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 []HTTPLocationBotClassGetResponseMetaDateRange
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 HTTPLocationBotClassGetResponseMetaNormalization

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

One of the following:
const HTTPLocationBotClassGetResponseMetaNormalizationPercentage HTTPLocationBotClassGetResponseMetaNormalization = "PERCENTAGE"
const HTTPLocationBotClassGetResponseMetaNormalizationMin0Max HTTPLocationBotClassGetResponseMetaNormalization = "MIN0_MAX"
const HTTPLocationBotClassGetResponseMetaNormalizationMinMax HTTPLocationBotClassGetResponseMetaNormalization = "MIN_MAX"
const HTTPLocationBotClassGetResponseMetaNormalizationRawValues HTTPLocationBotClassGetResponseMetaNormalization = "RAW_VALUES"
const HTTPLocationBotClassGetResponseMetaNormalizationPercentageChange HTTPLocationBotClassGetResponseMetaNormalization = "PERCENTAGE_CHANGE"
const HTTPLocationBotClassGetResponseMetaNormalizationRollingAverage HTTPLocationBotClassGetResponseMetaNormalization = "ROLLING_AVERAGE"
const HTTPLocationBotClassGetResponseMetaNormalizationOverlappedPercentage HTTPLocationBotClassGetResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const HTTPLocationBotClassGetResponseMetaNormalizationRatio HTTPLocationBotClassGetResponseMetaNormalization = "RATIO"
Units []HTTPLocationBotClassGetResponseMetaUnit

Measurement units for the results.

Name string
Value string
Top0 []HTTPLocationBotClassGetResponseTop0
ClientCountryAlpha2 string
ClientCountryName string
Value string

A numeric string.

Get top locations by HTTP requests for a bot class

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"),
  )
  botClass, err := client.Radar.HTTP.Locations.BotClass.Get(
    context.TODO(),
    radar.HTTPLocationBotClassGetParamsBotClassLikelyAutomated,
    radar.HTTPLocationBotClassGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", botClass.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"
        }
      ]
    },
    "top_0": [
      {
        "clientCountryAlpha2": "PT",
        "clientCountryName": "Portugal",
        "value": "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"
        }
      ]
    },
    "top_0": [
      {
        "clientCountryAlpha2": "PT",
        "clientCountryName": "Portugal",
        "value": "10"
      }
    ]
  },
  "success": true
}