# Entities ## Get IP address details `radar.entities.get(EntityGetParams**kwargs) -> EntityGetResponse` **get** `/radar/entities/ip` Retrieves IP address information. ### Parameters - `ip: str` IP address. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` ### Returns - `class EntityGetResponse: …` - `ip: IP` - `asn: str` - `asn_location: str` - `asn_name: str` - `asn_org_name: str` - `ip: str` - `ip_version: str` - `location: str` - `location_name: 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 ) entity = client.radar.entities.get( ip="8.8.8.8", ) print(entity.ip) ``` #### Response ```json { "result": { "ip": { "asn": "15169", "asnLocation": "US", "asnName": "GOOGLE", "asnOrgName": "Google LLC", "ip": "8.8.8.8", "ipVersion": "IPv4", "location": "GB", "locationName": "United Kingdom" } }, "success": true } ``` ## Domain Types ### Entity Get Response - `class EntityGetResponse: …` - `ip: IP` - `asn: str` - `asn_location: str` - `asn_name: str` - `asn_org_name: str` - `ip: str` - `ip_version: str` - `location: str` - `location_name: str` # ASNs ## List autonomous systems `radar.entities.asns.list(ASNListParams**kwargs) -> ASNListResponse` **get** `/radar/entities/asns` Retrieves a list of autonomous systems. ### Parameters - `asn: Optional[str]` Filters results by Autonomous System. Specify one or more Autonomous System Numbers (ASNs) as a comma-separated list. - `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. - `offset: Optional[int]` Skips the specified number of objects before fetching the results. - `order_by: Optional[Literal["ASN", "POPULATION"]]` Specifies the metric to order the ASNs by. - `"ASN"` - `"POPULATION"` ### Returns - `class ASNListResponse: …` - `asns: List[ASN]` - `asn: int` - `country: str` - `country_name: str` - `name: str` - `aka: Optional[str]` - `org_name: Optional[str]` - `website: Optional[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 ) asns = client.radar.entities.asns.list() print(asns.asns) ``` #### Response ```json { "result": { "asns": [ { "asn": 714, "country": "GB", "countryName": "United Kingdom", "name": "Apple Inc.", "aka": "aka", "orgName": "orgName", "website": "https://www.apple.com/support/systemstatus/" } ] }, "success": true } ``` ## Get AS details by ASN `radar.entities.asns.get(intasn, ASNGetParams**kwargs) -> ASNGetResponse` **get** `/radar/entities/asns/{asn}` Retrieves the requested autonomous system information. (A confidence level below `5` indicates a low level of confidence in the traffic data - normally this happens because Cloudflare has a small amount of traffic from/to this AS). Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526). ### Parameters - `asn: int` Single Autonomous System Number (ASN) as integer. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` ### Returns - `class ASNGetResponse: …` - `asn: ASN` - `asn: int` - `confidence_level: int` - `country: str` - `country_name: str` - `estimated_users: ASNEstimatedUsers` - `locations: List[ASNEstimatedUsersLocation]` - `location_alpha2: str` - `location_name: str` - `estimated_users: Optional[int]` Estimated users per location. - `estimated_users: Optional[int]` Total estimated users. - `name: str` - `org_name: str` - `related: List[ASNRelated]` - `asn: int` - `name: str` - `aka: Optional[str]` - `estimated_users: Optional[int]` Total estimated users. - `source: str` Regional Internet Registry. - `website: str` - `aka: Optional[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 ) asn = client.radar.entities.asns.get( asn=174, ) print(asn.asn) ``` #### Response ```json { "result": { "asn": { "asn": 714, "confidenceLevel": 5, "country": "GB", "countryName": "United Kingdom", "estimatedUsers": { "locations": [ { "locationAlpha2": "US", "locationName": "United States", "estimatedUsers": 16710 } ], "estimatedUsers": 86099 }, "name": "Apple Inc.", "orgName": "orgName", "related": [ { "asn": 174, "name": "Cogent-174", "aka": "aka", "estimatedUsers": 65345 } ], "source": "RIPE", "website": "https://www.apple.com/support/systemstatus/", "aka": "aka" } }, "success": true } ``` ## Get AS-level relationships by ASN `radar.entities.asns.rel(intasn, ASNRelParams**kwargs) -> ASNRelResponse` **get** `/radar/entities/asns/{asn}/rel` Retrieves AS-level relationship for given networks. ### Parameters - `asn: int` Retrieves all ASNs with provider-customer or peering relationships with the given ASN. - `asn2: Optional[int]` Retrieves the AS relationship of ASN2 with respect to the given ASN. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` ### Returns - `class ASNRelResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `rels: List[Rel]` - `asn1: int` - `asn1_country: str` - `asn1_name: str` - `asn2: int` - `asn2_country: str` - `asn2_name: str` - `rel: 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.entities.asns.rel( asn=3, ) print(response.meta) ``` #### Response ```json { "result": { "meta": { "data_time": "data_time", "query_time": "query_time", "total_peers": 0 }, "rels": [ { "asn1": 0, "asn1_country": "asn1_country", "asn1_name": "asn1_name", "asn2": 0, "asn2_country": "asn2_country", "asn2_name": "asn2_name", "rel": "rel" } ] }, "success": true } ``` ## Get IRR AS-SETs that an AS is a member of `radar.entities.asns.as_set(intasn, ASNAsSetParams**kwargs) -> ASNAsSetResponse` **get** `/radar/entities/asns/{asn}/as_set` Retrieves Internet Routing Registry AS-SETs that an AS is a member of. ### Parameters - `asn: int` Retrieves all AS-SETs that the given AS is a member of. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` ### Returns - `class ASNAsSetResponse: …` - `as_sets: List[AsSet]` - `as_members_count: int` The number of AS members in the AS-SET - `as_set_members_count: int` The number of AS-SET members in the AS-SET - `as_set_upstreams_count: int` The number of recursive upstream AS-SETs - `asn_cone_size: int` The number of unique ASNs in the AS-SETs recursive downstream - `irr_sources: List[str]` The IRR sources of the AS-SET - `name: str` The name of the AS-SET - `hierarchical_asn: Optional[int]` The AS number following hierarchical AS-SET name - `inferred_asn: Optional[int]` The inferred AS number of the AS-SET - `peeringdb_asn: Optional[int]` The AS number matching PeeringDB record - `paths: List[List[str]]` Paths from the AS-SET that include the given AS to its upstreams recursively ### 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.entities.asns.as_set( asn=3, ) print(response.as_sets) ``` #### Response ```json { "result": { "as_sets": [ { "as_members_count": 0, "as_set_members_count": 0, "as_set_upstreams_count": 0, "asn_cone_size": 0, "irr_sources": [ "string" ], "name": "name", "hierarchical_asn": 0, "inferred_asn": 0, "peeringdb_asn": 0 } ], "paths": [ [ "string" ] ] }, "success": true } ``` ## Get AS details by IP address `radar.entities.asns.ip(ASNIPParams**kwargs) -> ASNIPResponse` **get** `/radar/entities/asns/ip` Retrieves the requested autonomous system information based on IP address. Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526). ### Parameters - `ip: str` IP address. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` ### Returns - `class ASNIPResponse: …` - `asn: ASN` - `asn: int` - `country: str` - `country_name: str` - `estimated_users: ASNEstimatedUsers` - `locations: List[ASNEstimatedUsersLocation]` - `location_alpha2: str` - `location_name: str` - `estimated_users: Optional[int]` Estimated users per location. - `estimated_users: Optional[int]` Total estimated users. - `name: str` - `org_name: str` - `related: List[ASNRelated]` - `asn: int` - `name: str` - `aka: Optional[str]` - `estimated_users: Optional[int]` Total estimated users. - `source: str` Regional Internet Registry. - `website: str` - `aka: Optional[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.entities.asns.ip( ip="8.8.8.8", ) print(response.asn) ``` #### Response ```json { "result": { "asn": { "asn": 714, "country": "GB", "countryName": "United Kingdom", "estimatedUsers": { "locations": [ { "locationAlpha2": "US", "locationName": "United States", "estimatedUsers": 16710 } ], "estimatedUsers": 86099 }, "name": "Apple Inc.", "orgName": "orgName", "related": [ { "asn": 0, "name": "name", "aka": "aka", "estimatedUsers": 65345 } ], "source": "RIPE", "website": "https://www.apple.com/support/systemstatus/", "aka": "aka" } }, "success": true } ``` ## Get AS rankings by botnet threat feed activity `radar.entities.asns.botnet_threat_feed(ASNBotnetThreatFeedParams**kwargs) -> ASNBotnetThreatFeedResponse` **get** `/radar/entities/asns/botnet_threat_feed` Retrieves a ranked list of Autonomous Systems based on their presence in the Cloudflare Botnet Threat Feed. Rankings can be sorted by offense count or number of bad IPs. Optionally compare to a previous date to see rank changes. ### 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. - `compare_date_range: Optional[str]` Relative date range for rank change comparison (e.g., "1d", "7d", "30d"). - `date: Optional[Union[null, null]]` The date to retrieve (YYYY-MM-DD format). If not specified, returns the most recent available data. Note: This is the date the report was generated. The report is generated from information collected from the previous day (e.g., the 2026-02-23 entry contains data from 2026-02-22). - `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. - `metric: Optional[Literal["OFFENSE_COUNT", "NUMBER_OF_OFFENDING_IPS"]]` Metric to rank ASNs by. - `"OFFENSE_COUNT"` - `"NUMBER_OF_OFFENDING_IPS"` - `offset: Optional[int]` Skips the specified number of objects before fetching the results. - `sort_order: Optional[Literal["ASC", "DESC"]]` Sort order. - `"ASC"` - `"DESC"` ### Returns - `class ASNBotnetThreatFeedResponse: …` - `ases: List[Ase]` - `asn: int` - `country: str` - `name: str` - `rank: int` - `rank_change: Optional[int]` - `meta: Meta` - `date: str` - `total: int` - `compare_date: Optional[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.entities.asns.botnet_threat_feed() print(response.ases) ``` #### Response ```json { "result": { "ases": [ { "asn": 4134, "country": "CN", "name": "CHINANET-BACKBONE", "rank": 1, "rankChange": -2 } ], "meta": { "date": "2026-02-04", "total": 50, "compareDate": "2026-01-28" } }, "success": true } ``` ## Domain Types ### ASN List Response - `class ASNListResponse: …` - `asns: List[ASN]` - `asn: int` - `country: str` - `country_name: str` - `name: str` - `aka: Optional[str]` - `org_name: Optional[str]` - `website: Optional[str]` ### ASN Get Response - `class ASNGetResponse: …` - `asn: ASN` - `asn: int` - `confidence_level: int` - `country: str` - `country_name: str` - `estimated_users: ASNEstimatedUsers` - `locations: List[ASNEstimatedUsersLocation]` - `location_alpha2: str` - `location_name: str` - `estimated_users: Optional[int]` Estimated users per location. - `estimated_users: Optional[int]` Total estimated users. - `name: str` - `org_name: str` - `related: List[ASNRelated]` - `asn: int` - `name: str` - `aka: Optional[str]` - `estimated_users: Optional[int]` Total estimated users. - `source: str` Regional Internet Registry. - `website: str` - `aka: Optional[str]` ### ASN Rel Response - `class ASNRelResponse: …` - `meta: Meta` - `data_time: str` - `query_time: str` - `total_peers: int` - `rels: List[Rel]` - `asn1: int` - `asn1_country: str` - `asn1_name: str` - `asn2: int` - `asn2_country: str` - `asn2_name: str` - `rel: str` ### ASN As Set Response - `class ASNAsSetResponse: …` - `as_sets: List[AsSet]` - `as_members_count: int` The number of AS members in the AS-SET - `as_set_members_count: int` The number of AS-SET members in the AS-SET - `as_set_upstreams_count: int` The number of recursive upstream AS-SETs - `asn_cone_size: int` The number of unique ASNs in the AS-SETs recursive downstream - `irr_sources: List[str]` The IRR sources of the AS-SET - `name: str` The name of the AS-SET - `hierarchical_asn: Optional[int]` The AS number following hierarchical AS-SET name - `inferred_asn: Optional[int]` The inferred AS number of the AS-SET - `peeringdb_asn: Optional[int]` The AS number matching PeeringDB record - `paths: List[List[str]]` Paths from the AS-SET that include the given AS to its upstreams recursively ### ASN IP Response - `class ASNIPResponse: …` - `asn: ASN` - `asn: int` - `country: str` - `country_name: str` - `estimated_users: ASNEstimatedUsers` - `locations: List[ASNEstimatedUsersLocation]` - `location_alpha2: str` - `location_name: str` - `estimated_users: Optional[int]` Estimated users per location. - `estimated_users: Optional[int]` Total estimated users. - `name: str` - `org_name: str` - `related: List[ASNRelated]` - `asn: int` - `name: str` - `aka: Optional[str]` - `estimated_users: Optional[int]` Total estimated users. - `source: str` Regional Internet Registry. - `website: str` - `aka: Optional[str]` ### ASN Botnet Threat Feed Response - `class ASNBotnetThreatFeedResponse: …` - `ases: List[Ase]` - `asn: int` - `country: str` - `name: str` - `rank: int` - `rank_change: Optional[int]` - `meta: Meta` - `date: str` - `total: int` - `compare_date: Optional[str]` # Locations ## List locations `radar.entities.locations.list(LocationListParams**kwargs) -> LocationListResponse` **get** `/radar/entities/locations` Retrieves a list of locations. ### Parameters - `continent: Optional[Literal["AF", "AS", "EU", 3 more]]` Filters results by continent code. - `"AF"` - `"AS"` - `"EU"` - `"NA"` - `"OC"` - `"SA"` - `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 a comma-separated list of alpha-2 location codes. - `offset: Optional[int]` Skips the specified number of objects before fetching the results. - `region: Optional[str]` Filters results by region. - `subregion: Optional[str]` Filters results by subregion. ### Returns - `class LocationListResponse: …` - `locations: List[Location]` - `alpha2: str` - `continent: str` - `latitude: str` A numeric string. - `longitude: str` A numeric string. - `name: str` - `region: str` - `subregion: 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 ) locations = client.radar.entities.locations.list() print(locations.locations) ``` #### Response ```json { "result": { "locations": [ { "alpha2": "AF", "continent": "AS", "latitude": "10", "longitude": "10", "name": "Afghanistan", "region": "Middle East", "subregion": "Southern Asia" } ] }, "success": true } ``` ## Get location details `radar.entities.locations.get(strlocation, LocationGetParams**kwargs) -> LocationGetResponse` **get** `/radar/entities/locations/{location}` Retrieves the requested location information. (A confidence level below `5` indicates a low level of confidence in the traffic data - normally this happens because Cloudflare has a small amount of traffic from/to this location). ### Parameters - `location: str` Location alpha-2 code. - `format: Optional[Literal["JSON", "CSV"]]` Format in which results will be returned. - `"JSON"` - `"CSV"` ### Returns - `class LocationGetResponse: …` - `location: Location` - `alpha2: str` - `confidence_level: int` - `continent: str` - `latitude: str` A numeric string. - `longitude: str` A numeric string. - `name: str` - `region: str` - `subregion: 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 ) location = client.radar.entities.locations.get( location="US", ) print(location.location) ``` #### Response ```json { "result": { "location": { "alpha2": "AF", "confidenceLevel": 5, "continent": "AS", "latitude": "10", "longitude": "10", "name": "Afghanistan", "region": "Middle East", "subregion": "Southern Asia" } }, "success": true } ``` ## Domain Types ### Location List Response - `class LocationListResponse: …` - `locations: List[Location]` - `alpha2: str` - `continent: str` - `latitude: str` A numeric string. - `longitude: str` A numeric string. - `name: str` - `region: str` - `subregion: str` ### Location Get Response - `class LocationGetResponse: …` - `location: Location` - `alpha2: str` - `confidence_level: int` - `continent: str` - `latitude: str` A numeric string. - `longitude: str` A numeric string. - `name: str` - `region: str` - `subregion: str`