I would like to use rozzac90/pinnacle API python wrapper github project for placing automated bet on Pinnacle.
I would like to know, what is the best method for getting the actual main market for an event, if I know the home and away team names. I'm using something like this in order to get the markets:
soccer_events = api.market_data.get_fixtures(29)
for league in soccer_events[u'league']:
for event in league[u'events']:
if event[u'status'] == 'I':
fixtures[i].append(league[u'id'])
fixtures[i].append(event[u'id'])
fixtures[i].append(event[u'home'])
fixtures[i].append(event[u'away'])
fixtures.append([])
i=i+1
After that I cycle through the home and away elements for names, and select the best matching. BUT Sometimes if I get the right home and away names the corresponding eventid is not always valid, and that is my main problem. I discovered that there could be multiple eventids associated with the same team names in different fixtures[] location.
Anybody could help me filter only the right and actual events?
Best Regards