List the Markets Available on Matchbook.com for a given Event
mb_get_markets(session_data, event_id, market_states = c("open", "suspended"),
market_types = c("multirunner", "binary"), grading_types = NULL,
include_runners = FALSE, include_prices = FALSE)A session object returned from a successful mb_login attempt. It contains details about your user preferences and security details.
The event_id integer for which a list of associated markets is required.
A vector of string containing the market states to return. Defaults to 'open' or 'suspended' market types.
A vector of strings containing the required market types. Valid market types are either 'multirunner' or 'binary'. Both are returned by default.
An optional vector of strings containing the required grading types. Valid grading types are 'one_x_two','asian-handicap','high-score-wins','low-score-wins','point-spread','point-total','single-winner-wins'. All are returned by default.
A boolean parameter indicating if the runner names and id should be returned or not. Defaults to FALSE.
A boolean parameter indicating if the runner prices should be returned or not. Defaults to FALSE.
If successful, a dataframe with first 500 markets and associated information. Only 500 markets are permitted at one time. Pagination is possible but not implemented here. The data frame has the following fields:
Market name
The start date of the market
If betting is still available on this market it will have status='open'
Market name
Event id
Market id
The ids of runners in this market
The type of grading
Is the market currently in-running
Is it possible for this market to go in running
The handicap associated with this market, if any
If include_runners=TRUE, then additional runner information is returned. Also if include_prices=TRUE then price data for the associated runner is returned nested within the data frame.
# NOT RUN {
my_session <- mb_login("my_user_name","my_password");
mb_get_markets(event_id=309912)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab