Forums

General Betting

There is currently 1 person viewing this thread.
Eloise6
14 Jan 10 23:49
Joined:
Date Joined: 11 Jul 06
| Topic/replies: 3 | Blogger: Eloise6's blog
Hi,

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 !

Thanks in advance,
Eloise06 X

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 11
By:
Moon Light
When: 15 Jan 10 00:04
I can see the Soccer markets using the free API. The limitation is you can't see coupons, IIRC.
By:
Ghetto Joe
When: 15 Jan 10 09:35
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 ?
By:
Moon Light
When: 15 Jan 10 12:22
If I had these symptoms I would suspect that I'd done a hard-coded patch for the markets, and then forgotten about it.
By:
C r a n
When: 15 Jan 10 12:36
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.
By:
The Geeks Toy
When: 15 Jan 10 12:48
Just in case you don't get the answer you need here, it may be worth checking on the betfair developers forum.

http://forum.bdp.betfair.com/
By:
JPL66
When: 15 Jan 10 14:56
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).
By:
boycee
When: 15 Jan 10 15:13
Say I wanted to pull in the footie data for a particular day's coupon. Is that possible or not?
By:
Eloise6
When: 15 Jan 10 17:44
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
By:
starfish and coffee
When: 16 Jan 10 10:44
Eloise, i've asked in other threads, do you get data from Racing Post as well, or any other sources?
By:
Eloise6
When: 16 Jan 10 20:19
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, 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.


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ReadRacingPost {

private static String racingPostCardsStub = "http://www.racingpost.com/horses2/cards/home.sd?r_date=";
private static String racingPostCardsURL = null;

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
By:
starfish and coffee
When: 16 Jan 10 20:37
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
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com