Socket
Socket
Sign inDemoInstall

audius

Package Overview
Dependencies
7
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    audius

🔊 Easy-to-use, promise-based API bindings for Audius.


Version published
Maintainers
1
Install size
513 kB
Created

Readme

Source

JavaScript API bindings for Audius.

Need help? Join the support server!: https://discord.gg/VBDhRc8/


npm npm

Basic Usage

const Audius = require('audius')
// The app name is requested by Audius. It is not required but strongly encouraged.
// The API is open and no key is required.
const audiusApp = new Audius("My Cool App v1.0.2")

// Searching for a user
audiusApp.searchUsers('Skrillex').then(users => {
  // Provided Skrillex was the first in the list, would print "Hey, Skrillex!"
  console.log("Hey,", users[0].name + "!" )
})

Methods

All methods return promises, and are JSDoc documented, so be sure to use a modern editor such as Visual Studio Code to easily view
NameDescriptionParametersReturns
Audius#searchUsers(search: String)Find users by name.search: The search term to find users by.User[]
Audius#searchTracks(search: String)Find tracks by name.search: The search term to find tracks by.Track[]
Audius#searchPlaylists(search: String)Find playlists by name.search: The search term to find playlists by.Playlist[]
Audius#getTrack(id: String)Retrieve a track by ID.id: The unique ID of the track.Track
Audius#getUser(id: String)Retrieve a user by ID.id: The unique ID of the user.User
Audius#getPlaylist(id: String)Retrieve a playlist by ID.id: The unique ID of the playlist.Playlist
Audius#getTrendingTracks(time: String, genre: String)Get the top 100 trending tracks on Audius.time: The time range of which to get trending tracks. Either "week", "month" or "allTime". If blank, defaults to "week".
genre: The genre of which to get trending tracks for. If blank, defaults to any genre.
Track[]
Audius#getPlaylistTracks(id: String)Get the tracks of a playlist by ID.id: The unique ID of the playlist.Track[]
Audius#getUserTracks(id: String)Get the tracks uploaded by a user by ID.id: The unique ID of the user.Track[]
Audius#getUserFavourites(id: String)Get the favourites of a user by ID.id: The unique ID of the user.Favourite[]
Audius#streamTrack(id: String, download: Boolean)Stream the data of a track by ID.id: The unique ID of the track.
download: Whether to return once the entire file has been downloaded or return incomplete data that can be streamed.
Stream

Structures

NameDescriptionProperties
UserA user profile.albumCount: The number of albums this user has published.
bio: The bio of the user.
coverPhoto: A CoverPhoto containing three sizes of cover photo.
following: The number of accounts this user is following.
followers: The number of users that are following this account.
handle: The permanent name of the user.
id: The unique ID of the user.
verified: Whether the user is verified or not.
location: The location set on the user's profile.
name: The customisable name on the user's profile.
playlistCount: The number of playlists the user has published.
profilePicture: An Artwork containing three sizes of profile picture.
repostCount: The number of tracks the user has reposted.
trackCount: The number of original tracks the user has published.
TrackA music track.artwork: An Artwork object containing links to three different sizes of artwork.
description: The track's description.
genre: The genre of the track.
id: The unique ID of the track.
mood: The mood of the track.
releaseDate: The release date of the track.
remixOf: The original track the track remixes, if any.
repostCount: The number of times the track has been reposted.
favouriteCount: The number of times the track has been favourited.
playCount: The number of times the track has been played.
tags: The track's tags that define its content.
title: The title of the track.
user: The user that uploaded the track.
duration: The length of the track in seconds.
downloadable: Whether or not the track is downloadable.
PlaylistA playlist or album of multiple tracks.artwork: An Artwork object containing links to three different sizes of artwork.
description: The description of the playlist.
id: The unique ID of the playlist.
isAlbum: Whether the playlist is an album or not.
name: The name of the playlist.
repostCount: The number of times the playlist has been reposted.
favouriteCount: The number of times the playlist has been favourited.
totalPlayCount: The total number of track plays in the playlist.
user: The user that made the playlist.
ArtworkA piece of artwork shown on a track, playlist or profile picture.small: The small 100x100 artwork.
medium: The medium 480x480 artwork.
large: The large 1000x1000 artwork.
CoverPhotoA cover photo on a user profile.small: The small 640x640 cover photo.
large: The large 2000x2000 cover photo.
FavouriteA favourited item, such as a track. Does not contain the item itself, only the link between the user and the item.id: The unique ID of the favourite.
type: The type of Item this favourite is.
userID: The unique ID of the user that made this favourite.

Keywords

FAQs

Last updated on 01 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc