npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@manhgdev/soundcloud-web

v1.0.7

Published

JavaScript wrapper for SoundCloud API

Readme

SoundCloud API Package

Package JavaScript để tương tác với SoundCloud API một cách dễ dàng và hiệu quả.

Cài đặt

bun add @manhgdev/soundcloud-web

Khởi tạo

import SoundCloudAPI from '@manhgdev/soundcloud-web';

const api = new SoundCloudAPI({
  clientId: 'YOUR_CLIENT_ID', // Tùy chọn
  autoFetchClientId: true // Tự động lấy client ID
});

Cách sử dụng

Search Module

Tìm kiếm tất cả

const result = await api.search.all('skrillex', {
  limit: 20,
  offset: 0,
  facet: 'model',
  linked_partitioning: 1
});

Tìm kiếm bài hát

const tracks = await api.search.tracks('skrillex', {
  limit: 20,
  offset: 0,
  facet: 'genre',
  linked_partitioning: 1
});

Tìm kiếm người dùng

const users = await api.search.users('skrillex', {
  limit: 20,
  offset: 0,
  facet: 'place',
  linked_partitioning: 1
});

Tìm kiếm album

const albums = await api.search.albums('skrillex', {
  limit: 20,
  offset: 0,
  facet: 'genre',
  linked_partitioning: 1
});

Tìm kiếm playlist

const playlists = await api.search.playlists('workout', {
  limit: 20,
  offset: 0,
  facet: 'genre',
  linked_partitioning: 1
});

Tìm kiếm bài hát theo thể loại

const tracks = await api.search.byGenre('electronic', {
  limit: 10,
  offset: 0,
  sort: 'popular',
  linked_partitioning: 1
});

Tracks Module

Lấy nhiều bài hát

const tracks = await api.tracks.getMultiple([956017639, 789012]);

Lấy bình luận của bài hát

const comments = await api.tracks.getComments(956017639, {
  threaded: 0,
  limit: 200,
  offset: 0,
  linked_partitioning: 1
});

Lấy bài hát liên quan

const related = await api.tracks.getRelated(956017639, {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Users Module

Lấy thông tin người dùng

const user = await api.users.getUser(856062);

Lấy spotlight của người dùng

const spotlight = await api.users.getSpotlight(856062, {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy hồ sơ nổi bật của người dùng

const profiles = await api.users.getFeaturedProfiles(856062, {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy danh sách bài hát được thích

const likes = await api.users.getLikes(856062, {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy danh sách người đang theo dõi

const followings = await api.users.getFollowings(856062, {
  limit: 3,
  offset: 0,
  linked_partitioning: 1
});

Lấy danh sách nghệ sĩ liên quan

const artists = await api.users.getRelatedArtists(856062, {
  creators_only: false,
  page_size: 12,
  limit: 12,
  offset: 0,
  linked_partitioning: 1
});

Lấy bình luận của người dùng

const comments = await api.users.getComments(856062, {
  limit: 20,
  offset: 0,
  linked_partitioning: 1
});

Lấy stream của người dùng

const stream = await api.users.getStream(856062, {
  limit: 20,
  offset: 0,
  linked_partitioning: 1
});

Lấy bài hát nổi bật của người dùng

const topTracks = await api.users.getTopTracks(856062, {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy bài hát của người dùng

const tracks = await api.users.getTracks(856062, {
  limit: 20
});

Lấy playlist của người dùng

const playlists = await api.users.getPlaylists(856062, {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy hồ sơ web của người dùng

const webProfiles = await api.users.getWebProfiles(856062);

Playlists Module

Lấy thông tin playlist

const playlist = await api.playlists.getPlaylist(1236491080, {
  representation: 'full'
});

Lấy danh sách người thích playlist

const likers = await api.playlists.getLikers(1236491080, {
  limit: 9,
  offset: 0,
  linked_partitioning: 1
});

Lấy danh sách người repost playlist

const reposters = await api.playlists.getReposters(1236491080, {
  limit: 9,
  offset: 0,
  linked_partitioning: 1
});

Lấy playlist theo thể loại

const playlists = await api.playlists.getByGenre('electronic', {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Media Module

Lấy URL phát trực tuyến

const playbackUrl = await api.media.getPlaybackUrl(956017639);

Lấy URL tải xuống

const downloadUrl = await api.media.getDownloadUrl(956017639);

Discover Module

Lấy nội dung trang chủ

const homeContent = await api.discover.getHomeContent({
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy bài hát mới theo thể loại

const recentTracks = await api.discover.getRecentTracks('electronic', {
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Lấy bài hát mới theo quốc gia

const countryTracks = await api.discover.getRecentTracksByCountry({
  limit: 10,
  offset: 0,
  linked_partitioning: 1
});

Tham số mặc định

Tất cả các phương thức đều có tham số mặc định phù hợp:

  • limit: Số lượng kết quả tối đa (thường là 10-20)
  • offset: Vị trí bắt đầu (mặc định: 0)
  • linked_partitioning: Phân trang liên kết (mặc định: 1)
  • facet: Loại facet cho search (mặc định: 'model', 'genre', 'place')
  • threaded: Hiển thị theo thread cho comments (mặc định: 0)
  • creators_only: Chỉ hiển thị người tạo (mặc định: false)
  • page_size: Kích thước trang (mặc định: 12)
  • representation: Kiểu biểu diễn (mặc định: 'full')

Lưu ý

  • Package tự động lấy và cache client ID từ SoundCloud
  • Tất cả các request đều có timeout và retry logic
  • Hỗ trợ đầy đủ các endpoint của SoundCloud API v2
  • Có JSDoc đầy đủ cho tất cả các phương thức

License

MIT