get greyhound name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Acruche
    Junior Member
    • Aug 2021
    • 2

    #1

    get greyhound name

    Hello,

    I'm using betfairlightweight

    First of all, I would like to congratulate LiamP on his excellent work.

    I'm using stream to monitor the greyhound market.

    However, I am not able to get the names of the greyhounds.

    market_book.market_definition.runners[x].name return None

    How would it be correct?
    I didn't find any examples in the documentation.

    Thanks
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    Therunner names are in marketCatalog, not marketBook. They are under RunnerCatalog.

    The difference between marketCatalog and marketBook is that marketCatalog(ue) contains data that does not change (runner id, runner name, race venue, etc) whereas marketBook contains data that does change (odds, lastPriceTraded, amounts matched, etc, etc). This makes sense, because you get the marketCatalogue once and the marketBook lots of times.

    Comment

    • Acruche
      Junior Member
      • Aug 2021
      • 2

      #3
      hi Jabe,

      thanks for answering. Now it makes sense to me.

      I would like to get all races for the day, regardless of whether they have already taken place. However, marketCatalog is only returning the next runs.

      Code:
      racing_filter = filters.market_filter(
              event_type_ids=[4339],  # filter on just greyhound racing
              market_countries=["GB", "IE"],  # filter on just GB countries
              market_type_codes=["WIN"],  # filter on just WIN market types
              market_start_time={
                          "from": "2021-08-30T00:00:00Z",
                          "to": "2021-08-30T23:59:00Z"
              },
          )
      I'm forgetting something?

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        I'm uncertain about what the next code is going to do with the parameters you're passing. It's been a while since I coded the bulk of my program (which doesn't look at any sort of racing) and I can't remember exactly how the hierarchy of events works. As far as I can recall, a race meeting is an event and the individual races are events too.

        My program uses listEvents, restricted by date, to get a list of events (football matches) for a day, and then cycles through these events doing listMarketCatalogue calls to get relevant details.

        The parameters you have listed appear to be for both listEvents and listMarketCatalogue at the same time. I'm guessing here, but I suspect whatever the code does next - am I right in assuming that LiamP has created some Python code for anyone to use? If so, I haven't seen it (and I've not learnt to use Python yet) - I suspect the next bit of code might be what is restricting the races returned.

        I notice you've written the event_type_ids parameter for greyhounds as 4339, which is fine. The reason I'm mentioning this is that the format of - from memory - marketIds is two numbers separated by a dot or decimal point. If you even need to hard code one of these in a call, treat it as a string (in fact, any numbers can be treated as strings in JSON). The reason for this is that if you want to pass a marketId that ends in a zero and you pass it as numeric, any zeros at the end will disappear. So something like 2.10 will become 2.1, and you'll either find there isn't one that fits, or you get a wrong one. So "2.10" will save you from that problem.

        If the bit of code that accepts the parameters you've specified isn't obviously ignoring the day's completed races, see if you can post the code and I'll take a look (unless LiamP arrived to save the need).

        Comment

        • LiamP
          Junior Member
          • Oct 2015
          • 284

          #5
          Come join the slack group and someone will have the answer

          https://betfairlightweight.herokuapp.com/

          Surprised you haven’t joined yet jabe!

          Comment

          • jabe
            Senior Member
            • Dec 2014
            • 705

            #6
            Originally posted by LiamP View Post
            Come join the slack group and someone will have the answer

            https://betfairlightweight.herokuapp.com/

            Surprised you haven’t joined yet jabe!
            Had a lot on, Liam! Got the main task all but done though, so I may follow your lead in the not-too-distant.

            Comment

            • lopezmason
              Junior Member
              • Jul 2022
              • 1

              #7
              I just read an article looking for horse racing filters on the other page, I think they are similar? Can you change the dog racing filter to horse racing? we become what we behold

              Comment

              • Andreaa23
                Junior Member
                • Nov 2022
                • 1

                #8
                Originally posted by LiamP View Post
                Come join the slack group and someone will have the answer

                https://betfairlightweight.herokuapp.com/ slope game

                Surprised you haven’t joined yet jabe!
                As long as they don't exceed 16 characters and adhere to NGA guidelines, the owner of a greyhound can give their dog pretty much any name they like.

                Comment

                Working...
                X