Skip to main content

list()

Returns a paginated list of recordings for a project.

Signature

royaltyport.recordings.list(projectId, options?)

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
options.pagenumberNo1Page number
options.perPagenumberNo20Items per page (max: 100)
options.includeProductsbooleanNofalseInclude product (release) data for each recording

Example

import { Royaltyport } from '@royaltyport/sdk';

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

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

for (const recording of data.items) {
  console.log(`${recording.name} (${recording.isrc ?? 'no ISRC'})`);

  if (recording.products?.length) {
    for (const product of recording.products) {
      console.log(`  Release: ${product.name} — UPC ${product.upc}`);
    }
  }
}

get()

Returns a single recording by ID.

Signature

royaltyport.recordings.get(projectId, recordingId, options?)

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
recordingIdnumberYesThe recording ID
options.includeProductsbooleanNofalseInclude product (release) data

Example

import { Royaltyport } from '@royaltyport/sdk';

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

const { data: recording } = await royaltyport.recordings.get('project-id', 99, {
  includeProducts: true,
});

console.log(recording.name);
console.log('Artists:', recording.artists.map(a => a.name).join(', '));
console.log('Type:', recording.type); // 'original' or 'derivative'
The products array only appears when includeProducts is set to true.