Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apple_music

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apple_music

  • 0.3.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

AppleMusic

This is a ruby wrapper for the Apple Music API.

Installation

Add this line to your application's Gemfile:

gem 'apple_music'

And then execute:

$ bundle

Or install it yourself as:

$ gem install apple_music

Usage

AppleMusic gem was designed with usability as its primary goal:

e.g. Search Artists
artist = AppleMusic::Artist.search('Men I Trust').first # AppleMusic::Artist object
artist.genre_names # ['Electronic']
artist.id # "886240553"
albums = AppleMusic::Artist.related_albums(886240553).map(&:name) # ["Oncle Jazz", "Headroom"...
e.g. Search Albums
albums = AppleMusic::Album.search('BILL EVANS') # AppleMusic::Album object
tracks = AppleMusic::Album.related_tracks(albums[0].id)
tracks.first.name # "Waltz for Debby"
e.g. Search Songs
songs = AppleMusic::Song.search('Document', storefront: :jp) # AppleMusic::Song object
songs[0].artist_name # "TENDRE"
songs[0].album_name # "NOT IN ALMIGHTY"

Features

Currently, it work in progress, so it can use apis which does not need user token.

Albums

FeatureStatusDocsCode
Get a Catalog Album:white_check_mark::link::octocat:
Get a Catalog Album's Relationship Directly by Name:white_check_mark::link::octocat:
Get Multiple Catalog Albums:white_check_mark::link::octocat:
Get Multiple Catalog Albums by UPC:white_check_mark::link::octocat:
Get a Library Album:no_entry::link:
Get a Library Album's Relationship Directly by Name:no_entry::link:
Get Multiple Library Albums:no_entry::link:
Get All Library Albums:no_entry::link:

Artists

FeatureStatusDocsCode
Get a Catalog Artist:white_check_mark::link::octocat:
Get Multiple Catalog Artists:white_check_mark::link::octocat:
Get a Catalog Artist's Relationship Directly by Name:white_check_mark::link::octocat:
Get a Library Artist:no_entry::link:
Get All Library Artists:no_entry::link:
Get Multiple Library Artists:no_entry::link:
Get a Library Artist's Relationship Directly by Name:no_entry::link:

Songs

FeatureStatusDocsCode
Get a Catalog Song:white_check_mark::link::octocat:
Get Multiple Catalog Songs by ID:white_check_mark::link::octocat:
Get Multiple Catalog Songs by ISRC:white_check_mark::link::octocat:
Get a Catalog Song's Relationship Directly by Name:white_check_mark::link::octocat:
Get a Library Song:no_entry::link:
Get All Library Songs:no_entry::link:
Get Multiple Library Songs:no_entry::link:
Get a Library Song's Relationship Directly by Name:no_entry::link:

Music Videos

FeatureStatusDocsCode
Get a Catalog Music Video:white_check_mark::link::octocat:
Get a Catalog Music Video's Relationship Directly by Name:white_check_mark::link::octocat:
Get Multiple Catalog Music Videos by ID:white_check_mark::link::octocat:
Get Multiple Catalog Music Videos by ISRC:white_check_mark::link::octocat:
Get a Library Music Video:no_entry::link:
Get a Library Music Video's Relationship Directly by Name:no_entry::link:
Get Multiple Library Music Videos:no_entry::link:
Get All Library Music Videos:no_entry::link:

Playlists

FeatureStatusDocsCode
Get a Catalog Playlist:white_check_mark::link::octocat:
Get a Catalog Playlist's Relationship Directly by Name:white_check_mark::link::octocat:
Get Multiple Catalog Playlists:white_check_mark::link::octocat:
Get a Library Playlist:no_entry::link:
Get a Library Playlist's Relationship Directly by Name:no_entry::link:
Get Multiple Library Playlists:no_entry::link:
Get All Library Playlists:no_entry::link:

Apple Music Stations

FeatureStatusDocsCode
Get a Catalog Station:white_check_mark::link::octocat:
Get Multiple Catalog Stations:white_check_mark::link::octocat:
FeatureStatusDocsCode
Search for Catalog Resources:white_check_mark::link::octocat:
Get Catalog Search Hints:white_check_mark::link::octocat:
Search for Library Resources:no_entry::link:

Ratings

