Announcement

Collapse
No announcement yet.

API - Football Team SelectionIDs

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

  • API - Football Team SelectionIDs

    Is there a way to retrieve all the unique SelectionIDs assigned by Betfair to each and every football team - specifically the English leagues down to and including the Conference divisions, the four Scottish leagues as well as the top two leagues in each Euro country?

    I access a variety of football related sites to glean information from them. Some I scrape, others I have pull things in manually. All these different sites are inconsistent in the way the name teams. For example, one might refer to 'Manchester United' whereas another might call them 'Man United' and yet another call them 'Man Utd'.

    I was thinking of creating a database table that mapped all these variations to the correct Betfair SelectionID but I cannot see anyway of retrieving such info from the exchange as a simple database query via the API.

    Any ideas?
    Ali
    BetamicroSolutions - my IT business
    Twitter Me - Finally! I'm on Twitter.

  • #2
    Are you using the old or new API?

    Old API:

    1. Get all soccer match odds market ids with getAllMarkets
    2. For each market get selections with getMarket

    New API:

    listMarketCatalogue with RUNNER_DESCRIPTION in marketProjection. Note that
    RUNNER_DESCRIPTION carries a weight of 2 so you can only get 200/2=100 markets in one API call.

    Comment


    • #3
      Here are the IDs grouped by competition in JSON format from the new API:

      Code:
      ...
      
        { id: '31',
           name: 'Barclays Premier League',
           selections: 
            { '1096': 'Arsenal',
              '1703': 'West Brom',
              '25422': 'Newcastle',
              '47998': 'Norwich',
              '47999': 'Man City',
              '48224': 'Tottenham',
              '48351': 'Man Utd',
              '48756': 'West Ham',
              '52689': 'C Palace',
              '55190': 'Chelsea',
              '56323': 'Liverpool',
              '56343': 'Everton',
              '56344': 'Sunderland',
              '56764': 'Fulham',
              '58943': 'Southampton',
              '62683': 'Swansea',
              '63908': 'Aston Villa',
              '69720': 'Stoke',
              '70385': 'Hull',
              '79343': 'Cardiff' } },
      
      ...
      It was just 30 lines of code using my open source Betfair API-NG library.

      Comment


      • #4
        Thanks for that pdonald.

        I haven't had a chance to look into the new API yet - too busy renovating my house. From what I've seen, it certainly seems to be a tad simpler than the old one.

        Looks like a project for the long dark winter months.
        Ali
        BetamicroSolutions - my IT business
        Twitter Me - Finally! I'm on Twitter.

        Comment

        Working...
        X