# List hub datasets

Source: https://stratadb.org/docs/reference/hub/list_datasets

List datasets from the selected StrataHub.

| | |
|---|---|
| Command | `hub.list_datasets` |
| CLI | `strata hub list-datasets` |
| Wire type | `hub_list_datasets` |
| Python | `db.hub.list_datasets(*, tasks: 'Union[str, Iterable[str], None]' = None, tags: 'Union[str, Iterable[str], None]' = None, primitives: 'Union[str, Iterable[str], None]' = None, license: 'Optional[str]' = None, size_min_bytes: 'Optional[int]' = None, size_max_bytes: 'Optional[int]' = None, sort: 'Any' = None, limit: 'Optional[int]' = None, offset: 'Optional[int]' = None, hub_url: 'Optional[str]' = None) -> 'Any'` |
| Access | read |
| Commit | no commit |
| Wire status | stable |

Reads `GET /v1/datasets` from the effective hub URL. Repeatable task, tag, and primitive filters preserve the StrataHub V1 query shape.

Status commands return a scalar or compact status payload and do not mutate database state.

## Examples

### Python

```python
page = db.hub.list_datasets(tasks="classification", sort="downloads", limit=5)  # doctest: +SKIP
[dataset.name for dataset in page.items]                                        # doctest: +SKIP
```

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `hub_url` | `string or null` | no | Explicit hub URL; when absent the 5-layer resolver runs. |
| `license` | `string or null` | no | License filter. |
| `limit` | `integer or null` | no | Page size. |
| `offset` | `integer or null` | no | Zero-based page offset. |
| `primitives` | `array` | no | Primitive filters. |
| `size_max_bytes` | `integer or null` | no | Maximum dataset size in bytes. |
| `size_min_bytes` | `integer or null` | no | Minimum dataset size in bytes. |
| `sort` | `any` | no | Sort key. |
| `tags` | `array` | no | Tag filters. |
| `tasks` | `array` | no | Task filters. |

## Returns

`StatusResponse<HubDatasetPage>`

- `data` (`HubDatasetPage`)
- `type` (`string`)

## Errors

Recover by code, never by message.

| Code | Retry | Commit outcome |
|---|---|---|
| [`failed_precondition.engine.runtime_closed`](https://stratadb.org/e/failed_precondition.engine.runtime_closed) | never | not_started |
| [`not_found.engine.branch`](https://stratadb.org/e/not_found.engine.branch) | never | not_applicable |
| [`unsupported.executor.hub_feature_disabled`](https://stratadb.org/e/unsupported.executor.hub_feature_disabled) | after_state_change | not_started |
| [`invalid_argument.executor.hub_url`](https://stratadb.org/e/invalid_argument.executor.hub_url) | never | not_started |
| [`unavailable.executor.hub_transport`](https://stratadb.org/e/unavailable.executor.hub_transport) | same_request | not_started |
| [`invalid_argument.executor.hub_filter`](https://stratadb.org/e/invalid_argument.executor.hub_filter) | never | not_started |

## Related

- [Read hub dataset](https://stratadb.org/docs/reference/hub/get_dataset)
- [Read hub info](https://stratadb.org/docs/reference/hub/info)
- [List hub dataset refs](https://stratadb.org/docs/reference/hub/list_refs)
- [List yanked hub refs](https://stratadb.org/docs/reference/hub/list_yanked)
