list()
Returns a paginated list of recordings for a project.
Signature
royaltyport.recordings.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.includeProducts | boolean | No | false | Include 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
| Parameter | Type | Required | Default | Description |
|---|
projectId | string | Yes | — | The project ID |
recordingId | number | Yes | — | The recording ID |
options.includeProducts | boolean | No | false | Include 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.