Python Forum
ebaysdk and pulling back customer feedback
Thread Rating:
  • 3 Vote(s) - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ebaysdk and pulling back customer feedback
#1
I am working with ebaysdk and pulling back customer feedback. I get the results back, but do not know how to parse them correctly. I think they come back as json. Here is sample code.
api.execute('GetFeedback', {'ItemID':ItemID,'DetailLevel':'ReturnAll'}).dict()  # change for AddItem resource
#dump(api)
if api.response.reply.has_key('FeedbackDetailArray'):
   feedback = api.response.reply.FeedbackDetailArray.FeedbackDetail
   for ebay_return in feedback:
        print(ebay_return)
My results:
Output:
{'ItemID': '201632456626', 'CommentText': 'Love their promptness on answering questions! Product arrived exceptionally fast', 'FeedbackID': '137423231013', 'ItemPrice': {'_currencyID': 'USD', 'value': '1254.99'}, 'ItemTitle': '11881 Borla ATAK Rear Exhaust Fits 2014-2016 Chevy Corvette C7 6.2L V8 w/o NPP', 'CommentingUser': 'janellene.lopez0012', 'CommentTime': datetime.datetime(2017, 3, 3, 14, 2, 58), 'CommentType': 'Positive', 'TransactionID': '14934424962579010', 'OrderLineItemID': '20124296626-149392323010', 'CommentingUserScore': '1', 'Role': 'Seller'} {'ItemID': '2016043496626', 'CommentText': 'Great Buyer, fast payment, please come back anytime.', 'FeedbackID': '987637060024', 'CommentType': 'Positive', 'CommentingUser': 'midwestaftermarket2013', 'CommentTime': datetime.datetime(2017, 3, 1, 0, 35, 18), 'Role': 'Buyer', 'TransactionID': '1446577962579010', 'OrderLineItemID': '201607434626-14943439010', 'CommentingUserScore': '17991'}
Reply
#2
If it is Json you get back: 
import json

feedback = api.response.reply.FeedbackDetailArray.FeedbackDetail
data = json.loads(feedback)
Now should data be dictionary and you parse it as a dictionary.
The dictionary has usually a mix of dict and list when data comes from Json.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pulling Specifics Words/Numbers from String bigpapa 2 752 May-01-2023, 07:22 PM
Last Post: bigpapa
  Having trouble installing scikit-learn via VSC and pulling my hair out pythonturtle 1 756 Feb-07-2023, 02:23 AM
Last Post: Larz60+
  (Python) Pulling data from UA Google Analytics with more than 100k rows into csv. Stockers 0 1,223 Dec-19-2022, 11:11 PM
Last Post: Stockers
  Pulling username from Tuple pajd 21 3,350 Oct-07-2022, 01:33 PM
Last Post: pajd
  pulling multiple lines from a txt IceJJFish69 3 2,573 Apr-26-2021, 05:56 PM
Last Post: snippsat
  How to add previous date infront of every unique customer id's invoice date ur_enegmatic 1 2,233 Feb-06-2021, 10:48 PM
Last Post: eddywinch82
  Examples of Customer requirements ComputerAstronaut 1 1,839 Dec-08-2020, 03:22 AM
Last Post: Larz60+
  Pulling Information Out of Dictionary Griever 4 2,891 Aug-12-2020, 02:34 PM
Last Post: Griever
  Pulling & Reading Date from UDF that Compare it to Live Data firebird 4 2,769 Jul-20-2019, 09:30 AM
Last Post: snippsat
  Pulling data from Sharepoint list gandiswapna0388 1 2,606 Jul-17-2019, 08:35 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020