Skip to content
Start here

Get top locations by HTTP requests for a device type

client.Radar.HTTP.Locations.DeviceType.Get(ctx, deviceType, query) (*HTTPLocationDeviceTypeGetResponse, error)
GET/radar/http/top/locations/device_type/{device_type}

Retrieves the top locations, by HTTP requests, of the requested device type.

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 HTTPLocationDeviceTypeGetParamsDeviceTypeDesktop HTTPLocationDeviceTypeGetParamsDeviceType = "DESKTOP"
const HTTPLocationDeviceTypeGetParamsDeviceTypeMobile HTTPLocationDeviceTypeGetParamsDeviceType = "MOBILE"
const HTTPLocationDeviceTypeGetParamsDeviceTypeOther HTTPLocationDeviceTypeGetParamsDeviceType = "OTHER"
query HTTPLocationDeviceTypeGetParams
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[[]HTTPLocationDeviceTypeGetParamsBotClass]optional

Filters results by bot class. Refer to Bot classes.

const HTTPLocationDeviceTypeGetParamsBotClassLikelyAutomated HTTPLocationDeviceTypeGetParamsBotClass = "LIKELY_AUTOMATED"
const HTTPLocationDeviceTypeGetParamsBotClassLikelyHuman HTTPLocationDeviceTypeGetParamsBotClass = "LIKELY_HUMAN"
BrowserFamily param.Field[[]HTTPLocationDeviceTypeGetParamsBrowserFamily]optional

Filters results by browser family.

const HTTPLocationDeviceTypeGetParamsBrowserFamilyChrome HTTPLocationDeviceTypeGetParamsBrowserFamily = "CHROME"
const HTTPLocationDeviceTypeGetParamsBrowserFamilyEdge HTTPLocationDeviceTypeGetParamsBrowserFamily = "EDGE"
const HTTPLocationDeviceTypeGetParamsBrowserFamilyFirefox HTTPLocationDeviceTypeGetParamsBrowserFamily = "FIREFOX"
const HTTPLocationDeviceTypeGetParamsBrowserFamilySafari HTTPLocationDeviceTypeGetParamsBrowserFamily = "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.

Format param.Field[HTTPLocationDeviceTypeGetParamsFormat]optional

Format in which results will be returned.

const HTTPLocationDeviceTypeGetParamsFormatJson HTTPLocationDeviceTypeGetParamsFormat = "JSON"
const HTTPLocationDeviceTypeGetParamsFormatCsv HTTPLocationDeviceTypeGetParamsFormat = "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[[]HTTPLocationDeviceTypeGetParamsHTTPProtocol]optional

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

const HTTPLocationDeviceTypeGetParamsHTTPProtocolHTTP HTTPLocationDeviceTypeGetParamsHTTPProtocol = "HTTP"
const HTTPLocationDeviceTypeGetParamsHTTPProtocolHTTPS HTTPLocationDeviceTypeGetParamsHTTPProtocol = "HTTPS"
HTTPVersion param.Field[[]HTTPLocationDeviceTypeGetParamsHTTPVersion]optional

Filters results by HTTP version.

const HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv1 HTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv1"
const HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv2 HTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv2"
const HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv3 HTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv3"
IPVersion param.Field[[]HTTPLocationDeviceTypeGetParamsIPVersion]optional

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

const HTTPLocationDeviceTypeGetParamsIPVersionIPv4 HTTPLocationDeviceTypeGetParamsIPVersion = "IPv4"
const HTTPLocationDeviceTypeGetParamsIPVersionIPv6 HTTPLocationDeviceTypeGetParamsIPVersion = "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[[]HTTPLocationDeviceTypeGetParamsOS]optional

Filters results by operating system.

const HTTPLocationDeviceTypeGetParamsOSWindows HTTPLocationDeviceTypeGetParamsOS = "WINDOWS"
const HTTPLocationDeviceTypeGetParamsOSMacosx HTTPLocationDeviceTypeGetParamsOS = "MACOSX"
const HTTPLocationDeviceTypeGetParamsOSIos HTTPLocationDeviceTypeGetParamsOS = "IOS"
const HTTPLocationDeviceTypeGetParamsOSAndroid HTTPLocationDeviceTypeGetParamsOS = "ANDROID"
const HTTPLocationDeviceTypeGetParamsOSChromeos HTTPLocationDeviceTypeGetParamsOS = "CHROMEOS"
const HTTPLocationDeviceTypeGetParamsOSLinux HTTPLocationDeviceTypeGetParamsOS = "LINUX"
const HTTPLocationDeviceTypeGetParamsOSSmartTv HTTPLocationDeviceTypeGetParamsOS = "SMART_TV"
TLSVersion param.Field[[]HTTPLocationDeviceTypeGetParamsTLSVersion]optional

Filters results by TLS version.

const HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_0 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_0"
const HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_1 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_1"
const HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_2 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_2"
const HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_3 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_3"
const HTTPLocationDeviceTypeGetParamsTLSVersionTlSvQuic HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSvQUIC"
ReturnsExpand Collapse
type HTTPLocationDeviceTypeGetResponse struct{…}
Meta HTTPLocationDeviceTypeGetResponseMeta

Metadata for the results.

ConfidenceInfo HTTPLocationDeviceTypeGetResponseMetaConfidenceInfo
Annotations []HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation
DataSource HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceAll HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceAIBots HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceBGP HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceBots HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceCT HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceDNS HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceDos HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceFw HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceFwPg HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTP HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceIQI HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceNet HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceSpeed HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventTypeEvent HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventTypeGeneral HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventTypeOutage HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventTypePipeline HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationsEventType = "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 []HTTPLocationDeviceTypeGetResponseMetaDateRange
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 HTTPLocationDeviceTypeGetResponseMetaNormalization

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

One of the following:
const HTTPLocationDeviceTypeGetResponseMetaNormalizationPercentage HTTPLocationDeviceTypeGetResponseMetaNormalization = "PERCENTAGE"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationMin0Max HTTPLocationDeviceTypeGetResponseMetaNormalization = "MIN0_MAX"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationMinMax HTTPLocationDeviceTypeGetResponseMetaNormalization = "MIN_MAX"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationRawValues HTTPLocationDeviceTypeGetResponseMetaNormalization = "RAW_VALUES"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationPercentageChange HTTPLocationDeviceTypeGetResponseMetaNormalization = "PERCENTAGE_CHANGE"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationRollingAverage HTTPLocationDeviceTypeGetResponseMetaNormalization = "ROLLING_AVERAGE"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationOverlappedPercentage HTTPLocationDeviceTypeGetResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const HTTPLocationDeviceTypeGetResponseMetaNormalizationRatio HTTPLocationDeviceTypeGetResponseMetaNormalization = "RATIO"
Units []HTTPLocationDeviceTypeGetResponseMetaUnit

Measurement units for the results.

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

A numeric string.

Get top locations by HTTP requests for a device type

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"),
  )
  deviceType, err := client.Radar.HTTP.Locations.DeviceType.Get(
    context.TODO(),
    radar.HTTPLocationDeviceTypeGetParamsDeviceTypeDesktop,
    radar.HTTPLocationDeviceTypeGetParams{

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