Spotifyの.Netライブラリが凄く良かったよ
SpotifyのApiをみんなの洋楽ランキングで使いたかったのでラッパーライブラリを途中まで作ってました。
github.com
が、相当完成度の高いライブラリがありましたので自前で実装するのをやめてSpotifyAPI-NETと言うものを使いました。
github.com
Client IDとClient Secretを取得
以下を参考にしてください。
dev.classmethod.jp
認証
超楽
var auth = new CredentialsAuth(clientId, clientSecret); var token = await auth.GetToken(); _spotify = new SpotifyWebAPI() { TokenType = token.TokenType, AccessToken = token.AccessToken };
検索
_spotify.SearchItems("ariana grande", SearchType.Artist); _spotify.SearchItemsAsync("ariana grande", SearchType.Artist);
アーティスト検索
_spotify.GetArtist(id); _spotify.GetArtistAsync(id);
スタートガイド
ざっと始めるにはここ見れば一瞬でわかります。ドキュメントも豊富で超便利!
SpotifyAPI-NET/gettingstarted.md at master · JohnnyCrazy/SpotifyAPI-NET · GitHub