## Get BGP time series `client.Radar.BGP.Timeseries(ctx, query) (*BGPTimeseriesResponse, error)` **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 - `query BGPTimeseriesParams` - `AggInterval param.Field[BGPTimeseriesParamsAggInterval]` 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/). - `const BGPTimeseriesParamsAggInterval15m BGPTimeseriesParamsAggInterval = "15m"` - `const BGPTimeseriesParamsAggInterval1h BGPTimeseriesParamsAggInterval = "1h"` - `const BGPTimeseriesParamsAggInterval1d BGPTimeseriesParamsAggInterval = "1d"` - `const BGPTimeseriesParamsAggInterval1w BGPTimeseriesParamsAggInterval = "1w"` - `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. - `DateEnd param.Field[[]Time]` End of the date range (inclusive). - `DateRange param.Field[[]string]` 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). - `DateStart param.Field[[]Time]` Start of the date range. - `Format param.Field[BGPTimeseriesParamsFormat]` Format in which results will be returned. - `const BGPTimeseriesParamsFormatJson BGPTimeseriesParamsFormat = "JSON"` - `const BGPTimeseriesParamsFormatCsv BGPTimeseriesParamsFormat = "CSV"` - `Name param.Field[[]string]` Array of names used to label the series in the response. - `Prefix param.Field[[]string]` Filters results by BGP network prefix. - `UpdateType param.Field[[]BGPTimeseriesParamsUpdateType]` Filters results by BGP update type. - `const BGPTimeseriesParamsUpdateTypeAnnouncement BGPTimeseriesParamsUpdateType = "ANNOUNCEMENT"` - `const BGPTimeseriesParamsUpdateTypeWithdrawal BGPTimeseriesParamsUpdateType = "WITHDRAWAL"` ### Returns - `type BGPTimeseriesResponse struct{…}` - `Meta BGPTimeseriesResponseMeta` - `AggInterval BGPTimeseriesResponseMetaAggInterval` - `const BGPTimeseriesResponseMetaAggInterval15m BGPTimeseriesResponseMetaAggInterval = "15m"` - `const BGPTimeseriesResponseMetaAggInterval1h BGPTimeseriesResponseMetaAggInterval = "1h"` - `const BGPTimeseriesResponseMetaAggInterval1d BGPTimeseriesResponseMetaAggInterval = "1d"` - `const BGPTimeseriesResponseMetaAggInterval1w BGPTimeseriesResponseMetaAggInterval = "1w"` - `ConfidenceInfo BGPTimeseriesResponseMetaConfidenceInfo` - `Annotations []BGPTimeseriesResponseMetaConfidenceInfoAnnotation` - `DataSource BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource` Data source for annotations. - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAll BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIBots BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBGP BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceBots BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceCT BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "CT"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNS BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceDos BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFw BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceFwPg BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTP BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceIQI BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceNet BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "NET"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceSpeed BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI BGPTimeseriesResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"` - `Description string` - `EndDate Time` - `EventType BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType` Event type for annotations. - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeEvent BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeGeneral BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeOutage BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypePipeline BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"` - `const BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly BGPTimeseriesResponseMetaConfidenceInfoAnnotationsEventType = "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 []BGPTimeseriesResponseMetaDateRange` - `EndTime Time` Adjusted end of date range. - `StartTime Time` Adjusted start of date range. - `LastUpdated Time` - `Serie0 BGPTimeseriesResponseSerie0` - `Timestamps []Time` - `Values []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.BGP.Timeseries(context.TODO(), radar.BGPTimeseriesParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 } ```