list()
Returns a paginated list of root artists for a project. Artists are extracted from contract documents and de-duplicated via merging.
Signature
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
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
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
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);
The merged array only appears when includeMerged is set to true.