Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Spotify APIについて

Posted at

Spotifyって?

Spotifyは4000万以上もの曲へのアクセスを提供するデジタル音楽配信サービスです。
https://www.spotify.com/jp/

Spotify APIについて

Spotify APIはpremium会員以上だと利用できます。

サクッと概要知りたい方はこちらの記事がおすすめです。

Spotify Web APIの使い方

APIを叩く際に必要となるもの

client_id
client_secret
redirect_uri

最低限こちらの3つが必要になります。
Spotify for Developersにて作成したアプリより取得、設定できます。

手順

###1.codeを取得
client_id、client_secret、redirect_uriが必要
リンクに上記を含めて叩きます。
指定したURLにリダイレクト後クエリパラメータからcodeが取得できます。

###2.access_tokenを取得
curlで叩いた際は簡単だったのですが、axiosから取得する際にハマりました。。

###3.色々なAPIを叩いて遊んでみる

ようやくaccess_tokenが取得できたので、こちらをheadersに含めて色々なendpointを叩いてみましょう!

6
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Advent Calendar is held!

Qiita Advent Calendar is an article posting event where you post articles by filling a calendar 🎅

Some calendars come with gifts and some gifts are drawn from all calendars 👀

Please tie the article to your calendar and let's enjoy Christmas together!

6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?