> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilebox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Client.Datapoints.Query

```go theme={"system"}
func (datapointClient) Query(
    ctx context.Context,
    datasetID uuid.UUID,
    options ...datasets.QueryOption,
) iter.Seq2[[]byte, error]
```

Query datapoints from one or more collections of the same dataset.

The datapoints are lazily queried and returned as a sequence of bytes.
The output sequence can be transformed into a typed `proto.Message` using [CollectAs](/api-reference/go/datasets/CollectAs) or [As](/api-reference/go/datasets/As) functions.

## Parameters

<ParamField path="datasetID" type="uuid.UUID">
  The ID of the dataset to query.
</ParamField>

<ParamField path="options" type="[]datasets.QueryOption">
  Options for querying datapoints.
</ParamField>

## Options

<ParamField path="WithTemporalExtent(temporalExtent query.TemporalExtent)" required>
  Specify the time interval for which data should be queried.
  Right now, a temporal extent is required for every query.
</ParamField>

<ParamField path="WithSpatialExtent(spatialExtent orb.Geometry)">
  Specify the geographical extent in which to query data.
  Optional, if not specified the query will return all results found globally.
</ParamField>

<ParamField path="WithSpatialExtentFilter(spatialExtent query.SpatialExtent)">
  Specify a geographical extent with an explicit spatial filter mode and coordinate system.
</ParamField>

<ParamField path="WithCollections(collections ...*datasets.Collection)">
  Restrict the query to specific dataset collections by collection object.
</ParamField>

<ParamField path="WithCollectionIDs(collectionIDs ...uuid.UUID)">
  Restrict the query to specific dataset collections by collection ID.
</ParamField>

<ParamField path="WithSkipData()" default="false">
  Skip the data when querying datapoints.
  If set, only the required and auto-generated fields will be returned.
</ParamField>

## Returns

A sequence of bytes containing the requested data points as bytes.

<RequestExample>
  ```go Go theme={"system"}
  import (
    "time"
    datasets "github.com/tilebox/tilebox-go/datasets/v1"
  	"github.com/tilebox/tilebox-go/query"
  )

  startDate := time.Date(2014, 10, 4, 0, 0, 0, 0, time.UTC) 
  endDate := time.Date(2021, 2, 24, 0, 0, 0, 0, time.UTC) 
  queryInterval := query.NewTimeInterval(startDate, endDate)

  datapoints, err := datasets.CollectAs[*v1.Sentinel1Sar](
      client.Datapoints.Query(
        ctx,
        dataset.ID,
        datasets.WithCollectionIDs(collection.ID),
        datasets.WithTemporalExtent(queryInterval),
      ),
  )
  ```
</RequestExample>
