From Telegram Tip to Matched Bet: Automating BetAngel with Its API
Plenty of Betfair traders follow a tipping or alert service. The alerts usually land in a Telegram group, and someone then has to open BetAngel, find the market, work out the stake and place the bet before the price moves. That's fine for a few alerts a week. Once they arrive at all hours, or several at once, a person can't keep up, mistakes creep in and good prices get missed.
A client came to us with exactly this problem. We built them a Telegram integration that feeds BetAngel automatically through the BetAngel API. Here's what it does and how we went about it.
๐จ The problem
The client subscribed to a private Telegram group that posts football lay alerts. Each message names the fixture, the market (Match Odds or Over/Under 2.5 goals), the selection, the Betfair event and the price range the bet should be taken at. Several strategies run side by side, and each has its own staking plan and its own rule for what to do with an unmatched bet when the match goes in-play.
Placing these by hand meant:
- Having to be at the screen whenever an alert arrived
- Searching for each market in BetAngel by hand
- Working out lay stakes and liabilities under pressure
- Keeping a spreadsheet of results up to date by hand afterwards
โ๏ธ What we built
We built a small set of services that run alongside BetAngel on the client's PC. Together they cover the whole process from alert to settled result:
- Telegram listener: Connects to the group as the client's own Telegram account and picks up each new alert the moment it's posted.
- Alert parser: Reads the message and pulls out the strategy, teams, kick-off time, market, selection, Betfair event ID and price limits.
- Market matching: Asks BetAngel for its loaded markets through the API and finds the right one, by Betfair event ID first and by team names and kick-off time as a fallback. Team names are matched loosely, so differences such as accents or a missing "FC" don't cause a miss.
- Staking engine: Applies each strategy's own rules (fixed stake, fixed liability or a percentage of the bank) and rounds the price to a valid Betfair tick, so the bet is never laid above the alert's maximum.
- Bet placement: Places the lay through the BetAngel API, then sets what happens to any unmatched part at kick-off: keep it, cancel it, or take the starting price.
- Market loader: Keeps BetAngel's Guardian stocked with the day's football markets using a saved coupon, so the markets are already loaded when an alert arrives.
- Settlement and Excel log: Writes every trade to an Excel workbook, records the stake and price that were actually matched, and settles each trade with its profit or loss once the market closes.
๐ก๏ธ Safety first
Software that places bets with real money has to be careful. We built in several layers of protection:
- Dry-run by default: Out of the box everything runs except the bet itself. Each alert is parsed, matched and staked, then logged to a separate "DryRun" sheet, so the client can check the output before going live.
- Two-key arming: Live betting has to be switched on in two separate places. Changing a single setting by mistake can't start it placing real bets.
- Hard caps: A maximum stake and an optional maximum liability are applied to every bet after all the staking maths, so a bad alert or a typo in the settings can't run away with the bank.
- Single instance: Each service checks that it's the only copy running, so the same alert can never be bet twice.
๐ Easy to run day to day
The client isn't a developer, so it had to be easy to use without touching any code:
- A system tray app for changing strategy settings (staking, odds preference, persistence, caps) without editing files. It checks every change before saving it.
- A browser dashboard showing open trades, settled trades, a daily profit and loss summary and every alert received, with a date filter.
- Health checks on each service, so it's obvious at a glance if something has stopped.
- A one-click "clear data" option that archives old trades and logs before a fresh start.
๐งช Tested before it touched real money
The parsing, staking and settlement logic is covered by automated tests, and we ran the whole pipeline end to end against BetAngel in practice mode first. Testing against the live API caught things the documentation doesn't mention, such as the field names the API actually returns and which Betfair ID the alerts really contain. Those are the details that cause trouble in production if nobody checks them first.
๐ The result
Alerts are now picked up and bet within seconds, at any time of day, with consistent staking and a complete record of every trade in Excel. The client no longer has to watch the screen, and the trade log gives them reliable data to judge each strategy on.
๐ฉ Could this work for you?
If you get trading signals from Telegram, email, a spreadsheet or a website and you're still acting on them by hand, we can very likely automate it. BetAngel's API makes it possible to connect almost any data source to your Betfair account, with all the checks and controls you'd want.
As always, your strategies and data stay strictly confidential.
๐ฌ Get in touch to talk it through: tom.corcoran@tcdataconsultants.co.uk