Announcement

Collapse
No announcement yet.

get greyhound name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #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


      • #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


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

          https://betfairlightweight.herokuapp.com/

          Surprised you haven’t joined yet jabe!

          Comment


          • #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

            Working...
            X