Skip to content
Start here

Get BGP hijack events

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

Retrieves the BGP hijack 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"
hijacker_asn: Optional[int]

The potential hijacker AS of a BGP hijack event.

involved_asn: Optional[int]

The potential hijacker or victim AS of a BGP hijack event.

involved_country: Optional[str]

The country code of the potential hijacker or victim AS of a BGP hijack event.

maxLength2
minLength2
max_confidence: Optional[int]

Filters events by maximum confidence score (1-4 low, 5-7 mid, 8+ high).

min_confidence: Optional[int]

Filters events by minimum confidence score (1-4 low, 5-7 mid, 8+ high).

page: Optional[int]

Current page number, starting from 1.

exclusiveMinimum
minimum0
per_page: Optional[int]

Number of entries per page.

exclusiveMinimum
minimum0
prefix: Optional[str]
sort_by: Optional[Literal["ID", "TIME", "CONFIDENCE"]]

Sorts results by the specified field.

One of the following:
"ID"
"TIME"
"CONFIDENCE"
sort_order: Optional[Literal["ASC", "DESC"]]

Sort order.

One of the following:
"ASC"
"DESC"
victim_asn: Optional[int]

The potential victim AS of a BGP hijack event.

ReturnsExpand Collapse
class EventListResponse:
asn_info: List[ASNInfo]
asn: int
country_code: str
org_name: str
events: List[Event]
id: int
confidence_score: int
duration: int
event_type: int
hijack_msgs_count: int
hijacker_asn: int
hijacker_country: str
is_stale: bool
max_hijack_ts: str
max_msg_ts: str
min_hijack_ts: str
on_going_count: int
peer_asns: List[int]
peer_ip_count: int
prefixes: List[str]
tags: List[EventTag]
name: str
score: int
victim_asns: List[int]
victim_countries: List[str]
total_monitors: int

Get BGP hijack 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.hijacks.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,
        "confidence_score": 0,
        "duration": 0,
        "event_type": 0,
        "hijack_msgs_count": 0,
        "hijacker_asn": 0,
        "hijacker_country": "hijacker_country",
        "is_stale": true,
        "max_hijack_ts": "max_hijack_ts",
        "max_msg_ts": "max_msg_ts",
        "min_hijack_ts": "min_hijack_ts",
        "on_going_count": 0,
        "peer_asns": [
          0
        ],
        "peer_ip_count": 0,
        "prefixes": [
          "string"
        ],
        "tags": [
          {
            "name": "name",
            "score": 0
          }
        ],
        "victim_asns": [
          0
        ],
        "victim_countries": [
          "string"
        ]
      }
    ],
    "total_monitors": 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,
        "confidence_score": 0,
        "duration": 0,
        "event_type": 0,
        "hijack_msgs_count": 0,
        "hijacker_asn": 0,
        "hijacker_country": "hijacker_country",
        "is_stale": true,
        "max_hijack_ts": "max_hijack_ts",
        "max_msg_ts": "max_msg_ts",
        "min_hijack_ts": "min_hijack_ts",
        "on_going_count": 0,
        "peer_asns": [
          0
        ],
        "peer_ip_count": 0,
        "prefixes": [
          "string"
        ],
        "tags": [
          {
            "name": "name",
            "score": 0
          }
        ],
        "victim_asns": [
          0
        ],
        "victim_countries": [
          "string"
        ]
      }
    ],
    "total_monitors": 0
  },
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}