Free £25 Bet!
Free £200 Bet - Register on Saturday or Sunday
Free £25 Bet!

In association with Sports-Punter Free Bets Odds Comparison BetHelp Limso

We are the Official Forum of FreeBetting.net & FCBet.com


Sports News Sports Stats Live Scores OddsChecker Place Bets Suggest a Site


Go Back   The Punters Lounge - The World's Best Betting Forum > Systems, Strategy and General Betting Help > Punters Tools & General Betting Help Forum

Punters Tools & General Betting Help Forum Everyone has tools that use to help them bet. Match reports, odds comparison services, tipster services, betting calculators, selection software - discuss them here.

UK & Irish Football Forum | Western European Football Forum | UEFA Cup & Champions League Football Forum | International Football Forum | Eastern & Southern European Football Forum | Nordic & Scandinavian Football Forum | Non European Football Forum | At The Races Forum | At The Races Systems Forum | Other Sports Forum | USA Sports Forum | Fantasy & Fun Comps Forum | Free Bets Forum | Systems & Strategy Forum | Glory Hunter's Forum | Tipster's Challenge Forum | Daily Racing Comp Forum | Euro & Worldwide Comp Forum | Poker Tourneys Forum | Poker Strategy Forum | Poker Chat Forum | Poker Live Forum | Poker Challenges Forum | Poker Staking Forum | e-Sport Poker League Forum | Bookmakers & Exchanges Forum | Punter's Tools/Betting Help Forum | General Chat Forum | Tech & Gaming Forum | Sports Banter Forum | Live Sports Feeds Forum

Reply
 
Thread Tools Display Modes
Old 17-05-2008, 07:28   #21 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Here is the xml as it is sent (token not real), without the VB6 Quote handling stuff i have to use :

HTML Code:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><logout xmlns="https://api.betfair.com/global/v3/BFGlobalService"><request><header><clientStamp>0</clientStamp><sessionToken>0123456789</sessionToken></header></request></logout></soap:Body></soap:Envelope>
Trilobite is online now   Reply With Quote
Old 17-05-2008, 08:47   #22 (permalink)
Junior Punter
 
Join Date: 28 Oct 2004
Posts: 58
Default Re: Betfair Free API

To me it doesn't look in any way like a proper response to the Logout call (even a wrong one). The only thing I suggest is...

set http header SOAPAction to https://api.betfair.com/global/v3/BF...Service/Logout

and send http post request to https://api.betfair.com/global/v3/BFGlobalService

I think yours is different to this but I've just had a quick look.
arcadia00 is offline   Reply With Quote
Old 17-05-2008, 10:27   #23 (permalink)
Junior Punter
 
Join Date: 28 Oct 2004
Posts: 58
Default Re: Betfair Free API

Sorry, do you have the API6 reference guide?

http://bdphelp.betfair.com/API6/6.0/...tml/wwhelp.htm

Look at
The Connection End-point URLs for the API

you seem to be using an old old one with
https://api.betfair.com/betex-api-public-ws/BFService

I'm slightly confused as you've said Login & GetMarketPricesCompressed is working for you so I'd've thought they might not work too if you're POSTing to an old URL.
arcadia00 is offline   Reply With Quote
Old 17-05-2008, 10:29   #24 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

That did it mate

It was the MakeSOAPRequest "POST" function that was wrong.

changed it from :

HTML Code:
oHTTP.open "POST", "https://api.betfair.com/betex-api-public-ws/BFService", False
to

HTML Code:
oHTTP.open "POST", "https://api.betfair.com/global/v3/BFGlobalService", False

and was logged out OK



Return was :

HTML Code:
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n2="http://www.betfair.com/publicapi/types/global/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><n:logoutResponse xmlns:n="http://www.betfair.com/publicapi/v3/BFGlobalService/"><n:Result xsi:type="n2:LogoutResp"><header xsi:type="n2:APIResponseHeader"><errorCode xsi:type="n2:APIErrorEnum">OK</errorCode><minorErrorCode xsi:nil="1"></minorErrorCode><sessionToken xsi:nil="1"></sessionToken><timestamp xsi:type="xsd:dateTime">2008-05-17T10:27:39.169Z</timestamp></header><minorErrorCode xsi:nil="1"></minorErrorCode><errorCode xsi:type="n2:LogoutErrorEnum">OK</errorCode></n:Result></n:logoutResponse></soap:Body></soap:Envelope>

So do we need to change the "POST" url address for different API requests then ?

Or will that one now cover getting the horse racing market, getting the pricescompressed and placing the bet ?


