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

# Artists

> List and retrieve artists for a project with the SDK.

## list()

Returns a paginated list of root artists for a project. Artists are extracted from contract documents and de-duplicated via merging.

### Signature

```js theme={null}
royaltyport.artists.list(projectId, options?)
```

### Parameters

| Parameter               | Type      | Required | Default | Description                   |
| ----------------------- | --------- | -------- | ------- | ----------------------------- |
| `projectId`             | `string`  | Yes      | —       | The project ID                |
| `options.page`          | `number`  | No       | `1`     | Page number                   |
| `options.perPage`       | `number`  | No       | `20`    | Items per page (max: 100)     |
| `options.includeMerged` | `boolean` | No       | `false` | Include merged artist records |

### Example

```js theme={null}
import { Royaltyport } from '@royaltyport/sdk';

const royaltyport = new Royaltyport({
  apiKey: 'rp_your_token_here',
});

const { data } = await royaltyport.artists.list('project-id', {
  page: 1,
  perPage: 50,
  includeMerged: true,
});

for (const artist of data.items) {
  console.log(artist.name);
  if (artist.merged?.length) {
    console.log('  Merged from:', artist.merged.map(m => m.name).join(', '));
  }
}
```

***

## get()

Returns a single artist by ID.

### Signature

```js theme={null}
royaltyport.artists.get(projectId, artistId, options?)
```

### Parameters

| Parameter               | Type      | Required | Default | Description                   |
| ----------------------- | --------- | -------- | ------- | ----------------------------- |
| `projectId`             | `string`  | Yes      | —       | The project ID                |
| `artistId`              | `number`  | Yes      | —       | The artist ID                 |
| `options.includeMerged` | `boolean` | No       | `false` | Include merged artist records |

### Example

```js theme={null}
import { Royaltyport } from '@royaltyport/sdk';

const royaltyport = new Royaltyport({
  apiKey: 'rp_your_token_here',
});

const { data: artist } = await royaltyport.artists.get('project-id', 42, {
  includeMerged: true,
});

console.log(artist.name);
```

<Note>
  The `merged` array only appears when `includeMerged` is set to `true`.
</Note>
