Betfair API integration with Excel

Dani Dobre

0

Desktop Apps Development

Microsoft Excel

The application leverages an Object-Oriented Programming (OOP) design and utilizes JSON templates to streamline the definition of markets and event types. It comprises several key classes: a controller class named App for managing a looper, a CAPI class for handling API requests to Betfair, and three classes that form the object model of Betfair: CEvent, CMarket, and CRunner. Each Event object contains a list of Market objects, while each Market object contains a list of Runner objects.
The spreadsheet updates nearly in real-time, refreshing every 2 seconds to minimize API calls, displaying odds for specified markets on the active tab. Each live match corresponds to a dedicated tab.
Placing bets is simplified, requiring users to input a Stake value, select the desired odds, and click the "Place Bet" button.
The decision to employ JSON templates stems from two primary reasons. First, the Betfair API expects JSON payloads, making it more convenient to organize the payload in a text editor rather than hard-coding it in VBA. Second, it grants users the flexibility to select which Markets (marketTypeCodes) and Events (eventTypeIds) to fetch from Betfair.
The challenge in retrieving requested information arises from the design of the Betfair API, which necessitates a multi-step process to obtain desired matches and odds. Initially, an API call fetches all live matches and their IDs. Subsequently, individual calls are made for each event ID to retrieve markets and runners. To facilitate this, the JSON templates incorporate parameterized keywords (using "@") that are dynamically replaced with appropriate values during runtime.
Like this project
0

Posted May 3, 2024

The application interfaces with the Betfair API to fetch live match data, odds, and markets. Users can place bets directly from the Excel spreadsheet.

Likes

0

Views

24

Tags

Desktop Apps Development

Microsoft Excel

Wholesale Order Form
Wholesale Order Form
Irregular Time Series Alignment and Gap Filling with Python
Irregular Time Series Alignment and Gap Filling with Python