abettor icon indicating copy to clipboard operation
abettor copied to clipboard

Help pulling market prices

Open samgledhill opened this issue 2 years ago • 1 comments

Hi team - apologies in advance for logging an issue if this is not the right place to put it - but I wasn't sure how else to ask for help.

I'm attempting to build a betting bot and I'm keen to try and find market value amongst bookies, using the betfair lay markets as a guide close to jump time.

Abettor is magical in granting rapid, reliable access to the Betfair API - thanks so much for building it! My troubles start in the data-wrangling after executing a "listMarketBook" call. Essentially, I'm really struggling using any of the base or tidyverse methods to be able to pull the "availableToLay" list up to a level that also includes the marketId and SelectionId variables. ie - what I'd like to end up with is a long list of selectionId's (runner name would be even better, but let's start with what we've got first!) and prices - but I have to traverse through the "ex" list and that seems to be breaking every single time.

I've tried unnest(), unnest_longer() and unnest_wider(), hoist(), pluck() and flatten() but nothing seems to run without error!

Any tips or pointers that might help push me in the right direction?

I've tried all sorts of documentation for the tidyverse and this doesn't seem to be something that anyone on StackOverrflow has face either!

Again - apologies if this isn't the right forum - but I'm running out of ideas to get help!

Cheers,

Sam

samgledhill avatar Nov 20 '21 23:11 samgledhill