# Users.dataSources.datasets: get

> [!NOTE]
> **Note:** Requires [authorization](https://developers.google.com/fit/rest/v1/reference/users/dataSources/datasets/get#auth).

Returns a dataset containing all data points whose start and end times
overlap with the specified range of the dataset minimum start time and
maximum end time. Specifically, any data point whose start time is less
than or equal to the dataset end time and whose end time is greater than or
equal to the dataset start time.
[Try it now](https://developers.google.com/fit/rest/v1/reference/users/dataSources/datasets/get#try-it).

## Request

### HTTP request

```
GET https://www.googleapis.com/fitness/v1/users/userId/dataSources/dataSourceId/datasets/datasetId
```

### Parameters

| Parameter name | Value | Description |
|---|---|---|
| **Path parameters** |||
| `dataSourceId` | `string` | The data stream ID of the data source that created the dataset. |
| `datasetId` | `string` | Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "<var translate="no">startTime</var>-<var translate="no">endTime</var>" where <var translate="no">startTime</var> and <var translate="no">endTime</var> are 64 bit integers. |
| `userId` | `string` | Retrieve a dataset for the person identified. Use `me` to indicate the authenticated user. Only `me` is supported at this time. |
| **Optional query parameters** |||
| `limit` | `integer` | If specified, no more than this many data points will be included in the dataset. If there are more data points in the dataset, nextPageToken will be set in the dataset response. The limit is applied from the end of the time range. That is, if <var translate="no">pageToken</var> is absent, the <var translate="no">limit</var> most recent data points will be returned. |
| `pageToken` | `string` | The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of `nextPageToken` from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller than those in the previous partial response. |

### Authorization

This request requires authorization with at least one of the following scopes:

| Scope |
|---|
| `https://www.googleapis.com/auth/fitness.activity.read` |
| `https://www.googleapis.com/auth/fitness.activity.write` |
| `https://www.googleapis.com/auth/fitness.location.read` |
| `https://www.googleapis.com/auth/fitness.location.write` |
| `https://www.googleapis.com/auth/fitness.body.read` |
| `https://www.googleapis.com/auth/fitness.body.write` |
| `https://www.googleapis.com/auth/fitness.nutrition.read` |
| `https://www.googleapis.com/auth/fitness.nutrition.write` |
| `https://www.googleapis.com/auth/fitness.blood_pressure.read` |
| `https://www.googleapis.com/auth/fitness.blood_pressure.write` |
| `https://www.googleapis.com/auth/fitness.blood_glucose.read` |
| `https://www.googleapis.com/auth/fitness.blood_glucose.write` |
| `https://www.googleapis.com/auth/fitness.oxygen_saturation.read` |
| `https://www.googleapis.com/auth/fitness.oxygen_saturation.write` |
| `https://www.googleapis.com/auth/fitness.body_temperature.read` |
| `https://www.googleapis.com/auth/fitness.body_temperature.write` |
| `https://www.googleapis.com/auth/fitness.reproductive_health.read` |
| `https://www.googleapis.com/auth/fitness.reproductive_health.write` |

For more information, see the [authentication and authorization](https://developers.google.com/fit/rest/v1/authorization) page.

### Request body

Do not supply a request body with this method.

## Response

If successful, this method returns a [Users.dataSources.datasets resource](https://developers.google.com/fit/rest/v1/reference/users/dataSources/datasets#resource) in the response body.

## Try it!


Use the APIs Explorer below to call this method on live data and see the response.