Skip to content
GuidesBlogPlaygroundDashboard

Get dataset by ID

client.Datasets.Get(ctx, id) (*Dataset, error)
GET/api/v1/datasets/{id}

Get dataset by ID

ParametersExpand Collapse
id string
ReturnsExpand Collapse
type Dataset struct{…}

Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data.

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

Get dataset by ID

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"),
  )
  dataset, err := client.Datasets.Get(context.TODO(), "id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", dataset.ID)
}
{
  "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
{
  "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"
}