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: 5012
- 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
The only other way I can think to do it is find\scrape the URL for the event\market on the BF website
https://www.betfair.com/exchange/plus/e ... g-34991421
https://www.betfair.com/exchange/plus/f ... .250917550
These are the ones for the event\CS market for Gladbach vs Mainz. That contains the event id\market id at the end - which you could pass to your request payload
https://www.betfair.com/exchange/plus/e ... g-34991421
https://www.betfair.com/exchange/plus/f ... .250917550
These are the ones for the event\CS market for Gladbach vs Mainz. That contains the event id\market id at the end - which you could pass to your request payload
- MemphisFlash
- Posts: 2345
- Joined: Fri May 16, 2014 10:12 pm
You could just use a text comparison rule with a list of the teams you constantly want to trade.
Why make it difficult.
Why make it difficult.
Because this is using the API and not Guardian . It's a bit more convoluted if you want one specific market loadedMemphisFlash wrote: ↑Fri Dec 05, 2025 9:34 amYou could just use a text comparison rule with a list of the teams you constantly want to trade.
Why make it difficult.
Yes, many thanks for your replies.
I get the matches on a feed that I am scraping off a website.
I had hoped there might be a search function but as has already been said, it's easier to load all the matches into guardian and use the API to remove the ones I'm not interested in.
Thanks again.
I get the matches on a feed that I am scraping off a website.
I had hoped there might be a search function but as has already been said, it's easier to load all the matches into guardian and use the API to remove the ones I'm not interested in.
Thanks again.
