diff --git a/shopping_api.py b/shopping_api.py index 9e1e48d..5591078 100644 --- a/shopping_api.py +++ b/shopping_api.py @@ -33,9 +33,10 @@ class FindingApi: response = requests.get("https://svcs.ebay.com/services/search/FindingService/v1", params=params) data = response.json() - pretty_data = json.dumps(data, indent=2) - itemid_results_list.append( - item_id_results = map(str, itemid_results_list)) + for item in data['findItemsByCategoryResponse'][0]['searchResult'[0]['item']: + itemid_results_list.append(item['itemId']) # above this line you will have to check whether the id exists in the pandas dataframe before you go on to create your list for the shopping + #api: check df --> if does not exist, append itemId to itemid_results_list --> with curated list, make a list of 20-itemId lists. + item_id_results = list(map(str, itemid_results_list)) item_id_results = ','.join(item_id_results) # you will have to split this into 20 item lists strings to feed into ItemID param. Consider making a list of str lists. return item_id_results