Grabbing BF URL for market in a cell?

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
User avatar
GaryCook
Posts: 148
Joined: Sat Jan 27, 2018 6:35 pm

Is it possible to automatically insert the Betfair URL for a market in an Excel cell?

Excuse all the questions lately but in my defense, I am making money. :)
User avatar
jimibt
Posts: 4197
Joined: Mon Nov 30, 2015 6:42 pm

Gary -yes, sure it's possible. In cell A1 (hidden) you have the marketid of the event. depending on the market, you'd use the betfair url and concatenate as required. e.g. if it were for horseracing, the url scheme is: https://www.betfair.com/exchange/plus/h ... .167343058.

Therefore, you'd concatenate A1 along the lines of:

Code: Select all

marketUrl = "1.167343058" ' cached from cell A1
marketUrlLink = "https://www.betfair.com/exchange/plus/horse-racing/market/" & marketUrl 

' then - insert marketUrlLink into the required cell, either as a link or hard text, depending on your requirement
AddHyperlinkToCell ActiveSheet,  "N24", marketUrlLink

Code: Select all

Sub AddHyperlinkToCell(targetSheet as WorkSheet, cellTarget as String, marketUrlLink as String)
    targetSheet.Hyperlinks.Add Range(cellTarget), Address:= marketUrlLink
End Sub
Hope this helps.
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

If the URL is in A1 you have so many options to get data from the betfair site using the various URL's that are used to grab the inital data from Betfair been a while since screen scraping as I use the API now but used to use the following to grab certain types of data. There are many types of data like RUNNER_METADATA you can request, or omit, and it all comes back as json.

https://www.betfair.com/www/sports/exch ... R_METADATA
User avatar
GaryCook
Posts: 148
Joined: Sat Jan 27, 2018 6:35 pm

spreadbetting wrote:
Mon Jan 13, 2020 5:09 pm
If the URL is in A1 you have so many options to get data from the betfair site using the various URL's that are used to grab the inital data from Betfair been a while since screen scraping as I use the API now but used to use the following to grab certain types of data. There are many types of data like RUNNER_METADATA you can request, or omit, and it all comes back as json.

https://www.betfair.com/www/sports/exch ... R_METADATA
Do you have an example, please mate?
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”