Skip to content

Instantly share code, notes, and snippets.

@anndoko
Created October 31, 2017 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anndoko/894a70e0853dfec6032d2c10d8a9f463 to your computer and use it in GitHub Desktop.
Save anndoko/894a70e0853dfec6032d2c10d8a9f463 to your computer and use it in GitHub Desktop.
# 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