Horse Racing Forum - PaceAdvantage.Com - Horse Racing Message Board

Go Back   Horse Racing Forum - PaceAdvantage.Com - Horse Racing Message Board > Thoroughbred Horse Racing Discussion > Handicapping Software


Reply
 
Thread Tools Rate Thread
Old 06-01-2023, 10:09 AM   #1
tnt
Registered User
 
Join Date: May 2023
Posts: 2
Getting live odds through API/scraping

Has anyone been able to get a feed of live odds from a betting website (TwinSpires/AmWager/etc.) into Excel or a Python program? Their APIs seem to require authentication keys but not sure of who or where to contact to get them, while the dynamic nature of the data makes scraping likely too slow to be a good enough solution. I’ve seen that some of the programs advertised on here have live feeds of odds so it must be possible. If anyone has any insight, I’d love to hear.
tnt is offline   Reply With Quote Reply
Old 06-02-2023, 06:49 AM   #2
sjk
Registered User
 
Join Date: Feb 2003
Posts: 2,105
Amwager makes it easy to copy the exacta and win prices to your clipboard and from there you can make an excel macro to name the pertinent ranges and process further. I use an Access macro to take it from there and prepare the bets for uploading.

I expect that Jason will see this and provide further guidance.
sjk is offline   Reply With Quote Reply
Old 06-02-2023, 12:56 PM   #3
Ted Craven
Registered User
 
Ted Craven's Avatar
 
Join Date: Aug 2007
Location: Nanaimo, British Columbia, Canada
Posts: 978
1. AmWager. Contact Jason at AmWager to obtain their API (see PM). Their API indeed uses a token to access after you've registered to use it. You can set up either a 'push' (server sends you = optimal/most real-time) or 'pull' (you initiate fetch from server = pretty good real-time). Data comes in JSON format payloads (all odds matrices, results, everything you see in their ADW's UI). If you can program, consume the JSON data into whatever programming language you use and display and/or interact with the data. If you use Excel, there are Excel/JSON plugins which digest the JSON data stream and convert it to Excel data format. This is more organic (and real-time) than cutting and pasting.

2. TwinSpires. Go to their public site (i.e. no login required) - https://www.twinspires.com/bet/program/todays-races. Find a current race you like. Use your browser's Web Developer Tools to watch the network traffic. Look for JSON traffic types. Voilà - the API. (Warning: no guarantees of consistency over the years, subject to change without notice). 'Pull' only.

3. ATRPro. Great program to fetch odds data from several ADWs (not AmWager) including TwinSpires. Options to export real-time (sort of) to structured CSV files which you can then import into your Excel sheet. http://htr2.com/atr/at_the_races.htm

Best of luck!

Ted
__________________
RDSS - Racing Decision Support System™ "The Modern Sartin Methodology" . . . . www.rdss2.com




Last edited by Ted Craven; 06-02-2023 at 12:57 PM. Reason: typo
Ted Craven is offline   Reply With Quote Reply
Old 06-02-2023, 03:35 PM   #4
Dave Schwartz
 
Dave Schwartz's Avatar
 
Join Date: Mar 2001
Location: Reno, NV
Posts: 16,908
Ted, that was quite excellent.

Thank you.

Got anything like that for fast prices?

Emphasis on sites that refresh prices quickly.

Last edited by Dave Schwartz; 06-02-2023 at 03:44 PM.
Dave Schwartz is offline   Reply With Quote Reply
Old 06-02-2023, 04:02 PM   #5
tnt
Registered User
 
Join Date: May 2023
Posts: 2
This is incredibly helpful. Thank you guys!
tnt is offline   Reply With Quote Reply
Old 06-02-2023, 08:12 PM   #6
Ted Craven
Registered User
 
Ted Craven's Avatar
 
Join Date: Aug 2007
Location: Nanaimo, British Columbia, Canada
Posts: 978
Quote:
Originally Posted by Dave Schwartz View Post
Ted, that was quite excellent.

Thank you.

Got anything like that for fast prices?

Emphasis on sites that refresh prices quickly.
RDSS has an API to Equibase for fast Charts (pull only) so when the host track propagates results to them, I can pull too.

Aside from that (and not necessarily any slower), I also do a Results pull from TwinSpires on a 10 second increment refresh starting about 2 minutes after the Official OFF signal until the Results data fetched indicates 'populated' (i.e. I got the quick Results and Mutuel prices). Also, if I'm watching live video and see the Official Results broadcast, usually within a few seconds, a manual refresh on TwinSpires' Results API populates RDSS' database, screens, models, etc. About the same time as the roll-over to the next race live odds.

The same turnaround for Results applies to AmWager's Results API (just not all tracks, due to CDI track content restrictions).

Usually, full Result Charts follow from Equibase/TrackMaster within about 20 minutes of Official status.

Hope that's helpful Dave!

Ted
__________________
RDSS - Racing Decision Support System™ "The Modern Sartin Methodology" . . . . www.rdss2.com




Last edited by Ted Craven; 06-02-2023 at 08:14 PM.
Ted Craven is offline   Reply With Quote Reply
Old 06-02-2023, 10:35 PM   #7
Dave Schwartz
 
Dave Schwartz's Avatar
 
Join Date: Mar 2001
Location: Reno, NV
Posts: 16,908
I find EqB to slow.

What I need is the results within a minute after the race is official in order to properly size my next bet.

Copy & paste is an option.
Dave Schwartz is offline   Reply With Quote Reply
Old 06-03-2023, 12:20 AM   #8
Ted Craven
Registered User
 
Ted Craven's Avatar
 
Join Date: Aug 2007
Location: Nanaimo, British Columbia, Canada
Posts: 978
Quote:
Originally Posted by Dave Schwartz View Post
I find EqB to slow.

What I need is the results within a minute after the race is official in order to properly size my next bet.

Copy & paste is an option.

As mentioned, I find TwinSpires Results API call to be functional within a few seconds of race Official. Should provide all that's needed for programmatic future bet sizing in the same time frame.

AmWager's 'push' Results API data would be the most timely. Their own UI refreshes as a result of the very same API as what one could access in one's own program. So could all accessible APIs for all ADWs - just, many/most of the others have higher barriers to access.

Ted
__________________
RDSS - Racing Decision Support System™ "The Modern Sartin Methodology" . . . . www.rdss2.com



Ted Craven is offline   Reply With Quote Reply
Reply

Tags
api, live odds




Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

» Advertisement
» Current Polls
Wh deserves to be the favorite? (last 4 figures)
Powered by vBadvanced CMPS v3.2.3

All times are GMT -4. The time now is 05:29 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 1999 - 2023 -- PaceAdvantage.Com -- All Rights Reserved
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program
designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.