Thanks again mate
Trilobite is online now   Reply With Quote
Old 17-05-2008, 10:32   #25 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Quote:
Originally Posted by arcadia00 View Post
Sorry, do you have the API6 reference guide?

http://bdphelp.betfair.com/API6/6.0/...tml/wwhelp.htm

Look at
The Connection End-point URLs for the API

you seem to be using an old old one with
https://api.betfair.com/betex-api-public-ws/BFService

I'm slightly confused as you've said Login & GetMarketPricesCompressed is working for you so I'd've thought they might not work too if you're POSTing to an old URL.

Yes both login and pricecompressed working fine, updating fine in-running using that old address .

Iam using Betfair Sports Exchange API 5.5 Reference Guide.chm
Trilobite is online now   Reply With Quote
Old 17-05-2008, 10:50   #26 (permalink)
Junior Punter
 
Join Date: 28 Oct 2004
Posts: 58
Default Re: Betfair Free API

Quote:
Originally Posted by Trilobite View Post
So do we need to change the "POST" url address for different API requests then ?

Or will that one now cover getting the horse racing market, getting the pricescompressed and placing the bet ?
There are 3 URLS one for global calls like login logout keepalive, one for exchange calls which is most others, and one for australian events like if you want GetMarketPrices for the Melbourne Cup. Which is just daft.


https://api.betfair.com/global/v3/BFGlobalService




https://api.betfair.com/exchange/v5/BFExchangeService





https://api-au.betfair.com/exchange/...xchangeService
arcadia00 is offline   Reply With Quote
Old 17-05-2008, 10:56   #27 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Thanks, just reading The Connection End-point URLs for the API Services part now.

So its a simple update to make two MakeSOAPRequest functions, one for Global and one for Exchange url's.

Cheers
Trilobite is online now   Reply With Quote
Old 17-05-2008, 11:06   #28 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Ok that was a quick change, all ok now using 2 functions for the 2 url's

I wonder if the old url i was using has an advantage being that everyone else will be using the proper url that is documented ?

Its something i will keep in mind if there are problems using the proper url !
Trilobite is online now   Reply With Quote
Old 17-05-2008, 14:15   #29 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Does this look like a working placeBet call ?

Nice Wee Girl - Newb 17th May - 16:30 7f Hcap
£2.00 BACK to Win @ 8.0


HTML Code:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <placeBets xmlns="https://api.betfair.com/exchange/v3/BFExchangeService"> <request> <header xmlns=""> <clientStamp>0</clientStamp> <sessionToken>0123456789</sessionToken> </header> <bets xmlns=""> <PlaceBets xmlns="http://www.betfair.com/publicapi/types/exchange/v3/"> <asianLineId xmlns="">0</asianLineId> <betType xmlns="">B</betType> <marketId xmlns="">21008758</marketId> <price xmlns="">8.0</price> <selectionId xmlns="">2481355</selectionId> <size xmlns="">2</size> </PlaceBets> </bets> </request> </placeBets> </soap:Body> </soap:Envelope>
Trilobite is online now   Reply With Quote
Old 17-05-2008, 16:06   #30 (permalink)
Junior Punter
 
Join Date: 28 Oct 2004
Posts: 58
Default Re: Betfair Free API

Does it work? What's there looks right, if it doesnt work, you may need to add fields for betCategoryType & betPersistanceType. See the ArrayOfPlaceBets structure in the docs.
arcadia00 is offline   Reply With Quote
Old 18-05-2008, 09:16   #31 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Day 4 i think, and i learn a bit more

If you right click the Sports API 6 (UK Exchange Services) WSDL link on the Free Access API developers page and Save As....

You end up with a file called BFExchangeService.xml

Open this in Iexplorer and you get to see all correct format to send the XML in, and also see the responses you can expect to get back.

Ive been using the API 5.5 help file, which doesn't have the placeBet format as the API 6 below.


HTML Code:
- <xsd:complexType name="PlaceBets">
- <xsd:sequence> <xsd:element name="asianLineId" nillable="false" type="xsd:int" /> <xsd:element name="betType" type="types:BetTypeEnum" /> <xsd:element name="betCategoryType" type="types:BetCategoryTypeEnum" /> <xsd:element name="betPersistenceType" type="types:BetPersistenceTypeEnum" /> <xsd:element name="marketId" nillable="false" type="xsd:int" /> <xsd:element name="price" nillable="false" type="xsd:double" /> <xsd:element name="selectionId" nillable="false" type="xsd:int" /> <xsd:element name="size" nillable="true" type="xsd:double" /> <xsd:element name="bspLiability" nillable="true" type="xsd:double" /> </xsd:sequence> </xsd:complexType>
Trilobite is online now   Reply With Quote
Old 20-05-2008, 07:52   #32 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Thanks for all the help on this thread, iam up and running now, did my first trades last night


