Skip to content
Start here

Get layer 3 attacks by bytes time series

client.Radar.Attacks.Layer3.Timeseries(ctx, query) (*AttackLayer3TimeseriesResponse, error)
GET/radar/attacks/layer3/timeseries

Retrieves layer 3 attacks over time.

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 AttackLayer3TimeseriesParams
AggInterval param.Field[AttackLayer3TimeseriesParamsAggInterval]optional

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

const AttackLayer3TimeseriesParamsAggInterval15m AttackLayer3TimeseriesParamsAggInterval = "15m"
const AttackLayer3TimeseriesParamsAggInterval1h AttackLayer3TimeseriesParamsAggInterval = "1h"
const AttackLayer3TimeseriesParamsAggInterval1d AttackLayer3TimeseriesParamsAggInterval = "1d"
const AttackLayer3TimeseriesParamsAggInterval1w AttackLayer3TimeseriesParamsAggInterval = "1w"
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.

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.

Direction param.Field[AttackLayer3TimeseriesParamsDirection]optional

Specifies whether the location filter applies to the source or target location.

const AttackLayer3TimeseriesParamsDirectionOrigin AttackLayer3TimeseriesParamsDirection = "ORIGIN"
const AttackLayer3TimeseriesParamsDirectionTarget AttackLayer3TimeseriesParamsDirection = "TARGET"
Format param.Field[AttackLayer3TimeseriesParamsFormat]optional

Format in which results will be returned.

const AttackLayer3TimeseriesParamsFormatJson AttackLayer3TimeseriesParamsFormat = "JSON"
const AttackLayer3TimeseriesParamsFormatCsv AttackLayer3TimeseriesParamsFormat = "CSV"
IPVersion param.Field[[]AttackLayer3TimeseriesParamsIPVersion]optional

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

const AttackLayer3TimeseriesParamsIPVersionIPv4 AttackLayer3TimeseriesParamsIPVersion = "IPv4"
const AttackLayer3TimeseriesParamsIPVersionIPv6 AttackLayer3TimeseriesParamsIPVersion = "IPv6"
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.

Metric param.Field[AttackLayer3TimeseriesParamsMetric]optional

Measurement units, eg. bytes.

const AttackLayer3TimeseriesParamsMetricBytes AttackLayer3TimeseriesParamsMetric = "BYTES"
const AttackLayer3TimeseriesParamsMetricBytesOld AttackLayer3TimeseriesParamsMetric = "BYTES_OLD"
Name param.Field[[]string]optional

Array of names used to label the series in the response.

Normalization param.Field[AttackLayer3TimeseriesParamsNormalization]optional

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

const AttackLayer3TimeseriesParamsNormalizationPercentageChange AttackLayer3TimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
const AttackLayer3TimeseriesParamsNormalizationMin0Max AttackLayer3TimeseriesParamsNormalization = "MIN0_MAX"
Protocol param.Field[[]AttackLayer3TimeseriesParamsProtocol]optional

Filters the results by layer 3/4 protocol.

const AttackLayer3TimeseriesParamsProtocolUdp AttackLayer3TimeseriesParamsProtocol = "UDP"
const AttackLayer3TimeseriesParamsProtocolTCP AttackLayer3TimeseriesParamsProtocol = "TCP"
const AttackLayer3TimeseriesParamsProtocolIcmp AttackLayer3TimeseriesParamsProtocol = "ICMP"
const AttackLayer3TimeseriesParamsProtocolGRE AttackLayer3TimeseriesParamsProtocol = "GRE"
ReturnsExpand Collapse
type AttackLayer3TimeseriesResponse struct{…}
Meta AttackLayer3TimeseriesResponseMeta

Metadata for the results.

AggInterval AttackLayer3TimeseriesResponseMetaAggInterval

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

One of the following:
const AttackLayer3TimeseriesResponseMetaAggIntervalFifteenMinutes AttackLayer3TimeseriesResponseMetaAggInterval = "FIFTEEN_MINUTES"
const AttackLayer3TimeseriesResponseMetaAggIntervalOneHour AttackLayer3TimeseriesResponseMetaAggInterval = "ONE_HOUR"
const AttackLayer3TimeseriesResponseMetaAggIntervalOneDay AttackLayer3TimeseriesResponseMetaAggInterval = "ONE_DAY"
const AttackLayer3TimeseriesResponseMetaAggIntervalOneWeek AttackLayer3TimeseriesResponseMetaAggInterval = "ONE_WEEK"
const AttackLayer3TimeseriesResponseMetaAggIntervalOneMonth AttackLayer3TimeseriesResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo AttackLayer3TimeseriesResponseMetaConfidenceInfo
Annotations []AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotation
DataSource AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAll AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBGP AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBots AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceCT AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNS AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDos AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFw AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceIQI AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceNet AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeEvent AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeOutage AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePipeline AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AttackLayer3TimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "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 []AttackLayer3TimeseriesResponseMetaDateRange
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 AttackLayer3TimeseriesResponseMetaNormalization

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

One of the following:
const AttackLayer3TimeseriesResponseMetaNormalizationPercentage AttackLayer3TimeseriesResponseMetaNormalization = "PERCENTAGE"
const AttackLayer3TimeseriesResponseMetaNormalizationMin0Max AttackLayer3TimeseriesResponseMetaNormalization = "MIN0_MAX"
const AttackLayer3TimeseriesResponseMetaNormalizationMinMax AttackLayer3TimeseriesResponseMetaNormalization = "MIN_MAX"
const AttackLayer3TimeseriesResponseMetaNormalizationRawValues AttackLayer3TimeseriesResponseMetaNormalization = "RAW_VALUES"
const AttackLayer3TimeseriesResponseMetaNormalizationPercentageChange AttackLayer3TimeseriesResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AttackLayer3TimeseriesResponseMetaNormalizationRollingAverage AttackLayer3TimeseriesResponseMetaNormalization = "ROLLING_AVERAGE"
const AttackLayer3TimeseriesResponseMetaNormalizationOverlappedPercentage AttackLayer3TimeseriesResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AttackLayer3TimeseriesResponseMetaNormalizationRatio AttackLayer3TimeseriesResponseMetaNormalization = "RATIO"
Units []AttackLayer3TimeseriesResponseMetaUnit

Measurement units for the results.

Name string
Value string

Get layer 3 attacks by bytes time series

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"),
  )
  response, err := client.Radar.Attacks.Layer3.Timeseries(context.TODO(), radar.AttackLayer3TimeseriesParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "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"
        }
      ]
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "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"
        }
      ]
    }
  },
  "success": true
}