Horses Name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Burdett
    Junior Member
    • Sep 2012
    • 29

    #1

    Horses Name

    Hi

    New to programming and this API. Got as far as a working sample code. I thought I would trial out this forum as I'm stuck trying to get some data.

    Question: How do I get the name of the horse to screen?

    I can't see it as a subset of runners or selectionID. I've looked at the meta data area. Jockeys name, sex of the horse etc, but can't see the name of the horse, like it appears on the normal betfair website.

    Any help appreciated, thanks.

    David
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    You need to look at the listMarketCatalogue call and make sure you specify the RUNNER_DESCRIPTION option in the MarketProjection.

    The returned MarketCatalogue object will then contain a runners field. This is of type RunnerCatalog which contains the name of the runner (in the runnerName field)

    Comment

    • Burdett
      Junior Member
      • Sep 2012
      • 29

      #3
      Works!

      Now tweaked sample code to(as advised):
      marketProjections.Add(MarketProjection.RUNNER_DESC RIPTION);



      Then I added (after MarketCatalogues creation):
      var description = new RunnerDescription();
      description = marketCatalogues[0].Runners[3];
      string horsesName = description.RunnerName;
      Console.WriteLine(horsesName);

      This seems to give you the horse assigned no. 3.

      Thank you for your help. This is probably a short cut and I should learn how to use the RunnerCatalog instead as my programming improves.

      Comment

      • Burdett
        Junior Member
        • Sep 2012
        • 29

        #4
        Can anyone tell me where to find the definition for the RunnerCataog, returned by the MarketCatalogue object? This may need a separate post, but I'm also hoping to investigate how to get the odds on a particular horse, in a particular race on a runner. Possibly through the RunnerCatalog? Then decide through some say X criteria, whether to place that specific bet or not. Just finding my way around all of the objects from the very thorough code samples provided. Thanks.

        Comment

        • betdynamics
          Junior Member
          • Sep 2010
          • 534

          #5
          Documentation for the API can be found at https://api.developer.betfair.com/se...i/API+Overview

          Specifically, documentation for RunnerCatalog can be found at https://api.developer.betfair.com/se...-RunnerCatalog

          Prices for a horse are obtained through the listMarketBook call rather than the listMarketCatalogue call.

          Think of it as:

          listMarketCatalogue - largely static items for the market
          listMarketBook - dynamic items for the market

          If you are looking for a book that covers this sort of information, then I can point you at "Programming for Betfair" by James Butler. I believe that he uses Visual Basic and walks you through building a basic bot using the various API calls. I have not seen the book personally.
          Last edited by betdynamics; 07-01-2016, 01:09 PM.

          Comment

          • Burdett
            Junior Member
            • Sep 2012
            • 29

            #6
            Done

            Thanks very much. I managed today to single out a horse race, then obtain the marketID, the selectionID, runner name and its current traded price. I wanted prices, because the sample skips quickly to the placement of a bet, but I want to look and compare prices before making the wager.

            I'll look at the links you've given to help my understanding. I had seen the book, but I'm a novice programmer perhaps and adding VB code in as well, may serve to only cause additional possible confusion.

            I'd like to take all the selections in a race next, then be able to apply logical code for say, picking the 3rd favourite horse, not the first. That's my next challenge to myself

            My sincere gratitude for your kind help, I've generally found the sample code to be quite comprehensive and well set out. Then the help on the forum, well it speaks for itself.

            David.

            Comment

            Working...
            X