sportsdataverse / oddsapiR

Access sports odds from the Odds API
https://oddsapir.sportsdataverse.org
Other
4 stars 1 forks source link

Selecting multiple sports, regions and markets #1

Closed aaronmorrisNC closed 1 year ago

aaronmorrisNC commented 1 year ago

Hi. How do I select multiple sports, regions and markets? According to the documentation, "Multiple can be specified if comma delimited". Here is the code that I am running:

ncaab_us <- toa_sports_odds(sport_key = 'basketball_ncaab', regions = 'us', markets = 'h2h, totals', odds_format = 'american', date_format = 'iso') %>% select(c("id", "sport_key", "sport_title", "bookmaker_key", "bookmaker", "market_key", "outcomes_name", "outcomes_price", "home_team","away_team","commence_time"))

This is the error that is returned.

Request failed [422]. Retrying in 1.8 seconds... Request failed [422]. Retrying in 1 seconds... 2023-02-03 18:39:22: Invalid arguments provided Error in toa_sports_odds(sport_key = "basketball_ncaab", regions = "us", : object 'resp' not found

aaronmorrisNC commented 1 year ago

The issue is resolved. Apparently you can't have spaces when selecting multiple markets.

markets = 'h2h, totals',

instead it should be

markets = 'h2h,totals',