Skip to content
Start here

Get top prefixes by BGP updates

client.Radar.BGP.Top.Prefixes(ctx, query) (*BGPTopPrefixesResponse, error)
GET/radar/bgp/top/prefixes

Retrieves the top network prefixes by BGP updates.

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 BGPTopPrefixesParams
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.

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[BGPTopPrefixesParamsFormat]Optional

Format in which results will be returned.

const BGPTopPrefixesParamsFormatJson BGPTopPrefixesParamsFormat = "JSON"
const BGPTopPrefixesParamsFormatCsv BGPTopPrefixesParamsFormat = "CSV"
Limit param.Field[int64]Optional

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
Name param.Field[[]string]Optional

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

UpdateType param.Field[[]BGPTopPrefixesParamsUpdateType]Optional

Filters results by BGP update type.

const BGPTopPrefixesParamsUpdateTypeAnnouncement BGPTopPrefixesParamsUpdateType = "ANNOUNCEMENT"
const BGPTopPrefixesParamsUpdateTypeWithdrawal BGPTopPrefixesParamsUpdateType = "WITHDRAWAL"
ReturnsExpand Collapse
type BGPTopPrefixesResponse struct{…}
Meta BGPTopPrefixesResponseMeta
DateRange []BGPTopPrefixesResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
Top0 []BGPTopPrefixesResponseTop0
Prefix string
Value string

A numeric string.

Get top prefixes by BGP updates

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"),
  )
  response, err := client.Radar.BGP.Top.Prefixes(context.TODO(), radar.BGPTopPrefixesParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ]
    },
    "top_0": [
      {
        "prefix": "2804:77cc:8000::/33",
        "value": "10"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ]
    },
    "top_0": [
      {
        "prefix": "2804:77cc:8000::/33",
        "value": "10"
      }
    ]
  },
  "success": true
}