From 01976465960d163f30491878237ac5d046d2ce71 Mon Sep 17 00:00:00 2001 From: spbeach46 Date: Sun, 23 Aug 2020 06:08:15 -0700 Subject: [PATCH] first commit --- ebay_api_test.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ebay_api_test.py diff --git a/ebay_api_test.py b/ebay_api_test.py new file mode 100644 index 0000000..872ff78 --- /dev/null +++ b/ebay_api_test.py @@ -0,0 +1,42 @@ +import requests +import json +from bs4 import BeautifulSoup as b + + +# with open('cat_list') as jf: +# cat_list = json.load(jf) +departments = ["3034","93427"] +# keywords = input('keyword search: ') +for categoryID in departments: + params = { + "OPERATION-NAME":"findItemsByCategory", + "SECURITY-APPNAME":"scottbea-xlister-PRD-6796e0ff6-14862949", + "SERVICE-VERSION":"1.13.0", + "RESPONSE-DATA-FORMAT":"JSON", + "categoryId":categoryID , + "paginationInput.entriesPerPage":"100", + "outputSelector":"AspectHistogram" + } + + response = requests.get("https://svcs.ebay.com/services/search/FindingService/v1", params=params) # + data = response.json() + pretty_data = json.dumps(data, indent=2) + + +# header_dict = dict(response.headers) +# pretty_header = json.dumps(header_dict, indent=2) + +# results = data['findItemsByCategoryResponse'][0]['searchResult'][0]['item'] + + + +# Before moving onto to the Trading api make sure you check to see if the Finding api will +# output the labels you need. Look into "outputselector" and "aspectfilter" on the +# Finding api --> "finditembykeyword" or other specific calls + + +# I think you'll have to paginate the results to output an aspecthistogram cause you might be getting too many results per call. + +# Additional problem you will run into when getting labeled data is shoe types and features not in features, accents, styles, categories or subcategories. + +# Also, if you can filter by category ids after conducting a very broad search maybe that will be a good way to return the aspect histogram. But you may have to just to a search for each ctegory and return the item specifics, create a giant pandas df and find make a list from the unique specifics/ labels \ No newline at end of file