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

# Sweeps

[View source](https://github.com/wandb/wandb/blob/main/wandb/apis/public/sweeps.py#L67)

## Class wandb.apis.public.Sweeps

A lazy iterator over a collection of `Sweep` objects.

```python theme={"system"}
service_api: 'ServiceApi',
entity: 'str',
project: 'str',
per_page: 'int' = 50,
filters: 'dict[str, Any] | None' = None
```

## Args

**service\_api** `ServiceApi`

The service API used to query W\&B.

**entity** `str`

The entity which owns the sweeps.

**project** `str`

The project which contains the sweeps.

**per\_page** `int`

The number of sweeps to fetch per request to the API.

**filters** `dict[str, Any] | None`

(dict) queries for specific sweeps using the runs filters, See wandb/apis/public/api.py:runs for more details.

## Examples

```python theme={"system"}
from wandb.apis.public import Api

sweeps = Api().project(name="project_name", entity="entity").sweeps()

# Iterate over sweeps and print details
for sweep in sweeps:
    print(f"Sweep name: {sweep.name}")
    print(f"Sweep ID: {sweep.id}")
    print(f"Sweep URL: {sweep.url}")
    print("----------")
```

## Methods

### method Paginator.**next**()

```python theme={"system"}
self
```

Return the next item from the iterator. When exhausted, raise StopIteration

### method Paginator.update\_variables()

```python theme={"system"}
self
```

Update the query variables for the next page fetch.
