Skip to content
Start here

Get BGP route leak events

radar.bgp.leaks.events.list(EventListParams**kwargs) -> SyncV4PagePagination[EventListResponse]
GET/radar/bgp/leaks/events

Retrieves the BGP route leak events.

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
date_end: Optional[Union[str, datetime]]

End of the date range (inclusive).

formatdate-time
date_range: Optional[str]

Filters results by date range.

date_start: Optional[Union[str, datetime]]

Start of the date range (inclusive).

formatdate-time
event_id: Optional[int]

The unique identifier of a event.

format: Optional[Literal["JSON", "CSV"]]

Format in which results will be returned.

One of the following:
"JSON"
"CSV"
involved_asn: Optional[int]

ASN that is causing or affected by a route leak event.

involved_country: Optional[str]

Country code of a involved ASN in a route leak event.

maxLength2
minLength2
leak_asn: Optional[int]

The leaking AS of a route leak event.

page: Optional[int]

Current page number, starting from 1.

exclusiveMinimum
minimum0
per_page: Optional[int]

Number of entries per page.

exclusiveMinimum
minimum0
sort_by: Optional[Literal["ID", "LEAKS", "PEERS", 3 more]]

Sorts results by the specified field.

One of the following:
"ID"
"LEAKS"
"PEERS"
"PREFIXES"
"ORIGINS"
"TIME"
sort_order: Optional[Literal["ASC", "DESC"]]

Sort order.

One of the following:
"ASC"
"DESC"
ReturnsExpand Collapse
class EventListResponse:
asn_info: List[ASNInfo]
asn: int
country_code: str
org_name: str
events: List[Event]
id: int
countries: List[str]
detected_ts: str
finished: bool
leak_asn: int
leak_count: int
leak_seg: List[int]
leak_type: int
max_ts: str
min_ts: str
origin_count: int
peer_count: int
prefix_count: int

Get BGP route leak events

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.radar.bgp.leaks.events.list()
page = page.result.items[0]
print(page.asn_info)
{
  "result": {
    "asn_info": [
      {
        "asn": 0,
        "country_code": "country_code",
        "org_name": "org_name"
      }
    ],
    "events": [
      {
        "id": 0,
        "countries": [
          "string"
        ],
        "detected_ts": "detected_ts",
        "finished": true,
        "leak_asn": 0,
        "leak_count": 0,
        "leak_seg": [
          0
        ],
        "leak_type": 0,
        "max_ts": "max_ts",
        "min_ts": "min_ts",
        "origin_count": 0,
        "peer_count": 0,
        "prefix_count": 0
      }
    ]
  },
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}
Returns Examples
{
  "result": {
    "asn_info": [
      {
        "asn": 0,
        "country_code": "country_code",
        "org_name": "org_name"
      }
    ],
    "events": [
      {
        "id": 0,
        "countries": [
          "string"
        ],
        "detected_ts": "detected_ts",
        "finished": true,
        "leak_asn": 0,
        "leak_count": 0,
        "leak_seg": [
          0
        ],
        "leak_type": 0,
        "max_ts": "max_ts",
        "min_ts": "min_ts",
        "origin_count": 0,
        "peer_count": 0,
        "prefix_count": 0
      }
    ]
  },
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}