Created
October 31, 2017 23:03
-
-
Save anndoko/894a70e0853dfec6032d2c10d8a9f463 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# step 3 | |
def get_from_itunes(search_name, search_type): | |
url_parameters = {} | |
url_parameters["format"] = "json" | |
url_parameters["term"] = search_name | |
url_parameters["entity"] = search_type | |
base_url = "https://itunes.apple.com/search" | |
itunes_result_data = requests.get(url = base_url, params = url_parameters).json() | |
track_list = [] | |
for item in itunes_result_data['results']: | |
track_list.append(item['trackName']) | |
return track_list | |
print(get_from_itunes("The_Beatles", "song")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment