Skip to content

Instantly share code, notes, and snippets.

@anndoko anndoko/same_code.py
Created Oct 31, 2017

Embed
What would you like to do?
# 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
You can’t perform that action at this time.