Hi everyone,
I’m using the Bet Angel API and I place a bet about one minute before the event starts.
The issue I’m having is that if the bet is not fully matched when the event goes in-play, the unmatched part gets cancelled automatically. Even if part of the stake is matched, the remaining unmatched stake is cancelled at the start of the event.
Is there a way to make the bet remain active when the event goes in-play?
I would like to set it the same way as in the Bet Angel software using the “Keep” option, so the unmatched portion stays in the market after it turns in-play.
I’m working in Python. If someone could guide me on how to set the bet to “Keep” via the API, I would really appreciate it.
Thanks in advance!
How to set bets to "Keep" via Bet Angel API (Python)
Code: Select all
def modify_bets(self, market_id: str, bet_refs: list[str], at_inplay: str = "KEEP") -> dict:
url = f"{self.base_url}betting/v1.0/modifyBets"
payload = {
"marketId": market_id,
"async": False,
"betsToModify": [{"betRef": br, "newAtInplayOption": at_inplay} for br in bet_refs]
}
r = requests.post(url, headers=self.headers, json=payload, timeout=20)
r.raise_for_status()
return r.json()