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:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
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
}