## Get top or trending domains `client.Radar.Ranking.Top(ctx, query) (*RankingTopResponse, error)` **get** `/radar/ranking/top` Retrieves the top or trending domains based on their rank. Popular domains are domains of broad appeal based on how people use the Internet. Trending domains are domains that are generating a surge in interest. For more information on top domains, see https://blog.cloudflare.com/radar-domain-rankings/. ### Parameters - `query RankingTopParams` - `Date param.Field[[]Time]` Filters results by the specified array of dates. - `DomainCategory param.Field[[]string]` Filters results by domain category. - `Format param.Field[RankingTopParamsFormat]` Format in which results will be returned. - `const RankingTopParamsFormatJson RankingTopParamsFormat = "JSON"` - `const RankingTopParamsFormatCsv RankingTopParamsFormat = "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. - `Name param.Field[[]string]` Array of names used to label the series in the response. - `RankingType param.Field[RankingTopParamsRankingType]` The ranking type. - `const RankingTopParamsRankingTypePopular RankingTopParamsRankingType = "POPULAR"` - `const RankingTopParamsRankingTypeTrendingRise RankingTopParamsRankingType = "TRENDING_RISE"` - `const RankingTopParamsRankingTypeTrendingSteady RankingTopParamsRankingType = "TRENDING_STEADY"` ### Returns - `type RankingTopResponse struct{…}` - `Meta RankingTopResponseMeta` - `ConfidenceInfo RankingTopResponseMetaConfidenceInfo` - `Annotations []RankingTopResponseMetaConfidenceInfoAnnotation` - `DataSource RankingTopResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceAll RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceAIBots RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceBGP RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceBots RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceCT RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceDNS RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceDos RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceFw RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceFwPg RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceHTTP RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceIQI RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceNet RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceSpeed RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI RankingTopResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType RankingTopResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const RankingTopResponseMetaConfidenceInfoAnnotationsEventTypeEvent RankingTopResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsEventTypeGeneral RankingTopResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsEventTypeOutage RankingTopResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection RankingTopResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsEventTypePipeline RankingTopResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const RankingTopResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly RankingTopResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"` - `IsInstantaneous bool` Whether event is a single point in time or a time range. - `LinkedURL string` - `StartDate Time` - `Level int64` Provides an indication of how much confidence Cloudflare has in the data. - `DateRange []RankingTopResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` Timestamp of the last dataset update. - `Normalization RankingTopResponseMetaNormalization` Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - `const RankingTopResponseMetaNormalizationPercentage RankingTopResponseMetaNormalization = "PERCENTAGE"` - `const RankingTopResponseMetaNormalizationMin0Max RankingTopResponseMetaNormalization = "MIN0_MAX"` - `const RankingTopResponseMetaNormalizationMinMax RankingTopResponseMetaNormalization = "MIN_MAX"` - `const RankingTopResponseMetaNormalizationRawValues RankingTopResponseMetaNormalization = "RAW_VALUES"` - `const RankingTopResponseMetaNormalizationPercentageChange RankingTopResponseMetaNormalization = "PERCENTAGE_CHANGE"` - `const RankingTopResponseMetaNormalizationRollingAverage RankingTopResponseMetaNormalization = "ROLLING_AVERAGE"` - `const RankingTopResponseMetaNormalizationOverlappedPercentage RankingTopResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"` - `const RankingTopResponseMetaNormalizationRatio RankingTopResponseMetaNormalization = "RATIO"` - `Units []RankingTopResponseMetaUnit` Measurement units for the results. - `Name string` - `Value string` - `Top0 []RankingTopResponseTop0` - `Categories []RankingTopResponseTop0Category` - `ID float64` - `Name string` - `SuperCategoryID float64` - `Domain string` - `Rank int64` - `PctRankChange float64` Only available in TRENDING rankings. ### 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.Ranking.Top(context.TODO(), radar.RankingTopParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Meta) } ``` #### Response ```json { "result": { "meta": { "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" } ] }, "top_0": [ { "categories": [ { "id": 81, "name": "Content Servers", "superCategoryId": 26 } ], "domain": "google.com", "rank": 1, "pctRankChange": 10.8 } ] }, "success": true } ```