Skip to content

chaudharypraveen98/SpotifyApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpotifyApi

It is a class based api. It makes multiple get request with the spotify.


preview


How to setup the Api :-

  1. First install requirements.txt by :- python3 install -r requirements.txt
  2. Enter the client id and secret key that you have get from the spotify developer account in the "spotify_api.py".
  3. Make a object of the class to use methods.
    Example:-
    spotify = SpotifyApi()
  4. Then you have to perform authentication for getting the access token. A access token is used to make get request. One need to understand that access token has a expiry time i.e 3600 seconds for version 1 now. But your class automatically manages that work for you. It will regenerate the token if expires. So you don't need to worry about it at all. Running authentication is one time process. For authentication simply run :-
    spotify.perform_auth()

How to use the Api:

  1. Now you can start using the methods or get requests as shown below :-
    spotify.search(query, operator=None, operator_query=None, search_type="type")
    where :-
    query = It can be anything depending on the type of search. For search type like artist, it can be Neha Kakkar, Honey Singh, Raaftar etc.
    search_type = spotify provides different type of searches like by artists, albums or tracks.
    operator = spotify provides two type of operator i.e "OR" and "NOT". NOT operator means exclude it. OR operator means anyone of both.
    operator_query = means anything you want to exclude or to make an option. example :-
    songs=spotify.search("Tony", operator="not" , operator_query="Kakkar", search_type="artist")
    The above code will search for tony but it will neglect the results which contains the Kakkar in their title.
  2. You can even search for the track in the similar way for track. Example :-
    spotify.search(Time, search_type="track")

Note : -
You can use this Spotify Api Client without any issue. Feel free to suggest changes.

Last Test : -
12 January 2021

About

It is a class based client Api. It makes multiple get request with the spotify to search songs, album, artist and the tracks..

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages