Client¶
The client in PySoundCloud contains all of the functions to interface with the SoundCloud API.
-
class
pysoundcloud.Client(client_id: str)¶ -
albums(track_id: int, representation: str = 'mini', limit: int = 10, offset: int = 0) → Union[bool, pysoundcloud.soundcloudplaylists.SoundCloudPlaylists]¶ Gets albums containing a specified track
Parameters: - track_id – The track ID to find albums containing
- representation – The type of representation (either full or mini)
- limit – The number of results to return
- offset – The start position from 0
Returns: SoundCloudPlaylists containing the track, or False if response is not 200
-
client_id= ''¶ Variables: - base_url – The base url for all requests to the SoundCloud API
- client_id – The client ID to use with the SoundCloud API
-
comments()¶ Todo
Add a function to get comments on a specific track or by a specific user
-
liked_tracks(user_id: int, limit: int = 24, offset: int = 0) → Union[bool, pysoundcloud.soundcloudlikedtracks.SoundCloudLikedTracks]¶ Gets the user’s liked tracks
Parameters: - user_id – The ID of the user to find liked tracks for
- limit – The number of results to return
- offset – The start position from 0
Returns: SoundCloudLikedTracks containing all the tracks, or False if response is not 200
-
playlist(playlist_id: int = None, playlist_url: str = None, representation: str = 'full', secret_token: str = None) → Union[bool, pysoundcloud.soundcloudplaylist.SoundCloudPlaylist]¶ Get a playlist based on a specified playlist_id or playlist_url
Parameters: - playlist_id – The ID of the playlist
- playlist_url – The URL of the playlist
- representation – The playlist representation (either fill or mini)
- secret_token – An optional secret token
Returns: A SoundCloudPlaylist, or False if response is not 200
-
playlists(track_id: int, representation: str = 'mini', limit: int = 10, offset: int = 0) → Union[bool, pysoundcloud.soundcloudplaylists.SoundCloudPlaylists]¶ Gets playlists containing a specified track
Parameters: - track_id – The track ID to find playlists containing
- representation – The type of representation (either full or mini)
- limit – The number of results to return
- offset – The start position from 0
Returns: SoundCloudPlaylists containing the track, or False if response is not 200
Gets tracks related to the specified track_id
Parameters: - track_id – The track id to find related tracks for
- limit – The number of tracks to find
- offset – The number of tracks to search for from zero, so offset 10 and limit 10 means find tracks 10-20
Returns: SoundCloudRelatedTracks with the tracks, or False if response is not 200
-
search(query: str, limit: int = 10, offset: int = 0) → Union[bool, pysoundcloud.soundcloudsearchresults.SoundCloudSearchResults]¶ Search SoundCloud for the specified query For some reason it doesn’t always work and I have no clue why
Parameters: - query – The query to search for
- limit – The number of results to return
- offset – The start position from 0
Returns: SoundCloudSearchResults, or False if response is not 200
-
track(track_id: int) → Union[bool, pysoundcloud.soundcloudtrack.SoundCloudTrack]¶ Gets data about the track with the specified track_id
Parameters: track_id – The track id to search for Returns: a SoundCloudTrack with data about the track, or False if response is not 200
-
web_profiles()¶ Todo
Add a function to get the “web profiles” of a specific user
-