I would like to use the API to add a specific football market to Guardian. Using addMarkets allows you to specify an market ID
http://localhost:9002/api/guardian/v1.0/addMarkets
but how do i find the ID - I would like to specify the home and away team to be able to locate the ID
The only way I can think is to add all the soccer markets and then work through each one removing them if they don't match.
Is there a better way?
Get Football Market using team names
- jamesedwards
- Posts: 5011
- Joined: Wed Nov 21, 2018 6:16 pm
Not API, but you can just drop a list of team names into the Guardian market selection tool, and from there you can extract the market ID if you need it.sibur wrote: ↑Thu Dec 04, 2025 6:24 pmI would like to use the API to add a specific football market to Guardian. Using addMarkets allows you to specify an market ID
http://localhost:9002/api/guardian/v1.0/addMarkets
but how do i find the ID - I would like to specify the home and away team to be able to locate the ID
The only way I can think is to add all the soccer markets and then work through each one removing them if they don't match.
Is there a better way?
The only workaround I can think of off the top of my head is to use the API to load a coupon with ALL your possible markets. Then use asibur wrote: ↑Thu Dec 04, 2025 6:24 pmI would like to use the API to add a specific football market to Guardian. Using addMarkets allows you to specify an market ID
http://localhost:9002/api/guardian/v1.0/addMarkets
but how do i find the ID - I would like to specify the home and away team to be able to locate the ID
The only way I can think is to add all the soccer markets and then work through each one removing them if they don't match.
Is there a better way?
http://localhost:9000/api/markets/v1.0/getMarkets
The response will give you the market name, type and its id once you parse it - matching on the team names. Then do a remove markets with every id you've just retrieved MINUS the one you need.
Bit longwinded but you have to have all the markets loaded into Guardian to retrieve the one you need, unless you can grab it externally. Having said that, it would only take a few secs to run the above
EDIT: Sorry, just back from a long flight and a bit tired , just realised that's pretty much what you went for as a workaround - that's the only way I can think to do it as well
