Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tamago324/9c83e8442aafb0ee083d494e92a2d2ad to your computer and use it in GitHub Desktop.

Select an option

Save tamago324/9c83e8442aafb0ee083d494e92a2d2ad to your computer and use it in GitHub Desktop.

Spotipyのソースを見ると、コメントでどれかを渡してね!って書いてあった

https://github.com/plamere/spotipy/blob/4c2c1d763a3653aa225c4af848409ec31286a6bf/spotipy/client.py#L333-L344

    def search(self, q, limit=10, offset=0, type='track', market=None):
        """ searches for an item

            Parameters:
                - q - the search query
                - limit  - the number of items to return
                - offset - the index of the first item to return
                - type - the type of item to return. One of 'artist', 'album',
                         'track' or 'playlist'
                - market - An ISO 3166-1 alpha-2 country code or the string from_token.
        """
        return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market)

これでいいのかなと思ってしまう。でも、ライブラリを使うっていうことはたぶんAPIリファレンスを見てるはずだから、渡してきた値がおかしかったらエラーになるからわかるか...

構造体みたいなのしらべてみよう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment