# Entities ## Get IP address details `client.Radar.Entities.Get(ctx, query) (*EntityGetResponse, error)` **get** `/radar/entities/ip` Retrieves IP address information. ### Parameters - `query EntityGetParams` - `IP param.Field[string]` IP address. - `Format param.Field[EntityGetParamsFormat]` Format in which results will be returned. - `const EntityGetParamsFormatJson EntityGetParamsFormat = "JSON"` - `const EntityGetParamsFormatCsv EntityGetParamsFormat = "CSV"` ### Returns - `type EntityGetResponse struct{…}` - `IP EntityGetResponseIP` - `ASN string` - `ASNLocation string` - `ASNName string` - `ASNOrgName string` - `IP string` - `IPVersion string` - `Location string` - `LocationName string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) entity, err := client.Radar.Entities.Get(context.TODO(), radar.EntityGetParams{ IP: cloudflare.F("8.8.8.8"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 } ``` # ASNs ## List autonomous systems `client.Radar.Entities.ASNs.List(ctx, query) (*EntityASNListResponse, error)` **get** `/radar/entities/asns` Retrieves a list of autonomous systems. ### Parameters - `query EntityASNListParams` - `ASN param.Field[string]` Filters results by Autonomous System. Specify one or more Autonomous System Numbers (ASNs) as a comma-separated list. - `Format param.Field[EntityASNListParamsFormat]` Format in which results will be returned. - `const EntityASNListParamsFormatJson EntityASNListParamsFormat = "JSON"` - `const EntityASNListParamsFormatCsv EntityASNListParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `Location param.Field[string]` Filters results by location. Specify an alpha-2 location code. - `Offset param.Field[int64]` Skips the specified number of objects before fetching the results. - `OrderBy param.Field[EntityASNListParamsOrderBy]` Specifies the metric to order the ASNs by. - `const EntityASNListParamsOrderByASN EntityASNListParamsOrderBy = "ASN"` - `const EntityASNListParamsOrderByPopulation EntityASNListParamsOrderBy = "POPULATION"` ### Returns - `type EntityASNListResponse struct{…}` - `ASNs []EntityASNListResponseASN` - `ASN int64` - `Country string` - `CountryName string` - `Name string` - `Aka string` - `OrgName string` - `Website string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) asns, err := client.Radar.Entities.ASNs.List(context.TODO(), radar.EntityASNListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 `client.Radar.Entities.ASNs.Get(ctx, asn, query) (*EntityASNGetResponse, error)` **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 int64` Single Autonomous System Number (ASN) as integer. - `query EntityASNGetParams` - `Format param.Field[EntityASNGetParamsFormat]` Format in which results will be returned. - `const EntityASNGetParamsFormatJson EntityASNGetParamsFormat = "JSON"` - `const EntityASNGetParamsFormatCsv EntityASNGetParamsFormat = "CSV"` ### Returns - `type EntityASNGetResponse struct{…}` - `ASN EntityASNGetResponseASN` - `ASN int64` - `ConfidenceLevel int64` - `Country string` - `CountryName string` - `EstimatedUsers EntityASNGetResponseASNEstimatedUsers` - `Locations []EntityASNGetResponseASNEstimatedUsersLocation` - `LocationAlpha2 string` - `LocationName string` - `EstimatedUsers int64` Estimated users per location. - `EstimatedUsers int64` Total estimated users. - `Name string` - `OrgName string` - `Related []EntityASNGetResponseASNRelated` - `ASN int64` - `Name string` - `Aka string` - `EstimatedUsers int64` Total estimated users. - `Source string` Regional Internet Registry. - `Website string` - `Aka string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) asn, err := client.Radar.Entities.ASNs.Get( context.TODO(), int64(174), radar.EntityASNGetParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 `client.Radar.Entities.ASNs.Rel(ctx, asn, query) (*EntityASNRelResponse, error)` **get** `/radar/entities/asns/{asn}/rel` Retrieves AS-level relationship for given networks. ### Parameters - `asn int64` Retrieves all ASNs with provider-customer or peering relationships with the given ASN. - `query EntityASNRelParams` - `Asn2 param.Field[int64]` Retrieves the AS relationship of ASN2 with respect to the given ASN. - `Format param.Field[EntityASNRelParamsFormat]` Format in which results will be returned. - `const EntityASNRelParamsFormatJson EntityASNRelParamsFormat = "JSON"` - `const EntityASNRelParamsFormatCsv EntityASNRelParamsFormat = "CSV"` ### Returns - `type EntityASNRelResponse struct{…}` - `Meta EntityASNRelResponseMeta` - `DataTime string` - `QueryTime string` - `TotalPeers int64` - `Rels []EntityASNRelResponseRel` - `Asn1 int64` - `Asn1Country string` - `Asn1Name string` - `Asn2 int64` - `Asn2Country string` - `Asn2Name string` - `Rel string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Radar.Entities.ASNs.Rel( context.TODO(), int64(3), radar.EntityASNRelParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 `client.Radar.Entities.ASNs.AsSet(ctx, asn, query) (*EntityASNAsSetResponse, error)` **get** `/radar/entities/asns/{asn}/as_set` Retrieves Internet Routing Registry AS-SETs that an AS is a member of. ### Parameters - `asn int64` Retrieves all AS-SETs that the given AS is a member of. - `query EntityASNAsSetParams` - `Format param.Field[EntityASNAsSetParamsFormat]` Format in which results will be returned. - `const EntityASNAsSetParamsFormatJson EntityASNAsSetParamsFormat = "JSON"` - `const EntityASNAsSetParamsFormatCsv EntityASNAsSetParamsFormat = "CSV"` ### Returns - `type EntityASNAsSetResponse struct{…}` - `AsSets []EntityASNAsSetResponseAsSet` - `AsMembersCount int64` The number of AS members in the AS-SET - `AsSetMembersCount int64` The number of AS-SET members in the AS-SET - `AsSetUpstreamsCount int64` The number of recursive upstream AS-SETs - `ASNConeSize int64` The number of unique ASNs in the AS-SETs recursive downstream - `IrrSources []string` The IRR sources of the AS-SET - `Name string` The name of the AS-SET - `HierarchicalASN int64` The AS number following hierarchical AS-SET name - `InferredASN int64` The inferred AS number of the AS-SET - `PeeringdbASN int64` The AS number matching PeeringDB record - `Paths [][]string` Paths from the AS-SET that include the given AS to its upstreams recursively ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Radar.Entities.ASNs.AsSet( context.TODO(), int64(3), radar.EntityASNAsSetParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.AsSets) } ``` #### 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 `client.Radar.Entities.ASNs.IP(ctx, query) (*EntityAsnipResponse, error)` **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 - `query EntityASNIPParams` - `IP param.Field[string]` IP address. - `Format param.Field[EntityAsnipParamsFormat]` Format in which results will be returned. - `const EntityAsnipParamsFormatJson EntityAsnipParamsFormat = "JSON"` - `const EntityAsnipParamsFormatCsv EntityAsnipParamsFormat = "CSV"` ### Returns - `type EntityAsnipResponse struct{…}` - `ASN EntityAsnipResponseASN` - `ASN int64` - `Country string` - `CountryName string` - `EstimatedUsers EntityAsnipResponseASNEstimatedUsers` - `Locations []EntityAsnipResponseASNEstimatedUsersLocation` - `LocationAlpha2 string` - `LocationName string` - `EstimatedUsers int64` Estimated users per location. - `EstimatedUsers int64` Total estimated users. - `Name string` - `OrgName string` - `Related []EntityAsnipResponseASNRelated` - `ASN int64` - `Name string` - `Aka string` - `EstimatedUsers int64` Total estimated users. - `Source string` Regional Internet Registry. - `Website string` - `Aka string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Radar.Entities.ASNs.IP(context.TODO(), radar.EntityASNIPParams{ IP: cloudflare.F("8.8.8.8"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 `client.Radar.Entities.ASNs.BotnetThreatFeed(ctx, query) (*EntityASNBotnetThreatFeedResponse, error)` **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 - `query EntityASNBotnetThreatFeedParams` - `ASN param.Field[[]string]` 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. - `CompareDateRange param.Field[string]` Relative date range for rank change comparison (e.g., "1d", "7d", "30d"). - `Date param.Field[Time]` 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 param.Field[EntityASNBotnetThreatFeedParamsFormat]` Format in which results will be returned. - `const EntityASNBotnetThreatFeedParamsFormatJson EntityASNBotnetThreatFeedParamsFormat = "JSON"` - `const EntityASNBotnetThreatFeedParamsFormatCsv EntityASNBotnetThreatFeedParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `Location param.Field[string]` Filters results by location. Specify an alpha-2 location code. - `Metric param.Field[EntityASNBotnetThreatFeedParamsMetric]` Metric to rank ASNs by. - `const EntityASNBotnetThreatFeedParamsMetricOffenseCount EntityASNBotnetThreatFeedParamsMetric = "OFFENSE_COUNT"` - `const EntityASNBotnetThreatFeedParamsMetricNumberOfOffendingIPs EntityASNBotnetThreatFeedParamsMetric = "NUMBER_OF_OFFENDING_IPS"` - `Offset param.Field[int64]` Skips the specified number of objects before fetching the results. - `SortOrder param.Field[EntityASNBotnetThreatFeedParamsSortOrder]` Sort order. - `const EntityASNBotnetThreatFeedParamsSortOrderAsc EntityASNBotnetThreatFeedParamsSortOrder = "ASC"` - `const EntityASNBotnetThreatFeedParamsSortOrderDesc EntityASNBotnetThreatFeedParamsSortOrder = "DESC"` ### Returns - `type EntityASNBotnetThreatFeedResponse struct{…}` - `Ases []EntityASNBotnetThreatFeedResponseAse` - `ASN int64` - `Country string` - `Name string` - `Rank int64` - `RankChange int64` - `Meta EntityASNBotnetThreatFeedResponseMeta` - `Date string` - `Total int64` - `CompareDate string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Radar.Entities.ASNs.BotnetThreatFeed(context.TODO(), radar.EntityASNBotnetThreatFeedParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 } ``` # Locations ## List locations `client.Radar.Entities.Locations.List(ctx, query) (*EntityLocationListResponse, error)` **get** `/radar/entities/locations` Retrieves a list of locations. ### Parameters - `query EntityLocationListParams` - `Continent param.Field[EntityLocationListParamsContinent]` Filters results by continent code. - `const EntityLocationListParamsContinentAf EntityLocationListParamsContinent = "AF"` - `const EntityLocationListParamsContinentAs EntityLocationListParamsContinent = "AS"` - `const EntityLocationListParamsContinentEu EntityLocationListParamsContinent = "EU"` - `const EntityLocationListParamsContinentNa EntityLocationListParamsContinent = "NA"` - `const EntityLocationListParamsContinentOc EntityLocationListParamsContinent = "OC"` - `const EntityLocationListParamsContinentSa EntityLocationListParamsContinent = "SA"` - `Format param.Field[EntityLocationListParamsFormat]` Format in which results will be returned. - `const EntityLocationListParamsFormatJson EntityLocationListParamsFormat = "JSON"` - `const EntityLocationListParamsFormatCsv EntityLocationListParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `Location param.Field[string]` Filters results by location. Specify a comma-separated list of alpha-2 location codes. - `Offset param.Field[int64]` Skips the specified number of objects before fetching the results. - `Region param.Field[string]` Filters results by region. - `Subregion param.Field[string]` Filters results by subregion. ### Returns - `type EntityLocationListResponse struct{…}` - `Locations []EntityLocationListResponseLocation` - `Alpha2 string` - `Continent string` - `Latitude string` A numeric string. - `Longitude string` A numeric string. - `Name string` - `Region string` - `Subregion string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) locations, err := client.Radar.Entities.Locations.List(context.TODO(), radar.EntityLocationListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 `client.Radar.Entities.Locations.Get(ctx, location, query) (*EntityLocationGetResponse, error)` **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 string` Location alpha-2 code. - `query EntityLocationGetParams` - `Format param.Field[EntityLocationGetParamsFormat]` Format in which results will be returned. - `const EntityLocationGetParamsFormatJson EntityLocationGetParamsFormat = "JSON"` - `const EntityLocationGetParamsFormatCsv EntityLocationGetParamsFormat = "CSV"` ### Returns - `type EntityLocationGetResponse struct{…}` - `Location EntityLocationGetResponseLocation` - `Alpha2 string` - `ConfidenceLevel int64` - `Continent string` - `Latitude string` A numeric string. - `Longitude string` A numeric string. - `Name string` - `Region string` - `Subregion string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) location, err := client.Radar.Entities.Locations.Get( context.TODO(), "US", radar.EntityLocationGetParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 } ```