Football Scores, In-Play Stats & Momentum via script, using an API. Code and example BAF

sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

Dallas wrote:
Thu Jan 06, 2022 1:14 pm
I must have have missed this topic appearing over the Xmas hols

but its looks an impressive piece of work sniffer66 and of course extra thanks for sharing

Image
Cheers Dallas :)
sionascaig
Posts: 1065
Joined: Fri Nov 20, 2015 9:38 am

sniffer66 wrote:
Thu Jan 06, 2022 1:04 pm


Sionas, I think I've gone a long way, if not 100% of the way to solving the name matching issue.

Not sure what your coding is like but hopefully you can follow, using the SofaScore code I've already posted as an example. I got the idea from another post earlier today

The issue is that it's very hard to do any pattern based matching in Guardian, but easier to do in code. So, I had the idea to extract the current market name using an "Export data from CSV" rule, every x seconds. That gives you the current market name alongside any set SV's
By reading the exported CSV into my script as an array, or array of arrays, I can then do some decent string comparison checking against the market name string and pass SV values for that exact market name back into Guardian using my existing "Import data from CSV" rule


The beauty of doing it this way is you are passing back the EXACT market\selection name that BF is using, plus you only need to query external stats\data for markets your BAF is applied to, all other scraped\queried data can be ignored as it's not needed

Hope that makes sense :)
aha - you switched it round - nice one... will have a think about it..

Regards...
sionascaig
Posts: 1065
Joined: Fri Nov 20, 2015 9:38 am

Would you believe it - Leic vs Watford today, two Shown a Card markets atm....

"Shown a Card" & Shown a card?"

pffft...
asaele
Posts: 22
Joined: Fri Jul 02, 2021 8:45 am

Right now the script finds a wrong value for the home score in the game Konyaspor - Sivasspor.
It finds 1 homegoal throgh the API, while the correct one (and also the one showing on sofascore.com) is 0.

This seems to be an error in the sofascore API, or can it be something I have done wrong?
In the first case, anyone knows the error rate?
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

asaele wrote:
Sun Jan 09, 2022 11:11 am
Right now the script finds a wrong value for the home score in the game Konyaspor - Sivasspor.
It finds 1 homegoal throgh the API, while the correct one (and also the one showing on sofascore.com) is 0.

This seems to be an error in the sofascore API, or can it be something I have done wrong?
In the first case, anyone knows the error rate?
There was an U19 game with the same teams running earlier so it may have picked up the matching names. It's not 100% foolproof due to the naming issue we've discussed previously

However, if you see my more recent posts on the thread I've come up with a much better way of extracting the names used in the BF market, using the csv export rule. Just about to take my PC down due to building work over the next few days, but will try and get a script update out when I can
asaele
Posts: 22
Joined: Fri Jul 02, 2021 8:45 am

Great. Thanks a lot!
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

Unsure if this will amount to anything but a rework of the script now logs out all the available stats and momentum data every time a goal is scored. Unfortunately the historical API data doesnt capture goal times so forced to capture in real time.

A few weeks capturing though and might have aggregated data worth triggering an entry for...


Capture.JPG
You do not have the required permissions to view the files attached to this post.
footysystems
Posts: 165
Joined: Thu May 09, 2013 5:57 pm

sniffer66 wrote:
Wed Jan 12, 2022 3:50 pm
Unsure if this will amount to anything but a rework of the script now logs out all the available stats and momentum data every time a goal is scored. Unfortunately the historical API data doesnt capture goal times so forced to capture in real time.

A few weeks capturing though and might have aggregated data worth triggering an entry for...



Capture.JPG
Absolutely brilliant job Stu. Collect that data and it will present you with worthy trades.
asaele
Posts: 22
Joined: Fri Jul 02, 2021 8:45 am

sniffer66 wrote:
Wed Jan 12, 2022 3:50 pm
Unsure if this will amount to anything but a rework of the script now logs out all the available stats and momentum data every time a goal is scored.
Interesting. Is this output from betangel (a new version of the rules file), or are you doing this directly in (a new version) of the script?
Anyhow, would be very interested in a copy :D
asaele
Posts: 22
Joined: Fri Jul 02, 2021 8:45 am

sniffer66 wrote:
Wed Dec 29, 2021 7:48 am
Hopefully I've covered everything off, but shout if you have any questions or suggestions.
Once again this is great stuff!

Wondering if the inplay time is also possible to extract from the Sofascore API? In that case it would be very helpful, and solve the problem of having the correct inplay time after halftime. It is available right next to the momentum graph visually so probably accessible through the API as well?

Another nice addition would be red (and yellow) cards per team if available?

Is there a place you can find the available fields in the API? In that case I could check and change the script myself
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

asaele wrote:
Thu Feb 03, 2022 10:18 am
sniffer66 wrote:
Wed Dec 29, 2021 7:48 am
Hopefully I've covered everything off, but shout if you have any questions or suggestions.
Once again this is great stuff!

Wondering if the inplay time is also possible to extract from the Sofascore API? In that case it would be very helpful, and solve the problem of having the correct inplay time after halftime. It is available right next to the momentum graph visually so probably accessible through the API as well?

Another nice addition would be red (and yellow) cards per team if available?

Is there a place you can find the available fields in the API? In that case I could check and change the script myself
Bear with me mate. As per your pm, I'm just crash testing the feedback loop from the csv output before I post it up. Can definitely do cards and times. Once I know it has no errors I'll put it up here :)
asaele
Posts: 22
Joined: Fri Jul 02, 2021 8:45 am

:D
User avatar
Frogmella
Posts: 220
Joined: Mon May 30, 2011 2:44 pm
Location: Towcester

I tried this today. I trimmed out all the SV's except Set Current Home Score and Set Current Away Score and had them posting to the log every 60 seconds. Sadly, it only recognised one goal in one match all the other matches remained at Home Goals = 0 Away Goals = 0. In the match where it recognised the one goal it didn't recognise the subsequent goals.

When I look in the .csv file all the goals appear to be there but they weren't picked up by the .baf automation file.
User avatar
MemphisFlash
Posts: 2147
Joined: Fri May 16, 2014 10:12 pm
Location: Leicester

Capture.JPG

works a treat. :D :D :D
You do not have the required permissions to view the files attached to this post.
User avatar
MemphisFlash
Posts: 2147
Joined: Fri May 16, 2014 10:12 pm
Location: Leicester

Capture.JPG
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Bet Angel Automation - Football”