Skip to content
Start here

Get top locations by total traffic anomalies

client.Radar.TrafficAnomalies.Locations.Get(ctx, query) (*TrafficAnomalyLocationGetResponse, error)
GET/radar/traffic_anomalies/locations

Retrieves the sum of Internet traffic anomalies, grouped by location. These anomalies are signals that might indicate an outage, automatically detected by Radar and manually verified by our team.

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 TrafficAnomalyLocationGetParams
DateEnd param.Field[Time]optional

End of the date range (inclusive).

formatdate-time
DateRange param.Field[string]optional

Filters results by date range.

DateStart param.Field[Time]optional

Start of the date range (inclusive).

formatdate-time
Format param.Field[TrafficAnomalyLocationGetParamsFormat]optional

Format in which results will be returned.

const TrafficAnomalyLocationGetParamsFormatJson TrafficAnomalyLocationGetParamsFormat = "JSON"
const TrafficAnomalyLocationGetParamsFormatCsv TrafficAnomalyLocationGetParamsFormat = "CSV"
Limit param.Field[int64]optional

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
Status param.Field[TrafficAnomalyLocationGetParamsStatus]optional
const TrafficAnomalyLocationGetParamsStatusVerified TrafficAnomalyLocationGetParamsStatus = "VERIFIED"
const TrafficAnomalyLocationGetParamsStatusUnverified TrafficAnomalyLocationGetParamsStatus = "UNVERIFIED"
ReturnsExpand Collapse
type TrafficAnomalyLocationGetResponse struct{…}
TrafficAnomalies []TrafficAnomalyLocationGetResponseTrafficAnomaly
ClientCountryAlpha2 string
ClientCountryName string
Value string

A numeric string.

Get top locations by total traffic anomalies

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"),
  )
  location, err := client.Radar.TrafficAnomalies.Locations.Get(context.TODO(), radar.TrafficAnomalyLocationGetParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", location.TrafficAnomalies)
}
{
  "result": {
    "trafficAnomalies": [
      {
        "clientCountryAlpha2": "PT",
        "clientCountryName": "Portugal",
        "value": "10"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "result": {
    "trafficAnomalies": [
      {
        "clientCountryAlpha2": "PT",
        "clientCountryName": "Portugal",
        "value": "10"
      }
    ]
  },
  "success": true
}