list()
Returns a paginated list of entities for a project. Entities represent companies, labels, publishers, and other organizations extracted from contracts.
Signature
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
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
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
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);
The merged array only appears when includeMerged is set to true.