Hope someone can assist. I have written a Java app using the Betfair free API (Id 82) and have used it for years with horses (id 13) and greyhounds (id 15). I get the market information using the getEvents service ... I have developed some systems for football and I decided to modify my app to work with other events, I get the events ids using the getEventTypes service and ... the getEvents service returns a zero length MarketSummary array for all events except 13 and 15 including football (id 1 and 14). Anyone got any thoughts on what's going on ? Can't believe that the only events I have access to or have got any data are the ones I've been using for years, some coincidence !
The soccer markets don't return the same as the racing markets as each match has sub markets, been a while since I've looked, why not try using getAllMarkets with the event type to get your markets ?
The soccer markets don't return the same as the racing markets as each match has sub markets, been a while since I've looked, why not try using getAllMarkets with the event type to get your markets ?
I use 1 for soccer, 7 for horses and 4339 for dogs.
I seem to remember 13 and 15 not returning anything, but I can't remember why as I only spent about 5 mins on it before deciding to use 7 and 4339.
I use 1 for soccer, 7 for horses and 4339 for dogs.I seem to remember 13 and 15 not returning anything, but I can't remember why as I only spent about 5 mins on it before deciding to use 7 and 4339.
I've got a script that bets on the footie, and uses GetEvents. If you look at the API documentation, you'll see that GetEvents returns an array of events, and an array of MarketSummaries.
14 is Football Fixtures, so that will return an event for each day's Fixtures (e.g. Fixtures 15 January happens to be -26544746) but no markets.
Call GetEvents for the individual day's fictures and you'll get events for individual matches (e.g. Ajaccio v Arles happens to be -26544772). Still no markets though.
Only when you call GetEvents for -26544772 will you get the actual markets for Ajaccio v Arles (e.g. 101053109 happens to be the Match Odds markets).
If you start with Football (1) instead of Football Fixtures (14) you'll eventually reach the same markets, but via a different hierarchy of events. That hierarchy seems to have positive numbers for the events,while the Football Fixtures market has negative ones (for some bizarre reason).
Simples (not).
I've got a script that bets on the footie, and uses GetEvents.If you look at the API documentation, you'll see that GetEvents returns an array of events, and an array of MarketSummaries.14 is Football Fixtures, so that will return an event for each d
Thanks all, especially JPL66 and ghetto Joe, problem solved.
My application has an interface layer that implements the Betfair Service calls as methods. This was all implemented years ago when I first started to use the Betfair API, mostly cut and pasted from samples, and I haven't needed to look at it for ages.
As JPL66 says getEvent returns a GetEventsResp object which contains both an array of BFEvent objects(which need to be expanded by a further call to getEvent to get the MarketSummary objects) and an array of MarketsSummary objects.
You guessed it, the method in my interface Layer that wrappers the Betfair getEvent Service returns GetEventsResp.getMarketItems() ignoring the array of BFEvents. This worked great for me for years because I have only been interested in greyhound and horses events (15 and 13) which contain MarketSummary objects and no BFEvents.
With respect to boycee's question about getting football data from coupons ... I've never tried to use the coupons but reading the API 5.2.2 and 6 doc it says that the Coupon Data is for use by services available in a future release of the API, so I guess that the answer is no. Please correct me if this is not right.
Thanks, Eloise06 X
Thanks all, especially JPL66 and ghetto Joe, problem solved.My application has an interface layer that implements the Betfair Service calls as methods. This was all implemented years ago when I first started to use the Betfair API, mostly cut and pas
Yes, my application gets data from a number of sources including the Racing Post. Each morning my application parses the Racing Post and associated html pages building up a data structure which includes the days meetings, races, the horses involved and their history.
The systems that I am using or evaluating use these and other data structues in order to get a candidate list of horses and dogs to wager on.
The java code to read in the racing post main page and write the html to the console is given below. As stated in the comments, instead of writing to the console code needs to be added to parse this html and create the data structure of meet, races, horses and history.
public static void main(String[] args) { String inputLine;
// The racing post URL consists of a stub which will be the same for each day and a suffix // unique for each day. The next 3 lines build this suffix Date date = new Date(); String DATE_FORMAT = "yyyy-MM-dd"; SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
// Build the stub and the suffix the get the URL of todays racing post racingPostCardsURL = racingPostCardsStub + sdf.format(date);
try { // Create a URL and BufferedReader for the racing post URL URL racingPostCards = new URL(racingPostCardsURL); BufferedReader in = new BufferedReader( new InputStreamReader(racingPostCards.openStream())); // Read the lines of the racing post html in line by line and // write the lines to the console // Need to recursively expand the URLs found in the html // This section needs to be replaced with the code that parses the // html in order to construct a data structure containing the meet, // card, horse and history information while ( (in !=null) && ((inputLine = in.readLine()) != null)) { System.out.println(inputLine); } } catch (Exception ex) { System.out.println ("Exception caught: " + ex.toString()); ex.printStackTrace(); } } }
All the best,
Eloise06 X
Hi Starfish and coffee,Yes, my application gets data from a number of sources including the Racing Post. Each morning my application parses the Racing Post and associated html pages building up a data structure which includes the days meetings, races
Fantastic, very much appreciated, i'll work on that and out into use. My previous posts were because i lost a years worth of copy&paste Racing Post Ratings which i'd love to retrieve one way or the other, my email is simonsimon141 at hotm etc if you want to discuss that. All the best anyway
Fantastic, very much appreciated, i'll work on that and out into use. My previous posts were because i lost a years worth of copy&paste Racing Post Ratings which i'd love to retrieve one way or the other, my email is simonsimon141 at hotm etc if you