How to set bets to "Keep" via Bet Angel API (Python)

The Bet Angel API makes it easy for you to further enhance your betting and trading by integrating your own code into Bet Angel
Post Reply
AVRX
Posts: 25
Joined: Thu Jul 05, 2018 11:14 pm

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!
sniffer66
Posts: 1867
Joined: Thu May 02, 2019 8:37 am

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()
Get your bet_ref and run something like this against it
Post Reply

Return to “Bet Angel - API”