OZmium Sports Betting and Horse Racing Forums

OZmium Sports Betting and Horse Racing Forums (http://forums.ozmium.com.au/index.php)
-   General Topics (http://forums.ozmium.com.au/forumdisplay.php?f=59)
-   -   Python help using tkinter (http://forums.ozmium.com.au/showthread.php?t=32133)

Martinw 19th January 2021 01:36 AM

TAB api
 
Have TAB changed their conditions for accessing their api? On their webpage they have an application form in order to connect to TAB. I applied a few years ago but got refused with no explanation.

Looking again, under How it works the api seems to be available.
So what is happening?
Any clarification would be great.
I am still using the Tatts api but TAB have turned off the account features and so I cannot place bets automatically.
Ta,
Martin

Shaun 19th January 2021 01:45 PM

I haven't looked at placing bets but i know i have access to all prices and form, this is just my experiment in learning to program a functional replacement for excel as i still use gruss to place my bets.

For the moment i am providing all my python code so others can learn.

Martinw 19th January 2021 03:28 PM

Re TAB
 
Thanks for that. I will look at moving across to TAB's api as soon as I can. Ta, Martin

ballybeg 19th January 2021 04:43 PM

The TAB api is accessible to pull down race data and odds and so on, but to place bets - and any access to the accounting api - you need to be approved by TAB - you will be given a client token that is used to create access tokens each time you place a bet.


When it started you needed to be Silver or (Gold?) status to get betting access to the api - that meant turnover of about $25k per year.

Not sure what the situation is now :confused:

Martinw 23rd January 2021 02:15 PM

Thanks for that. I don't want to have to throw 25k down the loo on bets I am not sure of. And I do not want to sit at my computer all day, every day to use my software and place bets manually. They have made it too hard if that is still the case. Ta, Martin

Shaun 5th March 2021 11:31 AM

I am slowly getting python to replace what i used to do in excel, so far i can pull race data and results info, i can also get past form but only what is available on race day but still useful, i have also implemented one of my black book systems to make selections and print out those selections to txt doc.

i am having one issue when getting results if they are not available it throws a KeyError

I have looked at a few options for this error but none work, all i need is if no results just to skip this section, the program still runs regardless but better to not have errors i guess.

Code:
def check_results(): global res1, res2, res3, res4 urlR = "https://api.beta.tab.com.au/v1/tab-info-service/racing/dates/" + str(date) + "/meetings/R/" + \ str(listbox1.get(ANCHOR)) + "/races/" + str(venue_numberbox.get()) + "?jurisdiction=NSW" result = requests.get(urlR) result1 = json.loads(result.content) res1 = "" res2 = "" res3 = "" res4 = "" try: res1 = result1["results"][0][0] except IndexError: pass try: res2 = result1["results"][1][0] except IndexError: pass try: res3 = result1["results"][2][0] except IndexError: pass try: res4 = result1["results"][3][0] except IndexError: pass return def results1(): global res, colour colour = "black" try: if res == "1st": colour = "darkgreen" except KeyError: pass try: if res == "2nd": colour = ("gold") except KeyError: pass try: if res == "3rd": colour = ("blue") except KeyError: pass try: if res == "4th": colour = ("purple") except KeyError: pass listbox3.itemconfig(END, fg=colour) listbox4.itemconfig(END, fg=colour) listbox5.itemconfig(END, fg=colour) listbox6.itemconfig(END, fg=colour) listbox7.itemconfig(END, fg=colour) listbox8.itemconfig(END, fg=colour) listbox9.itemconfig(END, fg=colour) listbox10.itemconfig(END, fg=colour) listbox11.itemconfig(END, fg=colour) listbox12.itemconfig(END, fg=colour) listbox13.itemconfig(END, fg=colour) listbox14.itemconfig(END, fg=colour) listbox15.itemconfig(END, fg=colour) listbox16.itemconfig(END, fg=colour) listbox17.itemconfig(END, fg=colour) listbox18.itemconfig(END, fg=colour) listbox25.itemconfig(END, fg=colour)

chook 13th March 2021 04:42 AM

Shaun: try colour like this?
a_res = **** "1st":'darkgreen', "2nd":'gold', "3rd":'blue', "4th":'purple' ****

colour = 'black'
if res in a_res:
colour = a_res[res]

key error happens if your key is not in the dictionary.

Shaun 16th May 2021 11:06 PM

Time for an update.

I have spent many hours practicing my python skills, my work is pretty average but functional.

my latest creation that can be found in my link is "BSP - 16-05-21" there is an exe plus a txt with code.

As with my other programs this will allow you to access the TAB website and gather race info, it collects race results if known.

I have included 5 systems, these aren't the holy grail but more ideas on what is possibly with python and some imagination.

The program prints out the system bets in a format that can be imported to excel, i also included a timezone list so races are listed in your timezone.

There is an info tab that explains how to run things.

have fun and any thoughts appreciated.


All times are GMT +10. The time now is 11:46 AM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.