I thought i would post the placeBet xml string i successfully used, just in case anyone has found their way to this thread via google etc


Its the same string for the Lay bet, you just change the betType xmlns part from a B to an L and make sure the bspLiability xmls covers the LAY Liability amount.



placeBet:

HTML Code:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <placeBets xmlns="https://api.betfair.com/exchange/v3/BFExchangeService"> <request> <header xmlns=""> <clientStamp>0</clientStamp> <sessionToken>01234567890=</sessionToken> </header> <bets xmlns=""> <PlaceBets xmlns="http://www.betfair.com/publicapi/types/exchange/v3/"> <asianLineId xmlns="">0</asianLineId> <betCategoryType xmlns="">E</betCategoryType> <betPersistenceType xmlns="">IP</betPersistenceType> <betType xmlns="">B</betType> <bspLiability xmls="">2.00</bspLiability> <marketId xmlns="">99999999</marketId> <price xmlns="">3.3</price> <selectionId xmlns="">99999</selectionId> <size xmlns="">2.00</size> </PlaceBets> </bets> </request> </placeBets> </soap:Body> </soap:Envelope>


The Return xml from the server:

( iam not sure why the success xsi:type part came through split by a CrLf, but i will have that covered by stripping out invalid characters like that )

HTML Code:
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n2="http://www.betfair.com/publicapi/types/exchange/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <n:placeBetsResponse xmlns:n="http://www.betfair.com/publicapi/v3/BFExchangeService/"> <n:Result xsi:type="n2:PlaceBetsResp"> <header xsi:type="n2:APIResponseHeader"> <errorCode xsi:type="n2:APIErrorEnum">OK</errorCode> <minorErrorCode xsi:nil="1"/> <sessionToken xsi:type="xsd:string">0123456789=</sessionToken> <timestamp xsi:type="xsd:dateTime">2008-05-19T18:10:33.153Z</timestamp> </header> <betResults xsi:type="n2:ArrayOfPlaceBetsResult"> <n2:PlaceBetsResult xsi:type="n2:PlaceBetsResult"> <averagePriceMatched xsi:type="xsd:double">3.3</averagePriceMatched> <betId xsi:type="xsd:long">999999999</betId> <resultCode xsi:type="n2:PlaceBetsResultEnum">OK</resultCode> <sizeMatched xsi:type="xsd:double">2.0</sizeMatched> <success xsi:type="xsd:boolean">tru
e</success> </n2:PlaceBetsResult> </betResults> <errorCode xsi:type="n2:PlaceBetsErrorEnum">OK</errorCode> <minorErrorCode xsi:nil="1"/> </n:Result> </n:placeBetsResponse> </soap:Body> </soap:Envelope>


Trilobite is online now   Reply With Quote
Old 20-05-2008, 13:04   #33 (permalink)
Junior Punter
 
Join Date: 28 Oct 2004
Posts: 58
Default Re: Betfair Free API

Maybe you can help me. Let me ask you the question without poisoning your mind with what I am doing wrong. How would you set up a single PlaceBets call so that you requested a normal lay; then have any unmatched portion (or all if none at all was matched) become a BSP (Betfair Starting Price) lay at off time.
arcadia00 is offline   Reply With Quote
Old 20-05-2008, 14:39   #34 (permalink)
Legendary Punter
 
Trilobite's Avatar
 
Join Date: 17 Oct 2006
Posts: 1,556
Awards Showcase
Daily Horse Racing Competition Daily Horse Racing Competition 
Total Awards: 2
Default Re: Betfair Free API

Iam not sure, is that handled by the betPersistenceType
Trilobite is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts



All times are GMT. The time now is 14:27.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

Free £100 Bet!
Online Bookmakers
Free £100 Bet!

Recommended Bookies: Bet365 | BetDirect | | Blue Square | Canbet | Centrebet | Coral | Eurobet | Ladbrokes | Paddy Power | Party Bets | Pinnacle Sports | Skybet | SportingBet | Stan James | ToteSport | VCBet

Recommended Betting Exchanges: | Betfair | WBX

Recommended for Spread Betting: Sporting Index |
Partner Sites
Football Betting Tips Free Bets Australian Free Bets HOT Odds Comparison Soccer Punter
Bookmakers Livescore SoccerVista Asian Handicap Betting Guide

Contact Us | Disclaimer


© 2008 PuntersLounge.Com Ltd | Gambling Problems?

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.