BetAngel API & Guardian question

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
SteveMBets
Posts: 1
Joined: Mon Apr 07, 2025 5:57 pm

Hi all,

I'm building a Python bot that integrates with BetAngel Guardian via the local API and I've hit a wall with stored values that I'm hoping someone can help with.

**Setup:**
- BetAngel Professional v1.63
- Python bot writing stored values via POST to `http://localhost:9000/api/automation/v1 ... oredValues`
- Guardian automation rule with conditions checking stored values to trigger a LAY bet

**What I'm doing:**

My Python bot writes stored values to arm Guardian when a signal fires:

```json
{
"writeToMarketLog": true,
"markets": [{
"id": "1.23456789",
"selections": [{
"id": 12345678,
"sharedValues": [
{"n": "armed", "v": 1},
{"n": "lay_ready", "v": 1},
{"n": "entry_price", "v": 3.50},
{"n": "stake", "v": 2.0}
]
}]
}]
}
```

The BetAngel Log tab confirms the values are being written:
```
[API]: Set Stored Value (Shared) for [Runner]: armed = 1
[API]: Set Stored Value (Shared) for [Runner]: lay_ready = 1
```

**The problem:**

My Guardian rule has two conditions:
- `armed` for current selection = 1
- `lay_ready` for current selection = 1

The rule never fires. After much investigation I believe the issue is that the Conditions tab in the Guardian rule editor reads **instance-local** stored values, but the API is writing **shared** stored values — and there's no Shared checkbox visible in the Conditions tab to switch between them.

**Questions:**

1. Is there a way to write **instance-local** stored values via the `setStoredValues` API? I tried changing `sharedValues` to `instanceValues` in the payload but the API rejected it silently.

2. Is there a different payload field name for instance-local values?

3. Alternatively — is there a way to make the Guardian rule conditions read **shared** stored values written by the API?

4. Has anyone successfully triggered a Guardian rule via the API using stored value conditions?

**What I've already tried:**
- `sharedValues` in payload — values write correctly but rule doesn't fire
- `instanceValues` in payload — API call fails silently, nothing written
- Confirmed rule applies to Guardian Nominated Selection 1
- Confirmed stored values ARE being written (visible in Log tab)
- Manually setting armed=1 in BetAngel's stored values panel works (rule fires)

That last point is the key — when I set the values manually in BetAngel the rule fires correctly. So the rule configuration is right. It's purely the API-written values not being readable by the rule conditions.

Any help much appreciated. Running v1.63 on Windows 11.

Thanks
Post Reply

Return to “Bet Angel - Automation”