## List datasets `client.Radar.Datasets.List(ctx, query) (*DatasetListResponse, error)` **get** `/radar/datasets` Retrieves a list of datasets. ### Parameters - `query DatasetListParams` - `DatasetType param.Field[DatasetListParamsDatasetType]` Filters results by dataset type. - `const DatasetListParamsDatasetTypeRankingBucket DatasetListParamsDatasetType = "RANKING_BUCKET"` - `const DatasetListParamsDatasetTypeReport DatasetListParamsDatasetType = "REPORT"` - `Date param.Field[Time]` Filters results by the specified date. - `Format param.Field[DatasetListParamsFormat]` Format in which results will be returned. - `const DatasetListParamsFormatJson DatasetListParamsFormat = "JSON"` - `const DatasetListParamsFormatCsv DatasetListParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `Offset param.Field[int64]` Skips the specified number of objects before fetching the results. ### Returns - `type DatasetListResponse struct{…}` - `Datasets []DatasetListResponseDataset` - `ID int64` - `Description string` - `Meta unknown` - `Tags []string` - `Title string` - `Type 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"), ) datasets, err := client.Radar.Datasets.List(context.TODO(), radar.DatasetListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", datasets.Datasets) } ``` #### Response ```json { "result": { "datasets": [ { "id": 3, "description": "This dataset contains a list of the op 20000 domains globally", "meta": {}, "tags": [ "global" ], "title": "Top bucket 20000 domains", "type": "RANKING_BUCKET" } ] }, "success": true } ```