# Nested clients

Copy for LLM

Nested clients let you access related resources directly from a parent resource client, without manually constructing new client instances. For example, the runs of an Actor are available from its client.

```
import { ApifyClient } from 'apify-client';



const client = new ApifyClient({ token: 'MY-APIFY-TOKEN' });



const actorClient = client.actor('username/actor-name');

const runsClient = actorClient.runs();



// List the last 10 runs of the Actor.

const { items: runs } = await runsClient.list({ limit: 10, desc: true });



// Select the last run of the Actor that finished with a SUCCEEDED status.

const lastSucceededRunClient = actorClient.lastRun({ status: 'SUCCEEDED' });



// Fetch items from the run's dataset.

const { items } = await lastSucceededRunClient.dataset().listItems();
```

This direct access to the [dataset](https://docs.apify.com/platform/storage/dataset) (and other storage resources) from the [`RunClient`](https://docs.apify.com/api/client/js/reference/class/RunClient.md) is especially convenient when used alongside the [`ActorClient.lastRun()`](https://docs.apify.com/api/client/js/reference/class/ActorClient.md#lastRun) method.
