Skip to main content

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

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
options.pagenumberNo1Page number
options.perPagenumberNo20Items per page (max: 100)
options.includeMergedbooleanNofalseInclude 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

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
artistIdnumberYesThe artist ID
options.includeMergedbooleanNofalseInclude 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.