Giter Site home page Giter Site logo

go-apple-music's Introduction

go-apple-music

GoDoc Continuous Integration Go Report Card

A Go client library for accessing the Apple Music API.

This library is heavily inspired by go-github.

Installation

Use go get.

go get -u github.com/minchao/go-apple-music

Usage

import "github.com/minchao/go-apple-music"

Construct a new API client, then use to access the Apple Music API. For example:

ctx := context.Background()
tp := applemusic.Transport{Token: "APPLE_MUSIC_API_TOKEN"}
client := applemusic.NewClient(tp.Client())

// Fetch all the storefronts in alphabetical order
storefronts, _, err := client.Storefront.GetAll(ctx, nil)

Create a developer token

Use the token generator tool to quickly create a developer token.

$ cd examples/token-genrator
$ go build

Usage:

$ ./generate-toke
Usage: generate-token [options]
  -k string
        MusicKit key
  -l int
        TTL (time-to-live), must not be greater than 15777000 (6 months in seconds) (default 3600)
  -pf string
        MusicKit private key, the path of private key file (.p8)
  -pk string
        MusicKit private key, enter string without BEGIN and END annotations
  -t string
        Team ID

Run:

$ ./generate-toke \
    -k=MUSICKIT_KEY \
    -t=TEAM_ID \
    -pf=MUSICKIT_PRIVATE_KEY_FILE

Create a Music User Token

Use the requestUserToken(forDeveloperToken:completionHandler:) method in the StoreKit framework.

Todo

  • Fetch Recent
    • Get recently played
    • Get recent stations
  • Manage Ratings
    • Get personal album rating
    • Get multiple personal album ratings
    • Add a personal album rating
    • Delete a personal album rating
    • Get personal music video rating
    • Get multiple personal music video ratings
    • Add a personal music video rating
    • Delete a personal music video rating
    • Get personal playlist rating
    • Get multiple personal playlist ratings
    • Add a personal playlist rating
    • Delete a personal playlist rating
    • Get personal song rating
    • Get multiple personal song ratings
    • Add a personal song rating
    • Delete a personal song rating
    • Get personal station rating
    • Get multiple personal station ratings
    • Add a personal station rating
    • Delete a personal station rating
  • Fetch Recommendations
    • Get default recommendations
    • Get album recommendations
    • Get playlist recommendations
    • Get a recommendation
    • Get multiple recommendations

License

See the LICENSE file for license rights and limitations (MIT).

go-apple-music's People

Contributors

minchao avatar daltoniam avatar paulvidal avatar obrhoff avatar aaastorga avatar cuongvo avatar gitsakos avatar darkweak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.