Skip to content
Start here

Get domains rank time series

client.Radar.Ranking.TimeseriesGroups(ctx, query) (*RankingTimeseriesGroupsResponse, error)
GET/radar/ranking/timeseries_groups

Retrieves domains rank over time.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
query RankingTimeseriesGroupsParams
DateEnd param.Field[[]Time]Optional

End of the date range (inclusive). Alternative to dateRange; provide together with dateStart. When requesting comparison series, every series must resolve to the same duration as the main series. Each dateStart/dateEnd is floored to the nearest 15 minutes before evaluation, so windows whose durations match only before alignment may be rejected.

DateRange param.Field[[]string]Optional

Filters results by relative date range ending at the current time, with each value producing a separate series. Use <n>d for days (up to 364d) or <n>w for weeks (up to 52w). Append control to request the equivalent previous period for comparison: the comparison window is shifted back by the current window’s length rounded up to a whole number of weeks, so it keeps the same weekday alignment and does not overlap the current window (e.g. 7dcontrol covers days -14 to -7, 10dcontrol covers days -24 to -14). For example, pass 7d and 7dcontrol to compare this week with the previous week. All series must resolve to the same duration as the main series; relative ranges (including control) satisfy this automatically. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]Optional

Start of the date range. Alternative to dateRange; provide together with dateEnd. When requesting comparison series, every series must resolve to the same duration as the main series. Each dateStart/dateEnd is floored to the nearest 15 minutes before evaluation, so windows whose durations match only before alignment may be rejected.

DomainCategory param.Field[[]string]Optional

Filters results by domain category.

Domains param.Field[[]string]Optional

Filters results by domain name. Specify a comma-separated list of domain names.

Format param.Field[RankingTimeseriesGroupsParamsFormat]Optional

Format in which results will be returned.

const RankingTimeseriesGroupsParamsFormatJson RankingTimeseriesGroupsParamsFormat = "JSON"
const RankingTimeseriesGroupsParamsFormatCsv RankingTimeseriesGroupsParamsFormat = "CSV"
Limit param.Field[int64]Optional

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
Location param.Field[[]string]Optional

Filters results by location. Specify a comma-separated list of alpha-2 location codes.

Name param.Field[[]string]Optional

Array of names used to label the series in the response.

RankingType param.Field[RankingTimeseriesGroupsParamsRankingType]Optional

The ranking type.

const RankingTimeseriesGroupsParamsRankingTypePopular RankingTimeseriesGroupsParamsRankingType = "POPULAR"
const RankingTimeseriesGroupsParamsRankingTypeTrendingRise RankingTimeseriesGroupsParamsRankingType = "TRENDING_RISE"
const RankingTimeseriesGroupsParamsRankingTypeTrendingSteady RankingTimeseriesGroupsParamsRankingType = "TRENDING_STEADY"
ReturnsExpand Collapse
type RankingTimeseriesGroupsResponse struct{…}
Meta RankingTimeseriesGroupsResponseMeta

Metadata for the results.

AggInterval RankingTimeseriesGroupsResponseMetaAggInterval

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

One of the following:
const RankingTimeseriesGroupsResponseMetaAggIntervalFifteenMinutes RankingTimeseriesGroupsResponseMetaAggInterval = "FIFTEEN_MINUTES"
const RankingTimeseriesGroupsResponseMetaAggIntervalOneHour RankingTimeseriesGroupsResponseMetaAggInterval = "ONE_HOUR"
const RankingTimeseriesGroupsResponseMetaAggIntervalOneDay RankingTimeseriesGroupsResponseMetaAggInterval = "ONE_DAY"
const RankingTimeseriesGroupsResponseMetaAggIntervalOneWeek RankingTimeseriesGroupsResponseMetaAggInterval = "ONE_WEEK"
const RankingTimeseriesGroupsResponseMetaAggIntervalOneMonth RankingTimeseriesGroupsResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo RankingTimeseriesGroupsResponseMetaConfidenceInfo
Annotations []RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation
DataSource RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAll RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAIBots RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceBGP RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceBots RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceCT RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNS RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceDos RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceFw RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceFwPg RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTP RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceIQI RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceNet RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceSpeed RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeEvent RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeGeneral RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeOutage RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypePipeline RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly RankingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []RankingTimeseriesGroupsResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization RankingTimeseriesGroupsResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const RankingTimeseriesGroupsResponseMetaNormalizationPercentage RankingTimeseriesGroupsResponseMetaNormalization = "PERCENTAGE"
const RankingTimeseriesGroupsResponseMetaNormalizationMin0Max RankingTimeseriesGroupsResponseMetaNormalization = "MIN0_MAX"
const RankingTimeseriesGroupsResponseMetaNormalizationMinMax RankingTimeseriesGroupsResponseMetaNormalization = "MIN_MAX"
const RankingTimeseriesGroupsResponseMetaNormalizationRawValues RankingTimeseriesGroupsResponseMetaNormalization = "RAW_VALUES"
const RankingTimeseriesGroupsResponseMetaNormalizationPercentageChange RankingTimeseriesGroupsResponseMetaNormalization = "PERCENTAGE_CHANGE"
const RankingTimeseriesGroupsResponseMetaNormalizationRollingAverage RankingTimeseriesGroupsResponseMetaNormalization = "ROLLING_AVERAGE"
const RankingTimeseriesGroupsResponseMetaNormalizationOverlappedPercentage RankingTimeseriesGroupsResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const RankingTimeseriesGroupsResponseMetaNormalizationRatio RankingTimeseriesGroupsResponseMetaNormalization = "RATIO"
Units []RankingTimeseriesGroupsResponseMetaUnit

Measurement units for the results.

Name string
Value string
Serie0 RankingTimeseriesGroupsResponseSerie0
Timestamps []Time

Get domains rank time series

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.TimeseriesGroups(context.TODO(), radar.RankingTimeseriesGroupsParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "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",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "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"
        }
      ]
    },
    "serie_0": {
      "timestamps": [
        "2019-12-27T18:11:19.117Z"
      ]
    }
  },
  "success": true
}
Returns Examples
{
  "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",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "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"
        }
      ]
    },
    "serie_0": {
      "timestamps": [
        "2019-12-27T18:11:19.117Z"
      ]
    }
  },
  "success": true
}