FeatureStatusDocsCode
Get a Personal Album Rating:no_entry::link:
Get a Personal Music Video Rating:no_entry::link:
Get a Personal Playlist Rating:no_entry::link:
Get a Personal Song Rating:no_entry::link:
Get a Personal Station Rating:no_entry::link:
Get Multiple Personal Album Ratings:no_entry::link:
Get Multiple Personal Music Video Ratings:no_entry::link:
Get Multiple Personal Playlist Ratings:no_entry::link:
Get Multiple Personal Song Ratings:no_entry::link:
Get Multiple Personal Station Ratings:no_entry::link:
Add a Personal Album Rating:no_entry::link:
Add a Personal Music Video Rating:no_entry::link:
Add a Personal Playlist Rating:no_entry::link:
Add a Personal Song Rating:no_entry::link:
Add a Personal Station Rating:no_entry::link:
Delete a Personal Album Rating:no_entry::link:
Delete a Personal Music Video Rating:no_entry::link:
Delete a Personal Playlist Rating:no_entry::link:
Delete a Personal Song Rating:no_entry::link:
Delete a Personal Station Rating:no_entry::link:
Get a Personal Library Music Video Rating:no_entry::link:
Get a Personal Library Playlist Rating:no_entry::link:
Get a Personal Library Song Rating:no_entry::link:
Get Multiple Personal Library Music Video Ratings:no_entry::link:
Get Multiple Personal Library Playlist Ratings:no_entry::link:
Get Multiple Personal Library Songs Ratings:no_entry::link:
Add a Personal Library Music Video Rating:no_entry::link:
Add a Personal Library Playlist Rating:no_entry::link:
Add a Personal Library Song Rating:no_entry::link:
Delete a Personal Library Music Video Rating:no_entry::link:
Delete a Personal Library Playlist Rating:no_entry::link:
Delete a Personal Library Song Rating:no_entry::link:

Charts

FeatureStatusDocsCode
Get Catalog Charts:white_check_mark::link::octocat:

Music Genres

FeatureStatusDocsCode
Get a Catalog Genre:white_check_mark::link::octocat:
Get a Catalog Genre's Relationship Directly by Name:white_check_mark::link::octocat:
Get Multiple Catalog Genres:white_check_mark::link::octocat:
Get Catalog Top Charts Genres:white_check_mark::link::octocat:

Curators

FeatureStatusDocsCode
Get a Catalog Curator:white_check_mark::link::octocat:
Get a Catalog Curator's Relationship Directly by Name:white_check_mark::link::octocat:
Get Multiple Catalog Curators:white_check_mark::link::octocat:
Get a Catalog Apple Curator:no_entry::link:
Get a Catalog Apple Curator's Relationship Directly by Name:no_entry::link:
Get Multiple Catalog Apple Curators:no_entry::link:

Recommendations

FeatureStatusDocsCode
Get a Recommendation:no_entry::link:
Get Multiple Recommendations:no_entry::link:
Get Default Recommendations:no_entry::link:

Activities

FeatureStatusDocsCode
Get a Catalog Activity:white_check_mark::link::octocat:
Get a Catalog Activity's Relationship Directly by Name:white_check_mark::link::octocat:
Get Multiple Catalog Activities:white_check_mark::link::octocat:

History

FeatureStatusDocsCode
Get Heavy Rotation Content:no_entry::link:
Get Recently Played Resources:no_entry::link:
Get Recently Played Stations:no_entry::link:
Get Recently Added Resources:no_entry::link:

Storefronts and Localization

FeatureStatusDocsCode
Get a User's Storefront:white_check_mark::link::octocat:
Get a Storefront:white_check_mark::link::octocat:
Get Multiple Storefronts:white_check_mark::link::octocat:
Get All Storefronts:white_check_mark::link::octocat:

Configuration

NOTE It's necessary to prepare an TEAM_ID, MUSIC_ID, and a secret file in advance. Please confirm Apple Developer Website.

It can be set by either an ENV variable or an config/initializers/apple_music.rb:

AppleMusic.configure do |config|
  config.secret_key_path = './AuthKey_MUSIC_ID.p8' # or ENV['APPLE_MUSIC_SECRET_KEY_PATH']
  config.team_id         = 'YOUR TEAM_ID'          # or ENV['APPLE_MUSIC_TEAM_ID']
  config.music_id        = 'YOUR MUSIC_ID'         # or ENV['APPLE_MUSIC_MUSIC_ID']
  config.storefront      = 'jp'                    # or ENV['APPLE_MUSIC_STOREFRONT'] ('us' by default)
end

License

MIT

FAQs

Package last updated on 14 Aug 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc