Skip to main content

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

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

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
entityIdnumberYesThe entity ID
options.includeMergedbooleanNofalseInclude 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.