Skip to content
GuidesBlogPlaygroundDashboard

List all datasets

client.Datasets.List(ctx) (*DatasetList, error)
GET/api/v1/datasets

List all datasets

ReturnsExpand Collapse
type DatasetList struct{…}

List of all available datasets.

Datasets []Dataset

Array of dataset metadata objects

ID string

Dataset UUID

formatuuid
InsertedAt Time

Creation timestamp (UTC)

formatdate-time
Name string

Human-readable dataset name

Slug string

URL-friendly identifier

UpdatedAt Time

Last update timestamp (UTC)

formatdate-time
Attribution stringoptional

Required attribution text

Description stringoptional

Dataset description

License stringoptional

License identifier (e.g. CC-BY-4.0)

SourceURL stringoptional

URL of the original data source

formaturi

List all datasets

package main

import (
  "context"
  "fmt"

  "github.com/plazafyi/plaza-go"
  "github.com/plazafyi/plaza-go/option"
)

func main() {
  client := githubcomplazafyiplazago.NewClient(
    option.WithAPIKey("My API Key"),
  )
  datasetList, err := client.Datasets.List(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", datasetList.Datasets)
}
{
  "datasets": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "inserted_at": "2019-12-27T18:11:19.117Z",
      "name": "NYC Bike Lanes",
      "slug": "nyc-bike-lanes",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "attribution": "attribution",
      "description": "description",
      "license": "license",
      "source_url": "https://example.com"
    }
  ]
}
Returns Examples
{
  "datasets": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "inserted_at": "2019-12-27T18:11:19.117Z",
      "name": "NYC Bike Lanes",
      "slug": "nyc-bike-lanes",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "attribution": "attribution",
      "description": "description",
      "license": "license",
      "source_url": "https://example.com"
    }
  ]
}