# BGP ## Get BGP time series `radar.bgp.timeseries(BGPTimeseriesParams**kwargs) -> BGPTimeseriesResponse` **get** `/radar/bgp/timeseries` Retrieves BGP updates over time. When requesting updates for an autonomous system, only BGP updates of type announcement are returned. ### Parameters - `agg_interval: Optional[Literal["15m", "1h", "1d", "1w"]]` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - `"15m"` - `"1h"` - `"1d"` - `"1w"` - `asn: Optional[SequenceNotStr[str]]` 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. - `date_end: Optional[SequenceNotStr[Union[str, datetime]]]` End of the date range (inclusive). - `date_range: Optional[SequenceNotStr[str]]` 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). - `date_start: Optional[SequenceNotStr[Union[str, datetime]]]` Start of the date range. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `name: Optional[SequenceNotStr[str]]` Array of names used to label the series in the response. - `prefix: Optional[SequenceNotStr[str]]` Filters results by BGP network prefix. - `update_type: Optional[List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]]]` Filters results by BGP update type. - `"ANNOUNCEMENT"` - `"WITHDRAWAL"` ### Returns - `class BGPTimeseriesResponse: …` - `meta: Meta` - `agg_interval: Literal["15m", "1h", "1d", "1w"]` - `"15m"` - `"1h"` - `"1d"` - `"1w"` - `confidence_info: MetaConfidenceInfo` - `annotations: List[MetaConfidenceInfoAnnotation]` - `data_source: Literal["ALL", "AI_BOTS", "AI_GATEWAY", 22 more]` Data source for annotations. - `"ALL"` - `"AI_BOTS"` - `"AI_GATEWAY"` - `"BGP"` - `"BOTS"` - `"CONNECTION_ANOMALY"` - `"CT"` - `"DNS"` - `"DNS_MAGNITUDE"` - `"DNS_AS112"` - `"DOS"` - `"EMAIL_ROUTING"` - `"EMAIL_SECURITY"` - `"FW"` - `"FW_PG"` - `"HTTP"` - `"HTTP_CONTROL"` - `"HTTP_CRAWLER_REFERER"` - `"HTTP_ORIGINS"` - `"IQI"` - `"LEAKED_CREDENTIALS"` - `"NET"` - `"ROBOTS_TXT"` - `"SPEED"` - `"WORKERS_AI"` - `description: str` - `end_date: datetime` - `event_type: Literal["EVENT", "GENERAL", "OUTAGE", 3 more]` Event type for annotations. - `"EVENT"` - `"GENERAL"` - `"OUTAGE"` - `"PARTIAL_PROJECTION"` - `"PIPELINE"` - `"TRAFFIC_ANOMALY"` - `is_instantaneous: bool` Whether event is a single point in time or a time range. - `linked_url: str` - `start_date: datetime` - `level: int` Provides an indication of how much confidence Cloudflare has in the data. - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `last_updated: datetime` - `serie_0: Serie0` - `timestamps: List[datetime]` - `values: List[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.timeseries() print(response.meta) ``` #### Response ```json { "result": { "meta": { "aggInterval": "15m", "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" }, "serie_0": { "timestamps": [ "2019-12-27T18:11:19.117Z" ], "values": [ "10" ] } }, "success": true } ``` ## Domain Types ### BGP Timeseries Response - `class BGPTimeseriesResponse: …` - `meta: Meta` - `agg_interval: Literal["15m", "1h", "1d", "1w"]` - `"15m"` - `"1h"` - `"1d"` - `"1w"` - `confidence_info: MetaConfidenceInfo` - `annotations: List[MetaConfidenceInfoAnnotation]` - `data_source: Literal["ALL", "AI_BOTS", "AI_GATEWAY", 22 more]` Data source for annotations. - `"ALL"` - `"AI_BOTS"` - `"AI_GATEWAY"` - `"BGP"` - `"BOTS"` - `"CONNECTION_ANOMALY"` - `"CT"` - `"DNS"` - `"DNS_MAGNITUDE"` - `"DNS_AS112"` - `"DOS"` - `"EMAIL_ROUTING"` - `"EMAIL_SECURITY"` - `"FW"` - `"FW_PG"` - `"HTTP"` - `"HTTP_CONTROL"` - `"HTTP_CRAWLER_REFERER"` - `"HTTP_ORIGINS"` - `"IQI"` - `"LEAKED_CREDENTIALS"` - `"NET"` - `"ROBOTS_TXT"` - `"SPEED"` - `"WORKERS_AI"` - `description: str` - `end_date: datetime` - `event_type: Literal["EVENT", "GENERAL", "OUTAGE", 3 more]` Event type for annotations. - `"EVENT"` - `"GENERAL"` - `"OUTAGE"` - `"PARTIAL_PROJECTION"` - `"PIPELINE"` - `"TRAFFIC_ANOMALY"` - `is_instantaneous: bool` Whether event is a single point in time or a time range. - `linked_url: str` - `start_date: datetime` - `level: int` Provides an indication of how much confidence Cloudflare has in the data. - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `last_updated: datetime` - `serie_0: Serie0` - `timestamps: List[datetime]` - `values: List[str]` # Leaks # Events ## 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. ### Parameters - `date_end: Optional[Union[str, datetime]]` End of the date range (inclusive). - `date_range: Optional[str]` Filters results by date range. - `date_start: Optional[Union[str, datetime]]` Start of the date range (inclusive). - `event_id: Optional[int]` The unique identifier of a event. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"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. - `leak_asn: Optional[int]` The leaking AS of a route leak event. - `page: Optional[int]` Current page number, starting from 1. - `per_page: Optional[int]` Number of entries per page. - `sort_by: Optional[Literal["ID", "LEAKS", "PEERS", 3 more]]` Sorts results by the specified field. - `"ID"` - `"LEAKS"` - `"PEERS"` - `"PREFIXES"` - `"ORIGINS"` - `"TIME"` - `sort_order: Optional[Literal["ASC", "DESC"]]` Sort order. - `"ASC"` - `"DESC"` ### Returns - `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` ### Example ```python 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) ``` #### Response ```json { "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 } ``` ## Domain Types ### Event List Response - `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` # Top ## Get top prefixes by BGP updates `radar.bgp.top.prefixes(TopPrefixesParams**kwargs) -> TopPrefixesResponse` **get** `/radar/bgp/top/prefixes` Retrieves the top network prefixes by BGP updates. ### Parameters - `asn: Optional[SequenceNotStr[str]]` 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. - `date_end: Optional[SequenceNotStr[Union[str, datetime]]]` End of the date range (inclusive). - `date_range: Optional[SequenceNotStr[str]]` 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). - `date_start: Optional[SequenceNotStr[Union[str, datetime]]]` Start of the date range. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `limit: Optional[int]` Limits the number of objects returned in the response. - `name: Optional[SequenceNotStr[str]]` Array of names used to label the series in the response. - `update_type: Optional[List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]]]` Filters results by BGP update type. - `"ANNOUNCEMENT"` - `"WITHDRAWAL"` ### Returns - `class TopPrefixesResponse: …` - `meta: Meta` - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `top_0: List[Top0]` - `prefix: str` - `value: str` A numeric string. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.top.prefixes() print(response.meta) ``` #### Response ```json { "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 } ``` ## Domain Types ### Top Prefixes Response - `class TopPrefixesResponse: …` - `meta: Meta` - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `top_0: List[Top0]` - `prefix: str` - `value: str` A numeric string. # Ases ## Get top ASes by BGP updates `radar.bgp.top.ases.get(AseGetParams**kwargs) -> AseGetResponse` **get** `/radar/bgp/top/ases` Retrieves the top autonomous systems by BGP updates (announcements only). ### Parameters - `asn: Optional[SequenceNotStr[str]]` 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. - `date_end: Optional[SequenceNotStr[Union[str, datetime]]]` End of the date range (inclusive). - `date_range: Optional[SequenceNotStr[str]]` 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). - `date_start: Optional[SequenceNotStr[Union[str, datetime]]]` Start of the date range. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `limit: Optional[int]` Limits the number of objects returned in the response. - `name: Optional[SequenceNotStr[str]]` Array of names used to label the series in the response. - `prefix: Optional[SequenceNotStr[str]]` Filters results by BGP network prefix. - `update_type: Optional[List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]]]` Filters results by BGP update type. - `"ANNOUNCEMENT"` - `"WITHDRAWAL"` ### Returns - `class AseGetResponse: …` - `meta: Meta` - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `top_0: List[Top0]` - `asn: int` - `as_name: str` - `value: str` Percentage of updates by this AS out of the total updates by all autonomous systems. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) ase = client.radar.bgp.top.ases.get() print(ase.meta) ``` #### Response ```json { "result": { "meta": { "dateRange": [ { "endTime": "2022-09-17T10:22:57.555Z", "startTime": "2022-09-16T10:22:57.555Z" } ] }, "top_0": [ { "asn": 714, "ASName": "Apple-Engineering", "value": "0.73996" } ] }, "success": true } ``` ## Get top ASes by prefix count `radar.bgp.top.ases.prefixes(AsePrefixesParams**kwargs) -> AsePrefixesResponse` **get** `/radar/bgp/top/ases/prefixes` Retrieves the full list of autonomous systems on the global routing table ordered by announced prefixes count. The data comes from public BGP MRT data archives and updates every 2 hours. ### Parameters - `country: Optional[str]` Alpha-2 country code. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `limit: Optional[int]` Maximum number of ASes to return. ### Returns - `class AsePrefixesResponse: …` - `asns: List[ASN]` - `asn: int` - `country: str` - `name: str` - `pfxs_count: int` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.top.ases.prefixes() print(response.asns) ``` #### Response ```json { "result": { "asns": [ { "asn": 0, "country": "country", "name": "name", "pfxs_count": 0 } ], "meta": { "data_time": "data_time", "query_time": "query_time", "total_peers": 0 } }, "success": true } ``` ## Domain Types ### Ase Get Response - `class AseGetResponse: …` - `meta: Meta` - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `top_0: List[Top0]` - `asn: int` - `as_name: str` - `value: str` Percentage of updates by this AS out of the total updates by all autonomous systems. ### Ase Prefixes Response - `class AsePrefixesResponse: …` - `asns: List[ASN]` - `asn: int` - `country: str` - `name: str` - `pfxs_count: int` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` # Hijacks # Events ## Get BGP hijack events `radar.bgp.hijacks.events.list(EventListParams**kwargs) -> SyncV4PagePagination[EventListResponse]` **get** `/radar/bgp/hijacks/events` Retrieves the BGP hijack events. ### Parameters - `date_end: Optional[Union[str, datetime]]` End of the date range (inclusive). - `date_range: Optional[str]` Filters results by date range. - `date_start: Optional[Union[str, datetime]]` Start of the date range (inclusive). - `event_id: Optional[int]` The unique identifier of a event. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"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. - `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. - `per_page: Optional[int]` Number of entries per page. - `prefix: Optional[str]` - `sort_by: Optional[Literal["ID", "TIME", "CONFIDENCE"]]` Sorts results by the specified field. - `"ID"` - `"TIME"` - `"CONFIDENCE"` - `sort_order: Optional[Literal["ASC", "DESC"]]` Sort order. - `"ASC"` - `"DESC"` - `victim_asn: Optional[int]` The potential victim AS of a BGP hijack event. ### Returns - `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` ### Example ```python 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) ``` #### Response ```json { "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 } ``` ## Domain Types ### Event List Response - `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` # Routes ## Get Multi-Origin AS (MOAS) prefixes `radar.bgp.routes.moas(RouteMoasParams**kwargs) -> RouteMoasResponse` **get** `/radar/bgp/routes/moas` Retrieves all Multi-Origin AS (MOAS) prefixes in the global routing tables. ### Parameters - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `invalid_only: Optional[bool]` Lookup only RPKI invalid MOASes. - `origin: Optional[int]` Lookup MOASes originated by the given ASN. - `prefix: Optional[str]` ### Returns - `class RouteMoasResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `moas: List[Moa]` - `origins: List[MoaOrigin]` - `origin: int` - `peer_count: int` - `rpki_validation: str` - `prefix: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.routes.moas() print(response.meta) ``` #### Response ```json { "result": { "meta": { "data_time": "data_time", "query_time": "query_time", "total_peers": 0 }, "moas": [ { "origins": [ { "origin": 0, "peer_count": 0, "rpki_validation": "rpki_validation" } ], "prefix": "prefix" } ] }, "success": true } ``` ## Get prefix-to-ASN mapping `radar.bgp.routes.pfx2as(RoutePfx2asParams**kwargs) -> RoutePfx2asResponse` **get** `/radar/bgp/routes/pfx2as` Retrieves the prefix-to-ASN mapping from global routing tables. ### Parameters - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `longest_prefix_match: Optional[bool]` Return only results with the longest prefix match for the given prefix. For example, specify a /32 prefix to lookup the origin ASN for an IPv4 address. - `origin: Optional[int]` Lookup prefixes originated by the given ASN. - `prefix: Optional[str]` - `rpki_status: Optional[Literal["VALID", "INVALID", "UNKNOWN"]]` Return only results with matching rpki status: valid, invalid or unknown. - `"VALID"` - `"INVALID"` - `"UNKNOWN"` ### Returns - `class RoutePfx2asResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `prefix_origins: List[PrefixOrigin]` - `origin: int` - `peer_count: int` - `prefix: str` - `rpki_validation: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.routes.pfx2as() print(response.meta) ``` #### Response ```json { "result": { "meta": { "data_time": "data_time", "query_time": "query_time", "total_peers": 0 }, "prefix_origins": [ { "origin": 0, "peer_count": 0, "prefix": "prefix", "rpki_validation": "rpki_validation" } ] }, "success": true } ``` ## Get BGP routing table stats `radar.bgp.routes.stats(RouteStatsParams**kwargs) -> RouteStatsResponse` **get** `/radar/bgp/routes/stats` Retrieves the BGP routing table stats. ### Parameters - `asn: Optional[int]` Filters results by Autonomous System. Specify a single Autonomous System Number (ASN) as integer. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `location: Optional[str]` Filters results by location. Specify an alpha-2 location code. ### Returns - `class RouteStatsResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `stats: Stats` - `distinct_origins: int` - `distinct_origins_ipv4: int` - `distinct_origins_ipv6: int` - `distinct_prefixes: int` - `distinct_prefixes_ipv4: int` - `distinct_prefixes_ipv6: int` - `routes_invalid: int` - `routes_invalid_ipv4: int` - `routes_invalid_ipv6: int` - `routes_total: int` - `routes_total_ipv4: int` - `routes_total_ipv6: int` - `routes_unknown: int` - `routes_unknown_ipv4: int` - `routes_unknown_ipv6: int` - `routes_valid: int` - `routes_valid_ipv4: int` - `routes_valid_ipv6: int` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.routes.stats() print(response.meta) ``` #### Response ```json { "result": { "meta": { "data_time": "data_time", "query_time": "query_time", "total_peers": 0 }, "stats": { "distinct_origins": 0, "distinct_origins_ipv4": 0, "distinct_origins_ipv6": 0, "distinct_prefixes": 0, "distinct_prefixes_ipv4": 0, "distinct_prefixes_ipv6": 0, "routes_invalid": 0, "routes_invalid_ipv4": 0, "routes_invalid_ipv6": 0, "routes_total": 0, "routes_total_ipv4": 0, "routes_total_ipv6": 0, "routes_unknown": 0, "routes_unknown_ipv4": 0, "routes_unknown_ipv6": 0, "routes_valid": 0, "routes_valid_ipv4": 0, "routes_valid_ipv6": 0 } }, "success": true } ``` ## List ASes from global routing tables `radar.bgp.routes.ases(RouteAsesParams**kwargs) -> RouteAsesResponse` **get** `/radar/bgp/routes/ases` Retrieves all ASes in the current global routing tables with routing statistics. ### Parameters - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `limit: Optional[int]` Limits the number of objects returned in the response. - `location: Optional[str]` Filters results by location. Specify an alpha-2 location code. - `sort_by: Optional[Literal["cone", "pfxs", "ipv4", 4 more]]` Sorts results by the specified field. - `"cone"` - `"pfxs"` - `"ipv4"` - `"ipv6"` - `"rpki_valid"` - `"rpki_invalid"` - `"rpki_unknown"` - `sort_order: Optional[Literal["ASC", "DESC"]]` Sort order. - `"ASC"` - `"DESC"` ### Returns - `class RouteAsesResponse: …` - `asns: List[ASN]` - `asn: int` - `cone_size: int` AS's customer cone size. - `country: str` Alpha-2 code for the AS's registration country. - `ipv4_count: int` Number of IPv4 addresses originated by the AS. - `ipv6_count: str` Number of IPv6 addresses originated by the AS. - `name: str` Name of the AS. - `pfxs_count: int` Number of total IP prefixes originated by the AS. - `rpki_invalid: int` Number of RPKI invalid prefixes originated by the AS. - `rpki_unknown: int` Number of RPKI unknown prefixes originated by the AS. - `rpki_valid: int` Number of RPKI valid prefixes originated by the AS. - `meta: Meta` - `data_time: str` The timestamp of when the data is generated. - `query_time: str` The timestamp of the query. - `total_peers: int` Total number of route collector peers used to generate this data. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.routes.ases() print(response.asns) ``` #### Response ```json { "result": { "asns": [ { "asn": 0, "coneSize": 0, "country": "US", "ipv4Count": 0, "ipv6Count": "1.21e24", "name": "name", "pfxsCount": 0, "rpkiInvalid": 0, "rpkiUnknown": 0, "rpkiValid": 0 } ], "meta": { "dataTime": "2024-06-03T14:00:00", "queryTime": "2024-06-03T14:00:00", "totalPeers": 0 } }, "success": true } ``` ## Get real-time BGP routes for a prefix `radar.bgp.routes.realtime(RouteRealtimeParams**kwargs) -> RouteRealtimeResponse` **get** `/radar/bgp/routes/realtime` Retrieves real-time BGP routes for a prefix, using public real-time data collectors (RouteViews and RIPE RIS). ### Parameters - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `prefix: Optional[str]` ### Returns - `class RouteRealtimeResponse: …` - `meta: Meta` - `asn_info: List[MetaASNInfo]` - `as_name: str` Name of the autonomous system. - `asn: int` AS number. - `country_code: str` Alpha-2 code for the AS's registration country. - `org_id: str` Organization ID. - `org_name: str` Organization name. - `collectors: List[MetaCollector]` - `collector: str` Public route collector ID. - `latest_realtime_ts: str` Latest real-time stream timestamp for this collector. - `latest_rib_ts: str` Latest RIB dump MRT file timestamp for this collector. - `latest_updates_ts: str` Latest BGP updates MRT file timestamp for this collector. - `peers_count: int` Total number of collector peers used from this collector. - `peers_v4_count: int` Total number of collector peers used from this collector for IPv4 prefixes. - `peers_v6_count: int` Total number of collector peers used from this collector for IPv6 prefixes. - `data_time: str` The most recent data timestamp for from the real-time sources. - `prefix_origins: List[MetaPrefixOrigin]` - `origin: int` Origin ASN. - `prefix: str` IP prefix of this query. - `rpki_validation: str` Prefix-origin RPKI validation: valid, invalid, unknown. - `total_peers: int` Total number of peers. - `total_visible: int` Total number of peers seeing this prefix. - `visibility: float` Ratio of peers seeing this prefix to total number of peers. - `query_time: str` The timestamp of this query. - `routes: List[Route]` - `as_path: List[int]` AS-level path for this route, from collector to origin. - `collector: str` Public collector ID for this route. - `communities: List[str]` BGP community values. - `prefix: str` IP prefix of this query. - `timestamp: str` Latest timestamp of change for this route. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.routes.realtime() print(response.meta) ``` #### Response ```json { "result": { "meta": { "asn_info": [ { "as_name": "as_name", "asn": 0, "country_code": "country_code", "org_id": "org_id", "org_name": "org_name" } ], "collectors": [ { "collector": "collector", "latest_realtime_ts": "latest_realtime_ts", "latest_rib_ts": "latest_rib_ts", "latest_updates_ts": "latest_updates_ts", "peers_count": 0, "peers_v4_count": 0, "peers_v6_count": 0 } ], "data_time": "data_time", "prefix_origins": [ { "origin": 0, "prefix": "prefix", "rpki_validation": "rpki_validation", "total_peers": 0, "total_visible": 0, "visibility": 0 } ], "query_time": "query_time" }, "routes": [ { "as_path": [ 0 ], "collector": "collector", "communities": [ "string" ], "prefix": "prefix", "timestamp": "timestamp" } ] }, "success": true } ``` ## Domain Types ### Route Moas Response - `class RouteMoasResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `moas: List[Moa]` - `origins: List[MoaOrigin]` - `origin: int` - `peer_count: int` - `rpki_validation: str` - `prefix: str` ### Route Pfx2as Response - `class RoutePfx2asResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `prefix_origins: List[PrefixOrigin]` - `origin: int` - `peer_count: int` - `prefix: str` - `rpki_validation: str` ### Route Stats Response - `class RouteStatsResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `stats: Stats` - `distinct_origins: int` - `distinct_origins_ipv4: int` - `distinct_origins_ipv6: int` - `distinct_prefixes: int` - `distinct_prefixes_ipv4: int` - `distinct_prefixes_ipv6: int` - `routes_invalid: int` - `routes_invalid_ipv4: int` - `routes_invalid_ipv6: int` - `routes_total: int` - `routes_total_ipv4: int` - `routes_total_ipv6: int` - `routes_unknown: int` - `routes_unknown_ipv4: int` - `routes_unknown_ipv6: int` - `routes_valid: int` - `routes_valid_ipv4: int` - `routes_valid_ipv6: int` ### Route Ases Response - `class RouteAsesResponse: …` - `asns: List[ASN]` - `asn: int` - `cone_size: int` AS's customer cone size. - `country: str` Alpha-2 code for the AS's registration country. - `ipv4_count: int` Number of IPv4 addresses originated by the AS. - `ipv6_count: str` Number of IPv6 addresses originated by the AS. - `name: str` Name of the AS. - `pfxs_count: int` Number of total IP prefixes originated by the AS. - `rpki_invalid: int` Number of RPKI invalid prefixes originated by the AS. - `rpki_unknown: int` Number of RPKI unknown prefixes originated by the AS. - `rpki_valid: int` Number of RPKI valid prefixes originated by the AS. - `meta: Meta` - `data_time: str` The timestamp of when the data is generated. - `query_time: str` The timestamp of the query. - `total_peers: int` Total number of route collector peers used to generate this data. ### Route Realtime Response - `class RouteRealtimeResponse: …` - `meta: Meta` - `asn_info: List[MetaASNInfo]` - `as_name: str` Name of the autonomous system. - `asn: int` AS number. - `country_code: str` Alpha-2 code for the AS's registration country. - `org_id: str` Organization ID. - `org_name: str` Organization name. - `collectors: List[MetaCollector]` - `collector: str` Public route collector ID. - `latest_realtime_ts: str` Latest real-time stream timestamp for this collector. - `latest_rib_ts: str` Latest RIB dump MRT file timestamp for this collector. - `latest_updates_ts: str` Latest BGP updates MRT file timestamp for this collector. - `peers_count: int` Total number of collector peers used from this collector. - `peers_v4_count: int` Total number of collector peers used from this collector for IPv4 prefixes. - `peers_v6_count: int` Total number of collector peers used from this collector for IPv6 prefixes. - `data_time: str` The most recent data timestamp for from the real-time sources. - `prefix_origins: List[MetaPrefixOrigin]` - `origin: int` Origin ASN. - `prefix: str` IP prefix of this query. - `rpki_validation: str` Prefix-origin RPKI validation: valid, invalid, unknown. - `total_peers: int` Total number of peers. - `total_visible: int` Total number of peers seeing this prefix. - `visibility: float` Ratio of peers seeing this prefix to total number of peers. - `query_time: str` The timestamp of this query. - `routes: List[Route]` - `as_path: List[int]` AS-level path for this route, from collector to origin. - `collector: str` Public collector ID for this route. - `communities: List[str]` BGP community values. - `prefix: str` IP prefix of this query. - `timestamp: str` Latest timestamp of change for this route. # IPs ## Get announced IP address space time series `radar.bgp.ips.timeseries(IPTimeseriesParams**kwargs) -> IPTimeseriesResponse` **get** `/radar/bgp/ips/timeseries` Retrieves time series data for the announced IP space count, represented as the number of IPv4 /24s and IPv6 /48s, for a given ASN. ### Parameters - `asn: Optional[SequenceNotStr[str]]` 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. - `date_end: Optional[SequenceNotStr[Union[str, datetime]]]` End of the date range (inclusive). - `date_range: Optional[SequenceNotStr[str]]` 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). - `date_start: Optional[SequenceNotStr[Union[str, datetime]]]` Start of the date range. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `include_delay: Optional[bool]` Includes data delay meta information. - `ip_version: Optional[List[Literal["IPv4", "IPv6"]]]` Filters results by IP version (Ipv4 vs. IPv6). - `"IPv4"` - `"IPv6"` - `location: Optional[SequenceNotStr[str]]` Filters results by location. Specify a comma-separated list of alpha-2 location codes. - `name: Optional[SequenceNotStr[str]]` Array of names used to label the series in the response. ### Returns - `class IPTimeseriesResponse: …` - `meta: Meta` Metadata for the results. - `agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", 2 more]` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - `"FIFTEEN_MINUTES"` - `"ONE_HOUR"` - `"ONE_DAY"` - `"ONE_WEEK"` - `"ONE_MONTH"` - `confidence_info: MetaConfidenceInfo` - `annotations: List[MetaConfidenceInfoAnnotation]` - `data_source: Literal["ALL", "AI_BOTS", "AI_GATEWAY", 22 more]` Data source for annotations. - `"ALL"` - `"AI_BOTS"` - `"AI_GATEWAY"` - `"BGP"` - `"BOTS"` - `"CONNECTION_ANOMALY"` - `"CT"` - `"DNS"` - `"DNS_MAGNITUDE"` - `"DNS_AS112"` - `"DOS"` - `"EMAIL_ROUTING"` - `"EMAIL_SECURITY"` - `"FW"` - `"FW_PG"` - `"HTTP"` - `"HTTP_CONTROL"` - `"HTTP_CRAWLER_REFERER"` - `"HTTP_ORIGINS"` - `"IQI"` - `"LEAKED_CREDENTIALS"` - `"NET"` - `"ROBOTS_TXT"` - `"SPEED"` - `"WORKERS_AI"` - `description: str` - `end_date: datetime` - `event_type: Literal["EVENT", "GENERAL", "OUTAGE", 3 more]` Event type for annotations. - `"EVENT"` - `"GENERAL"` - `"OUTAGE"` - `"PARTIAL_PROJECTION"` - `"PIPELINE"` - `"TRAFFIC_ANOMALY"` - `is_instantaneous: bool` Whether event is a single point in time or a time range. - `linked_url: str` - `start_date: datetime` - `level: int` Provides an indication of how much confidence Cloudflare has in the data. - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `last_updated: datetime` Timestamp of the last dataset update. - `normalization: Literal["PERCENTAGE", "MIN0_MAX", "MIN_MAX", 5 more]` Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - `"PERCENTAGE"` - `"MIN0_MAX"` - `"MIN_MAX"` - `"RAW_VALUES"` - `"PERCENTAGE_CHANGE"` - `"ROLLING_AVERAGE"` - `"OVERLAPPED_PERCENTAGE"` - `"RATIO"` - `units: List[MetaUnit]` Measurement units for the results. - `name: str` - `value: str` - `delay: Optional[MetaDelay]` - `asn_data: MetaDelayASNData` - `delay_secs: float` - `delay_str: str` - `healthy: bool` - `latest: MetaDelayASNDataLatest` - `entries_count: float` - `path: str` - `timestamp: float` - `country_data: MetaDelayCountryData` - `delay_secs: float` - `delay_str: str` - `healthy: bool` - `latest: MetaDelayCountryDataLatest` - `count: float` - `timestamp: float` - `healthy: bool` - `now_ts: float` - `serie_0: Serie0` - `ipv4: List[str]` - `ipv6: List[str]` - `timestamps: List[datetime]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.ips.timeseries() print(response.meta) ``` #### Response ```json { "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" } ], "delay": { "asn_data": { "delaySecs": 0, "delayStr": "delayStr", "healthy": true, "latest": { "entries_count": 0, "path": "path", "timestamp": 0 } }, "country_data": { "delaySecs": 0, "delayStr": "delayStr", "healthy": true, "latest": { "count": 0, "timestamp": 0 } }, "healthy": true, "nowTs": 0 } }, "serie_0": { "ipv4": [ "10" ], "ipv6": [ "10" ], "timestamps": [ "2019-12-27T18:11:19.117Z" ] } }, "success": true } ``` ## Domain Types ### IP Timeseries Response - `class IPTimeseriesResponse: …` - `meta: Meta` Metadata for the results. - `agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", 2 more]` Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - `"FIFTEEN_MINUTES"` - `"ONE_HOUR"` - `"ONE_DAY"` - `"ONE_WEEK"` - `"ONE_MONTH"` - `confidence_info: MetaConfidenceInfo` - `annotations: List[MetaConfidenceInfoAnnotation]` - `data_source: Literal["ALL", "AI_BOTS", "AI_GATEWAY", 22 more]` Data source for annotations. - `"ALL"` - `"AI_BOTS"` - `"AI_GATEWAY"` - `"BGP"` - `"BOTS"` - `"CONNECTION_ANOMALY"` - `"CT"` - `"DNS"` - `"DNS_MAGNITUDE"` - `"DNS_AS112"` - `"DOS"` - `"EMAIL_ROUTING"` - `"EMAIL_SECURITY"` - `"FW"` - `"FW_PG"` - `"HTTP"` - `"HTTP_CONTROL"` - `"HTTP_CRAWLER_REFERER"` - `"HTTP_ORIGINS"` - `"IQI"` - `"LEAKED_CREDENTIALS"` - `"NET"` - `"ROBOTS_TXT"` - `"SPEED"` - `"WORKERS_AI"` - `description: str` - `end_date: datetime` - `event_type: Literal["EVENT", "GENERAL", "OUTAGE", 3 more]` Event type for annotations. - `"EVENT"` - `"GENERAL"` - `"OUTAGE"` - `"PARTIAL_PROJECTION"` - `"PIPELINE"` - `"TRAFFIC_ANOMALY"` - `is_instantaneous: bool` Whether event is a single point in time or a time range. - `linked_url: str` - `start_date: datetime` - `level: int` Provides an indication of how much confidence Cloudflare has in the data. - `date_range: List[MetaDateRange]` - `end_time: datetime` Adjusted end of date range. - `start_time: datetime` Adjusted start of date range. - `last_updated: datetime` Timestamp of the last dataset update. - `normalization: Literal["PERCENTAGE", "MIN0_MAX", "MIN_MAX", 5 more]` Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - `"PERCENTAGE"` - `"MIN0_MAX"` - `"MIN_MAX"` - `"RAW_VALUES"` - `"PERCENTAGE_CHANGE"` - `"ROLLING_AVERAGE"` - `"OVERLAPPED_PERCENTAGE"` - `"RATIO"` - `units: List[MetaUnit]` Measurement units for the results. - `name: str` - `value: str` - `delay: Optional[MetaDelay]` - `asn_data: MetaDelayASNData` - `delay_secs: float` - `delay_str: str` - `healthy: bool` - `latest: MetaDelayASNDataLatest` - `entries_count: float` - `path: str` - `timestamp: float` - `country_data: MetaDelayCountryData` - `delay_secs: float` - `delay_str: str` - `healthy: bool` - `latest: MetaDelayCountryDataLatest` - `count: float` - `timestamp: float` - `healthy: bool` - `now_ts: float` - `serie_0: Serie0` - `ipv4: List[str]` - `ipv6: List[str]` - `timestamps: List[datetime]` # RPKI # ASPA ## Get ASPA objects snapshot `radar.bgp.rpki.aspa.snapshot(ASPASnapshotParams**kwargs) -> ASPASnapshotResponse` **get** `/radar/bgp/rpki/aspa/snapshot` Retrieves current or historical ASPA (Autonomous System Provider Authorization) objects. ASPA objects define which ASNs are authorized upstream providers for a customer ASN. ### Parameters - `customer_asn: Optional[int]` Filter by customer ASN (the ASN publishing the ASPA object). - `date: Optional[Union[str, datetime]]` Filters results by the specified datetime (ISO 8601). - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `include_asn_info: Optional[bool]` Include ASN metadata (name, country) in response. - `provider_asn: Optional[int]` Filter by provider ASN (an authorized upstream provider in ASPA objects). ### Returns - `class ASPASnapshotResponse: …` - `asn_info: ASNInfo` - `_13335: ASNInfo_13335` - `asn: int` ASN number. - `country: str` Alpha-2 country code. - `name: str` AS name. - `aspa_objects: List[ASPAObject]` - `customer_asn: int` The customer ASN publishing the ASPA object. - `providers: List[int]` - `meta: Meta` - `data_time: datetime` Timestamp of the underlying data. - `query_time: datetime` Timestamp when the query was executed. - `total_count: int` Total number of ASPA objects. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.rpki.aspa.snapshot() print(response.asn_info) ``` #### Response ```json { "result": { "asnInfo": { "13335": { "asn": 0, "country": "country", "name": "name" } }, "aspaObjects": [ { "customerAsn": 0, "providers": [ 0 ] } ], "meta": { "dataTime": "2019-12-27T18:11:19.117Z", "queryTime": "2019-12-27T18:11:19.117Z", "totalCount": 0 } }, "success": true } ``` ## Get ASPA changes over time `radar.bgp.rpki.aspa.changes(ASPAChangesParams**kwargs) -> ASPAChangesResponse` **get** `/radar/bgp/rpki/aspa/changes` Retrieves ASPA (Autonomous System Provider Authorization) changes over time. Returns daily aggregated changes including additions, removals, and modifications of ASPA objects. ### Parameters - `asn: Optional[int]` Filter changes involving this ASN (as customer or provider). - `date_end: Optional[Union[str, datetime]]` End of the date range (inclusive). - `date_start: Optional[Union[str, datetime]]` Start of the date range (inclusive). - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `include_asn_info: Optional[bool]` Include ASN metadata (name, country) in response. ### Returns - `class ASPAChangesResponse: …` - `asn_info: ASNInfo` - `_13335: ASNInfo_13335` - `asn: int` ASN number. - `country: str` Alpha-2 country code. - `name: str` AS name. - `changes: List[Change]` - `customers_added: int` Number of new ASPA objects created. - `customers_removed: int` Number of ASPA objects deleted. - `date: datetime` Date of the changes in ISO 8601 format. - `entries: List[ChangeEntry]` - `customer_asn: int` The customer ASN affected. - `providers: List[int]` - `type: Literal["CustomerAdded", "CustomerRemoved", "ProvidersAdded", "ProvidersRemoved"]` - `"CustomerAdded"` - `"CustomerRemoved"` - `"ProvidersAdded"` - `"ProvidersRemoved"` - `providers_added: int` Number of providers added to existing objects. - `providers_removed: int` Number of providers removed from existing objects. - `total_count: int` Running total of active ASPA objects after this day. - `meta: Meta` - `data_time: datetime` Timestamp of the underlying data. - `query_time: datetime` Timestamp when the query was executed. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.rpki.aspa.changes() print(response.asn_info) ``` #### Response ```json { "result": { "asnInfo": { "13335": { "asn": 0, "country": "country", "name": "name" } }, "changes": [ { "customersAdded": 0, "customersRemoved": 0, "date": "2019-12-27T18:11:19.117Z", "entries": [ { "customerAsn": 0, "providers": [ 0 ], "type": "CustomerAdded" } ], "providersAdded": 0, "providersRemoved": 0, "totalCount": 0 } ], "meta": { "dataTime": "2019-12-27T18:11:19.117Z", "queryTime": "2019-12-27T18:11:19.117Z" } }, "success": true } ``` ## Get ASPA count time series `radar.bgp.rpki.aspa.timeseries(ASPATimeseriesParams**kwargs) -> ASPATimeseriesResponse` **get** `/radar/bgp/rpki/aspa/timeseries` Retrieves ASPA (Autonomous System Provider Authorization) object count over time. Supports filtering by RIR or location (country code) to generate multiple named series. If no RIR or location filter is specified, returns total count. ### Parameters - `date_end: Optional[Union[str, datetime]]` End of the date range (inclusive). - `date_start: Optional[Union[str, datetime]]` Start of the date range (inclusive). - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` - `location: Optional[SequenceNotStr[str]]` Filters results by location. Specify a comma-separated list of alpha-2 location codes. - `name: Optional[SequenceNotStr[str]]` Array of names used to label the series in the response. - `rir: Optional[List[Literal["RIPE_NCC", "ARIN", "APNIC", 2 more]]]` Filter by Regional Internet Registry (RIR). Multiple RIRs generate multiple series. - `"RIPE_NCC"` - `"ARIN"` - `"APNIC"` - `"LACNIC"` - `"AFRINIC"` ### Returns - `class ASPATimeseriesResponse: …` - `meta: Meta` - `data_time: datetime` Timestamp of the underlying data. - `query_time: datetime` Timestamp when the query was executed. - `serie_0: Serie0` - `timestamps: List[datetime]` - `values: List[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.radar.bgp.rpki.aspa.timeseries() print(response.meta) ``` #### Response ```json { "result": { "meta": { "dataTime": "2019-12-27T18:11:19.117Z", "queryTime": "2019-12-27T18:11:19.117Z" }, "serie_0": { "timestamps": [ "2019-12-27T18:11:19.117Z" ], "values": [ "10" ] } }, "success": true } ``` ## Domain Types ### ASPA Snapshot Response - `class ASPASnapshotResponse: …` - `asn_info: ASNInfo` - `_13335: ASNInfo_13335` - `asn: int` ASN number. - `country: str` Alpha-2 country code. - `name: str` AS name. - `aspa_objects: List[ASPAObject]` - `customer_asn: int` The customer ASN publishing the ASPA object. - `providers: List[int]` - `meta: Meta` - `data_time: datetime` Timestamp of the underlying data. - `query_time: datetime` Timestamp when the query was executed. - `total_count: int` Total number of ASPA objects. ### ASPA Changes Response - `class ASPAChangesResponse: …` - `asn_info: ASNInfo` - `_13335: ASNInfo_13335` - `asn: int` ASN number. - `country: str` Alpha-2 country code. - `name: str` AS name. - `changes: List[Change]` - `customers_added: int` Number of new ASPA objects created. - `customers_removed: int` Number of ASPA objects deleted. - `date: datetime` Date of the changes in ISO 8601 format. - `entries: List[ChangeEntry]` - `customer_asn: int` The customer ASN affected. - `providers: List[int]` - `type: Literal["CustomerAdded", "CustomerRemoved", "ProvidersAdded", "ProvidersRemoved"]` - `"CustomerAdded"` - `"CustomerRemoved"` - `"ProvidersAdded"` - `"ProvidersRemoved"` - `providers_added: int` Number of providers added to existing objects. - `providers_removed: int` Number of providers removed from existing objects. - `total_count: int` Running total of active ASPA objects after this day. - `meta: Meta` - `data_time: datetime` Timestamp of the underlying data. - `query_time: datetime` Timestamp when the query was executed. ### ASPA Timeseries Response - `class ASPATimeseriesResponse: …` - `meta: Meta` - `data_time: datetime` Timestamp of the underlying data. - `query_time: datetime` Timestamp when the query was executed. - `serie_0: Serie0` - `timestamps: List[datetime]` - `values: List[str]`