Skip to content
Start here

Get top locations by HTTP requests for an HTTP version

client.Radar.HTTP.Locations.HTTPMethod.Get(ctx, httpVersion, query) (*HTTPLocationHTTPMethodGetResponse, error)
GET/radar/http/top/locations/http_version/{http_version}

Retrieves the top locations, by HTTP requests, of the requested HTTP version.

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 HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv1 HTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv1"
const HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv2 HTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv2"
const HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv3 HTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv3"
query HTTPLocationHTTPMethodGetParams
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.

BotClass param.Field[[]HTTPLocationHTTPMethodGetParamsBotClass]Optional

Filters results by bot class. Refer to Bot classes.

const HTTPLocationHTTPMethodGetParamsBotClassLikelyAutomated HTTPLocationHTTPMethodGetParamsBotClass = "LIKELY_AUTOMATED"
const HTTPLocationHTTPMethodGetParamsBotClassLikelyHuman HTTPLocationHTTPMethodGetParamsBotClass = "LIKELY_HUMAN"
BrowserFamily param.Field[[]HTTPLocationHTTPMethodGetParamsBrowserFamily]Optional

Filters results by browser family.

const HTTPLocationHTTPMethodGetParamsBrowserFamilyChrome HTTPLocationHTTPMethodGetParamsBrowserFamily = "CHROME"
const HTTPLocationHTTPMethodGetParamsBrowserFamilyEdge HTTPLocationHTTPMethodGetParamsBrowserFamily = "EDGE"
const HTTPLocationHTTPMethodGetParamsBrowserFamilyFirefox HTTPLocationHTTPMethodGetParamsBrowserFamily = "FIREFOX"
const HTTPLocationHTTPMethodGetParamsBrowserFamilySafari HTTPLocationHTTPMethodGetParamsBrowserFamily = "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[[]HTTPLocationHTTPMethodGetParamsDeviceType]Optional

Filters results by device type.

const HTTPLocationHTTPMethodGetParamsDeviceTypeDesktop HTTPLocationHTTPMethodGetParamsDeviceType = "DESKTOP"
const HTTPLocationHTTPMethodGetParamsDeviceTypeMobile HTTPLocationHTTPMethodGetParamsDeviceType = "MOBILE"
const HTTPLocationHTTPMethodGetParamsDeviceTypeOther HTTPLocationHTTPMethodGetParamsDeviceType = "OTHER"
Format param.Field[HTTPLocationHTTPMethodGetParamsFormat]Optional

Format in which results will be returned.

const HTTPLocationHTTPMethodGetParamsFormatJson HTTPLocationHTTPMethodGetParamsFormat = "JSON"
const HTTPLocationHTTPMethodGetParamsFormatCsv HTTPLocationHTTPMethodGetParamsFormat = "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[[]HTTPLocationHTTPMethodGetParamsHTTPProtocol]Optional

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

const HTTPLocationHTTPMethodGetParamsHTTPProtocolHTTP HTTPLocationHTTPMethodGetParamsHTTPProtocol = "HTTP"
const HTTPLocationHTTPMethodGetParamsHTTPProtocolHTTPS HTTPLocationHTTPMethodGetParamsHTTPProtocol = "HTTPS"
IPVersion param.Field[[]HTTPLocationHTTPMethodGetParamsIPVersion]Optional

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

const HTTPLocationHTTPMethodGetParamsIPVersionIPv4 HTTPLocationHTTPMethodGetParamsIPVersion = "IPv4"
const HTTPLocationHTTPMethodGetParamsIPVersionIPv6 HTTPLocationHTTPMethodGetParamsIPVersion = "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[[]HTTPLocationHTTPMethodGetParamsOS]Optional

Filters results by operating system.

const HTTPLocationHTTPMethodGetParamsOSWindows HTTPLocationHTTPMethodGetParamsOS = "WINDOWS"
const HTTPLocationHTTPMethodGetParamsOSMacosx HTTPLocationHTTPMethodGetParamsOS = "MACOSX"
const HTTPLocationHTTPMethodGetParamsOSIos HTTPLocationHTTPMethodGetParamsOS = "IOS"
const HTTPLocationHTTPMethodGetParamsOSAndroid HTTPLocationHTTPMethodGetParamsOS = "ANDROID"
const HTTPLocationHTTPMethodGetParamsOSChromeos HTTPLocationHTTPMethodGetParamsOS = "CHROMEOS"
const HTTPLocationHTTPMethodGetParamsOSLinux HTTPLocationHTTPMethodGetParamsOS = "LINUX"
const HTTPLocationHTTPMethodGetParamsOSSmartTv HTTPLocationHTTPMethodGetParamsOS = "SMART_TV"
TLSVersion param.Field[[]HTTPLocationHTTPMethodGetParamsTLSVersion]Optional

Filters results by TLS version.

const HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_0 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_0"
const HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_1 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_1"
const HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_2 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_2"
const HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_3 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_3"
const HTTPLocationHTTPMethodGetParamsTLSVersionTlSvQuic HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSvQUIC"
ReturnsExpand Collapse
type HTTPLocationHTTPMethodGetResponse struct{…}
Meta HTTPLocationHTTPMethodGetResponseMeta

Metadata for the results.

ConfidenceInfo HTTPLocationHTTPMethodGetResponseMetaConfidenceInfo
Annotations []HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation
DataSource HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceAll HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceAIBots HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceBGP HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceBots HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceCT HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceDNS HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceDos HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceFw HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceFwPg HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTP HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceIQI HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceNet HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceSpeed HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventTypeEvent HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventTypeGeneral HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventTypeOutage HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventTypePipeline HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationsEventType = "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 []HTTPLocationHTTPMethodGetResponseMetaDateRange
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 HTTPLocationHTTPMethodGetResponseMetaNormalization

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

One of the following:
const HTTPLocationHTTPMethodGetResponseMetaNormalizationPercentage HTTPLocationHTTPMethodGetResponseMetaNormalization = "PERCENTAGE"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationMin0Max HTTPLocationHTTPMethodGetResponseMetaNormalization = "MIN0_MAX"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationMinMax HTTPLocationHTTPMethodGetResponseMetaNormalization = "MIN_MAX"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationRawValues HTTPLocationHTTPMethodGetResponseMetaNormalization = "RAW_VALUES"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationPercentageChange HTTPLocationHTTPMethodGetResponseMetaNormalization = "PERCENTAGE_CHANGE"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationRollingAverage HTTPLocationHTTPMethodGetResponseMetaNormalization = "ROLLING_AVERAGE"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationOverlappedPercentage HTTPLocationHTTPMethodGetResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const HTTPLocationHTTPMethodGetResponseMetaNormalizationRatio HTTPLocationHTTPMethodGetResponseMetaNormalization = "RATIO"
Units []HTTPLocationHTTPMethodGetResponseMetaUnit

Measurement units for the results.

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

A numeric string.

Get top locations by HTTP requests for an HTTP version

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"),
  )
  httpMethod, err := client.Radar.HTTP.Locations.HTTPMethod.Get(
    context.TODO(),
    radar.HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv1,
    radar.HTTPLocationHTTPMethodGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", httpMethod.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
}