> ## 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.

# Entities

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

## list()

Returns a paginated list of entities for a project. Entities represent companies, labels, publishers, and other organizations extracted from contracts.

### Signature

```js theme={null}
royaltyport.entities.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 entity records |

### Example

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

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

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

for (const entity of data.items) {
  console.log(`${entity.name} (${entity.shorthand ?? entity.name})`);

  if (entity.artists?.length) {
    console.log('  Artists:', entity.artists.map(a => `${a.name} [${a.role}]`).join(', '));
  }
}
```

***

## get()

Returns a single entity by ID.

### Signature

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

### Parameters

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

### Example

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

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

const { data: entity } = await royaltyport.entities.get('project-id', 10, {
  includeMerged: true,
});

console.log(entity.name);
console.log('Email:', entity.email);
console.log('Division of:', entity.division_of);
```

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