Skip to content

ceebeel/audius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nim Audius API Library

A simple client library for interacting with the Audius free API. (audius.org)

Build Status Build Status Build Status


Check the module documentation. The official API documentation can be found here.

Installation

nimble install audius

Example

import audius

#Create new audius client.
let client = newAudius()

# Search users.
for user in client.searchUsers("Brownies"):
  echo "User: " & user.name

# Create new user by id.
let user = client.getUser("nlGNe")

# List user's tracks.
for track in user.tracks:
  echo "Track: " & track.title

# List user's favorite tracks.
for favorite in user.favorites:
  echo "Favorite: " & favorite.title

# List user reposted tracks.
for repost in user.reposts:
  echo "Repost: " & repost.title

# List common user's tags.
for tag in user.tags:
  echo "Tag: " & tag

# Search playlists
for playlist in client.searchPlaylists("Hot & New"):
  echo "Palylist: " & playlist.playlistName

# Create new playlist by id.
let playlist = client.getPlaylist("DOPRl")

# List tracks in playlist.
for track in playlist.tracks:
  echo "Playlist Track: " & track.title

Compilation

  • Use SSL: nim r -d:ssl examples/simple.nim
  • Add cacert.pem in your running directory.