# @distube/soundcloud

> A DisTube extractor plugin for supporting SoundCloud.

Latest version **2.0.4** (published 2024-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @distube/soundcloud
pnpm add @distube/soundcloud
yarn add @distube/soundcloud
bun add @distube/soundcloud
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; has provenance.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2024-10-27 |
| First published | 2021-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 43.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5 |
| Author | Skick |
| Maintainers | skick |
| Keywords | distube, plugin, discord, music |

## Links

- npm: https://www.npmjs.com/package/@distube/soundcloud
- Repository: https://github.com/distubejs/extractor-plugins
- Homepage: https://github.com/distubejs/extractor-plugins/tree/main/packages/soundcloud#readme
- Issues: https://github.com/distubejs/extractor-plugins/issues
- Funding: https://github.com/skick1234/DisTube?sponsor
- npm.io page: https://npm.io/package/@distube/soundcloud

## Dependencies (1)

- [soundcloud.ts](https://npm.io/package/soundcloud.ts.md) ^0.6.2

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@availity/mock-server](https://npm.io/package/@availity/mock-server.md) — 0 weekly downloads
- [@scotthuang/agent-knock-knock-pi](https://npm.io/package/@scotthuang/agent-knock-knock-pi.md) — 0 weekly downloads
- [@typestrong/ts-mockito](https://npm.io/package/@typestrong/ts-mockito.md) — 0 weekly downloads

## Recent versions

- 2.0.4 (latest) — 2024-10-27
- 2.0.3 — 2024-07-10
- 2.0.2 — 2024-06-28
- 2.0.1 — 2024-06-05
- 2.0.0 — 2024-06-05
- 1.3.5 — 2024-05-23
- 1.3.4 — 2024-05-23
- 1.3.3 — 2023-07-04
- 1.3.2 — 2023-04-16
- 1.3.0 — 2022-12-01
- 1.2.2 — 2022-09-02
- 1.2.1 — 2022-07-18
- 1.2.0 — 2022-07-18
- 1.1.0 — 2022-01-13
- 1.0.0 — 2021-10-17
- … 7 more at https://npm.io/package/@distube/soundcloud/versions

## README

<div align="center">
  <p>
    <a href="https://nodei.co/npm/@distube/soundcloud"><img src="https://nodei.co/npm/@distube/soundcloud.png?downloads=true&downloadRank=true&stars=true"></a>
  </p>
  <p>
    <img alt="npm peer dependency version" src="https://img.shields.io/npm/dependency-version/@distube/soundcloud/peer/distube?style=flat-square">
    <img alt="npm" src="https://img.shields.io/npm/dt/@distube/soundcloud?logo=npm&style=flat-square">
    <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/distubejs/extractor-plugins?logo=github&logoColor=white&style=flat-square">
    <a href="https://discord.gg/feaDd9h"><img alt="Discord" src="https://img.shields.io/discord/732254550689316914?logo=discord&logoColor=white&style=flat-square"></a>
  </p>
  <p>
    <a href='https://ko-fi.com/skick' target='_blank'><img height='48' src='https://storage.ko-fi.com/cdn/kofi3.png' alt='Buy Me a Coffee at ko-fi.com' /></a>
  </p>
</div>

# @distube/soundcloud

A DisTube extractor plugin for supporting SoundCloud.

## Feature

- Using SoundCloud API
- Support SoundCloud tracks, albums and playlists
- Search tracks/playlists on SoundCloud
- Play tracks directly from SoundCloud

## Installation

```sh
npm install @distube/soundcloud@latest
```

## Usage

### Plugin

```ts
import { Client } from "discord.js";
import { DisTube } from "distube";
import { SoundCloudPlugin } from "@distube/soundcloud";

const client = new Client();

const distube = new DisTube(client, {
  plugins: [new SoundCloudPlugin()],
});
```

### Search

```ts
const scPlugin = new SoundCloudPlugin();
scPlugin.search("A SoundCloud Playlist", "playlist", 3);
```

## Documentation

### new SoundCloudPlugin([SoundCloudPluginOptions])

- `SoundCloudPluginOptions.clientId` [string] _(optional)_: Your account's client id.
- `SoundCloudPluginOptions.oauthToken` [string] _(optional)_: Your account's oauth token. Used to fetch more data with SoundCloud Go+ account.
- How to get `clientId` and `oauthToken`? [See here](https://github.com/Tenpi/soundcloud.ts#getting-started)

#### Example

```js
new SoundCloudPlugin({
  clientId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  oauthToken: "0-000000-000000000-xxxxxxxxxxxxxx",
});
```

### SoundCloudPlugin#search(query, [type], [limit])

Searches for the given query on SoundCloud.

- Parameters

  - `query` [string] Search query.
  - `type` [string]: Type of results (`track` or `playlist`). Default is `track`.
  - `limit` [integer]: Limit the results. Default is `10`.

- Returns a `Promise<Song[]|Playlist[]>`
  - Returns a `Promise<Song[]>` if `type` parameter is `track`
  - Returns a `Promise<Playlist[]>` if `type` parameter is `playlist`

---
_Source: https://npm.io/package/@distube/soundcloud · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
