Registry / devops / soundcloud-fetch

soundcloud-fetch

JSON →
library1.2.0jsnpmunverified

SoundCloud-fetch is a TypeScript library for fetching SoundCloud resources through API v2. Current version is 1.2.0. It provides an API for accessing albums, playlists, tracks, user likes, and mixed selections. Unlike general-purpose SoundCloud APIs like soundcloud.ts, this library was designed specifically for the Volumio SoundCloud plugin, so its scope is more limited. It supports authentication via access token or cookie, with automatic client ID retrieval. Release cadence is not fixed; updates happen as needed for the plugin. The package ships with TypeScript types and requires Node.js >=20.

npm install soundcloud-fetch
INSTALL
IMPORT
SIG · SOUNDCLOUD-FETCH
S
soundcloud-fetch
devopsjavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SoundCloud
import SoundCloud from 'soundcloud-fetch';
const SoundCloud = require('soundcloud-fetch');
This package is ESM-only. CommonJS require() will fail.
SoundCloud
import SoundCloud from 'soundcloud-fetch';
import { SoundCloud } from 'soundcloud-fetch';
SoundCloud is the default export, not a named export. Named import will give undefined.
SoundCloud (type)
import type SoundCloud from 'soundcloud-fetch';
import { SoundCloud } from 'soundcloud-fetch';
For type-only imports when you only need the constructor type.

Shows basic usage: import the default export, instantiate with an access token, and fetch an album by ID.

import SoundCloud from 'soundcloud-fetch'; const api = new SoundCloud({ accessToken: process.env.SOUNDCLOUD_ACCESS_TOKEN ?? '', }); try { const album = await api.getPlaylistOrAlbum('123456'); console.log('Album:', album); } catch (error) { console.error('Error:', error); }
Debug
Known issues
breakingNode.js version 20 or higher is required due to ESM?
fix
Upgrade Node.js to version 20 or above.
affects: <20
gotchaDo not provide both accessToken and cookie; this throws an error.
fix
Use either accessToken or cookie, but not both.
affects: *
gotchaaddToPlayHistory() does not work with accessToken; requires cookie.
fix
Provide a cookie instead of accessToken when using addToPlayHistory().
affects: *
deprecatedAccess token obtained via the wiki method may expire; consider regenerating.
fix
Obtain a new access token from SoundCloud's OAuth flow.
affects: *
Errors
Common errors & fixes
SyntaxError: Named export 'SoundCloud' not found. The requested module 'soundcloud-fetch' is a CommonJS module; it may be treated as a namespace object?
Using named import { SoundCloud } instead of default import.
fix
Change to `import SoundCloud from 'soundcloud-fetch';`
Error: Access token and cookie cannot both be specified.
Providing both accessToken and cookie in constructor args.
fix
Remove one of them; use either accessToken or cookie.
TypeError: soundcloud_fetch_1.default is not a constructor
Using CommonJS require() when package is ESM-only.
fix
Switch to `import SoundCloud from 'soundcloud-fetch';` or use dynamic import().
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
soundcloud-fetch — npm install soundcloud-fetch · libregistry