I had a small app built for me a few years ago which takes the odds I create that are placed in an Excel workbook, then compares those odds with those available on Betfair and logs the percentage differences. It's a very straightforward app. The app worked fine for a few years and now has broken for about the fifth time. Each previous time the fix was quite simple as I think it may have been a straightforward change to a url line or similar. Anyway, the original coder has now disappeared and I'm looking for another coder who can fix it for me. The Login includes a free API key as part of the process, so the coder will require their own. I thought finding a coder to do this would be fairly straightforward but it seems it ain't. Strange really cos back about 15 years ago or so there were plenty about. Now there aren't. Weird. I know I could get GPT4 to take a look but I'm an old fart and just don't have the patience. I do however have all the source code.
Any offers ?
C# coder with own Betfair API keys required to fix an app
Depends how many years is 'a few years' ago'. Might be worth starting from scratch as many things may have changed other than simply the URL plus many coders have their own ways of structuring code so tweaking others isn't always as easy as simply switching a URL or as straightforward as you imagine.
Thanks for that. In this case I think it may well be straightforward. On the other hand, I'd be very happy to hear from any coder that would build me the necessary app. Basically that consists of taking an Excel file I have with each row being a soccer match today and each column being the odds I've calculated for H,A,D, O/U markets, correct score markets etc and then placing the current BF odds and the difference in %age in the next column. Perhaps this is something BetAngel can do already without an app being built, or at least create an Excel workbook with each sheet being the various market odds for all the games that day. I need to look a little more closely at what BA can do...Any contact from someone with an inside-out knowledge of BA would be handy. Or even a coder who thinks he could code the app. Thanks
Depends how you want to use it but you could utilise BA's ability to pass stored values in via a csv. So you could pass your own odds in to each market as a stored value - using market name, do the % difference calc in BA itself using automation, given BA holds the current prices, then display the % difference between current BF price and your own in a custom column in Guardian or a Watch List. No need for separate code
If you are looking to enter based on a set (value) difference you'd then be in an ideal position to automate the entry
https://www.betangel.com/user-guide/set ... 3D&mw=MzIw
If you are looking to enter based on a set (value) difference you'd then be in an ideal position to automate the entry
https://www.betangel.com/user-guide/set ... 3D&mw=MzIw
Good stuff. It's well worth getting to grips with Guardian to do it as well. Any minor changes, or fixes will mean you can sort it quickly yourself. Plenty of help available on here if you have any issues - plus the new AI help function is decent
-
- Posts: 35
- Joined: Sun Jun 26, 2016 7:58 pm
import requestsdrwho wrote: ↑Sun Oct 06, 2024 2:50 pmThanks for that. In this case I think it may well be straightforward. On the other hand, I'd be very happy to hear from any coder that would build me the necessary app. Basically that consists of taking an Excel file I have with each row being a soccer match today and each column being the odds I've calculated for H,A,D, O/U markets, correct score markets etc and then placing the current BF odds and the difference in %age in the next column. Perhaps this is something BetAngel can do already without an app being built, or at least create an Excel workbook with each sheet being the various market odds for all the games that day. I need to look a little more closely at what BA can do...Any contact from someone with an inside-out knowledge of BA would be handy. Or even a coder who thinks he could code the app. Thanks
import pandas as pd
# Betfair API login credentials
API_URL = "https://api.betfair.com/exchange/betting/rest/v1.0/"
APP_KEY = "your-app-key"
SESSION_TOKEN = "your-session-token"
# Excel file path
EXCEL_FILE = "matches.xlsx"
# Function to get Betfair odds for a match
def get_betfair_odds(event_id):
url = f"{API_URL}listMarketBook"
params = {
"marketIds": event_id,
"priceProjection": {
"priceData": ["EX_BEST_OFFERS"]
}
}
headers = {
"X-Application": APP_KEY,
"X-Authentication": SESSION_TOKEN
}
response = requests.get(url, params=params, headers=headers)
return response.json()
# Load the Excel file with match data
df = pd.read_excel(EXCEL_FILE)
# For each match, fetch Betfair odds and calculate the percentage difference
for index, row in df.iterrows():
match_id = row['Match ID'] # This is where your match's Betfair ID will go
betfair_odds = get_betfair_odds(match_id)
# Extract Betfair odds for H, A, D, O/U, etc.
betfair_home_odds = betfair_odds[0]['runners'][0]['lastPriceTraded']
betfair_away_odds = betfair_odds[0]['runners'][1]['lastPriceTraded']
betfair_draw_odds = betfair_odds[0]['runners'][2]['lastPriceTraded']
# Your calculated odds
calculated_home_odds = row['H-Odds']
calculated_away_odds = row['A-Odds']
calculated_draw_odds = row['D-Odds']
# Calculate percentage difference
home_diff = ((calculated_home_odds - betfair_home_odds) / betfair_home_odds) * 100
away_diff = ((calculated_away_odds - betfair_away_odds) / betfair_away_odds) * 100
draw_diff = ((calculated_draw_odds - betfair_draw_odds) / betfair_draw_odds) * 100
# Update your Excel file with the Betfair odds and differences
df.loc[index, 'BF Home Odds'] = betfair_home_odds
df.loc[index, 'BF Away Odds'] = betfair_away_odds
df.loc[index, 'BF Draw Odds'] = betfair_draw_odds
df.loc[index, 'Home Diff %'] = home_diff
df.loc[index, 'Away Diff %'] = away_diff
df.loc[index, 'Draw Diff %'] = draw_diff
# Save the updated Excel file
df.to_excel('updated_matches.xlsx', index=False)
You can also link Excel to BA’s Excel API and get market odds directly into your Excel workbook. This would allow you to populate your columns with Betfair odds.