rozzac90 / matchbook

Python wrapper for Matchbook API
MIT License
15 stars 10 forks source link

Reporting Errors #7

Open xgshark opened 6 years ago

xgshark commented 6 years ago

api = APIClient(user, password) api.login() api.reporting.get_current_bets() # returns empty list api.reporting.get_settled_bets() # returns empty list api.reporting.get_current_offers(per_page=50) # doesn't return anything within a few minutes

My account has current bets, live bets and current offers so should return something.

I used a debugger trying to find the code piece where the error occurs. I think it is in baseendpoint.py lines 33 or BaseEndpoint.request(...):

resp_data = response.json().get(target, [])

response._content has all the data but that line returns an empty list for resp_data. target is 'bets'.

This is a part from response.content:

"bets":[{"matched-bet-id":829296724400146,"matched-at":"2018-06-13T10:42:23.870Z","status":"OPEN","in-play":false,"odds":1.01000,"stake":0.87766,"exposure":0.00878,"potential-profit":0.87766,"adjustments":[],"offer-id":828688615560046}]}]}]},{"event-id":617664073170013,"name":"FIFA World Cup 2018","sport-id":15,"sport-url":"soccer","sport-name":"Soccer","start-time":"2018-06-14T13:55:00.000Z","markets":[{"market-id":617680635230012,"name":"Outright Winner","stake":8.12634,"exposure":8.12634,"potential-profit":636.34433,"selections":[{"selection-id":"617680635300012_back","runner-id":617680635300012,"name":"Germany","side":"BACK","odds":6.10000,"stake":7.12634,"exposure":7.12634,"potential-profit":36.34433,

Is there an easy fix for this?

xgshark commented 5 years ago

Target needs to be "events" in reporting.py:125

Is this still maintained?

Cally99 commented 5 years ago

@xgshark Did you ever get the reporting function to work?