BF_Bet_History: Access your bets

Description Usage Arguments Details Value Author(s) References See Also

Description

With getBetHistory, getMUBets and getMUBetsLite you access information about all your bets. With getBet, getBetLite and getBetMatchesLite you can access detailed information about your specific bets.

getBetLite: This is the lite version of the GetBet service.

getBetMatchesLite: This is a lite version of the GetBet service that returns information on matched bets.

getMUBets: Retrieve information about all your matched and unmatched bets on a particular exchange server. You should be aware that voided bets are not returned by getMUBets. Your application should track the number of matched and unmatched bets against the number of bets returned by getMUBets in order to detect a voided bet.

getMUBetsLite: This is a lite version of the getMUBets service.

* Profit and loss for single and multi-winner odds markets is implemented however it won't calculate worstCaseIfWin nor futureIfWin.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
getBet(betId, server = getOption("bfServer"),
  output = getOption("bfOutput"), curlOpts = list())

getBetLite(betId, server = getOption("bfServer"),
  output = getOption("bfOutput"), curlOpts = list())

getBetMatchesLite(betId, server = getOption("bfServer"),
  output = getOption("bfOutput"), curlOpts = list())

getMUBets(marketId, betIds, betStatus = "MU", matchedSince,
  orderBy = "BET_ID", sortOrder = "ASC", recordCount = 200,
  startRecord = 0, excludeLastSecond = FALSE,
  server = getOption("bfServer"), output = getOption("bfOutput"),
  curlOpts = list())

getMUBetsLite(marketId, betIds, betStatus = "MU", matchedSince,
  orderBy = "BET_ID", sortOrder = "ASC", recordCount = 200,
  startRecord = 0, excludeLastSecond = FALSE,
  server = getOption("bfServer"), output = getOption("bfOutput"),
  curlOpts = list())

getBetHistory(marketId = 0, eventTypeIds = NULL, detailed = FALSE,
  sortBetsBy = "NONE", betTypesIncluded = "S", marketTypesIncluded = "O",
  placedDateFrom = Sys.Date(), placedDateTo = Sys.time(),
  recordCount = 100, startRecord = 0, locale, timezone,
  server = getOption("bfServer"), output = getOption("bfOutput"),
  curlOpts = list())

getMarketProfitAndLoss(marketID, includeSettledBets = FALSE,
  includeBspBets = TRUE, netOfCommission = FALSE, locale,
  server = getOption("bfServer"), output = getOption("bfOutput"),
  curlOpts = list())

Arguments

betId

The unique bet identifier

server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

betId

The unique bet identifier

server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

betId

The unique bet identifier

server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

marketId

For getMUBets and getMUBetsLite: If marketId is present and non-zero, then bets placed on the specified market are returned and any bet ids specified in betIds are ignored.
For getBetHistory Returns the records of your matched or unmatched bets for the specified market. If you use this parameter you must not specify eventTypeId array. Note that, if you specify a marketId, you must also specify either M or U as the value for the betTypesIncluded parameter.

betIds

Specifies the betId of each bet you want returned. The maximum number of bets you can include in the array is 200. If you include marketId in the request and marketId contains a non-zero value, then betIds is ignored. If you specify a betId, then you must specify MU for betStatus.

betStatus

M, U or MU. The status of the bets to return (matched, unmatched, or both) - please see betfairly Simple Data Types . If you specify a betId, then you must specify MU.

matchedSince

Specifies a date and time to start from for the list of returned bets. Any R date-time object or string recognized by as.POSIXlt. Use asBFDateTime to see how your time input is interpreted. If you use the matchedSince parameter and you have specified a betStatus of MU, the bets returned will ignore any limit you set (using recordCount) for the number of records to be returned. Specifying a betStatus of MU causes the API to return your unmatched bets along with the matched ones.

orderBy

The order of returned results. Valid orders are BET_ID, PLACED_DATE, and MATCHED_DATE.

sortOrder

ASC or DESC. Whether the results are in ascending or descending order

recordCount

Maximum number of records to return. The maximum number allowed is 200.

startRecord

The first record number to return (supports paging). Record numbering starts from 0. For example, to retrieve the third record and higher, set startRecord to 2.

excludeLastSecond

If true, the API excludes bets placed or matched that occurred less than one second before the GetMUBets call. Set this to true if you want to ensure that the response does not include bets that may have changed state between the time you sent the request and before the response was generated. If false, all bets are returned. Therefore, you may receive a response that indicates an unmatched bet that has actually been matched during the time taken for the API to respond.

server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

marketId

Integer specifying the market ID.

betIds

A vector specifying the betId of each bet you want returned. The maximum number of bets you can include in the array is 200. If you include marketId in the request and marketId contains a non-zero value, then betIds is ignored. If you specify a betId, then you must specify MU for betStatus.

betStatus
matchedSince
orderBy
sortOrder
recordCount
startRecord
excludeLastSecond
server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

marketId

Integer specifying the market ID.

eventTypeIds

An array of event types to return. For matched and unmatched bets only, you can leave it unspecified and specify zero (the default) as the marketId to receive records of all your bets on the exchange.

detailed

[logical] Whether to show details of all the matches on a single bet

sortBetsBy

[ASC, DESC] How the bets are ordered.

betTypesIncluded

[C Cancelled, L Lapsed, M Matched, MU Matched and Unmatched, S Settled (default), U Unmatched, V Voided] Indicates the status of the bets to include in the response. If your betHistory request is for a specific market (in other words, if you have specified a marketId in your request), then you must specify either M or U as the value for betTypesIncluded. Otherwise you will receive an INVALID_BET_STATUS error. Only settled markets return cancelled, void, or lapsed bets.

marketTypesIncluded

[A Asian Handicap, L Line, O Odds (default), R Range] Indicates the types of market that you want your betting history returned for.

placedDateFrom

Any R date/date-time object is accepted or any character string recognized by as.POSIXlt. Default to current day at 00:00.

placedDateTo

Any R date/date-time object. Default to Sys.time().

recordCount

The maximum number of records to return. This number must be between 1 and 100, inclusive.

startRecord

The first record number to return (supports paging). Record numbering starts from 0. For example, to retrieve the third record and higher, set startRecord to 2.

locale

Specify the language for the reply if you want a different language than the account default.

timezone

Specify an alternative time-zone from the user account default.

server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

marketID

The market ID for which the profit and loss for the user is to be returned

includeSettledBets

logical If TRUE then the P&L calculation for each runner includes any profit and loss from any bets on runners that have already been settled. The default is FALSE, which matches the default on Betfair.com.

includeBspBets

If TRUE, BSP bets are returned as part of the P&L

netOfCommission

If TRUE return P&L net of users current commission rate for this market including any special tariffs, default is FALSE.

locale

Specify the language for the reply if you want a different language than the account default.

server

"GB" (default) or "AU" - a Betfair exchange server to use. You can set the default with options(bfServer = "AU").

output

Indicates the form of the returned value. Can be "simple" (default), "xml", "list" or "S4". See betfairly-package.

curlOpts

RCurl options passed directly to curlPerform. You can also set the defaults with options(bfCurlOpts = list(opt1 = val1, opt2 = val2, ...)).

Details

getBet: Retrieve information about a particular bet. Each request will retrieve all components of the desired bet.

You can retrieve Cancelled, Lapsed, and Voided bets from only settled markets and these bets are available for a maximum of 10 days from the date the market was settled.

* The calculation for AH markets will include worstCaseIfWin but not futureIfWin.

Value

A list of class GetBetRespSimple containing slot matches with info about matched portions of the bet.

A list of class GetBetLiteRespSimple with no additional slots. Contains a subset of information from data part of getBet response.

Data frame of class GetBetMatchesLiteRespSimple containing subset of information from @matches slot in getBet response.

Object of class xxx containing slot

Object of class GetBetHistoryRespSimple containing slots betHistoryItems - a data frame with one bet per row and matches - a data frame with all the matches if the details parameter was set to TRUE.

Object of class GetMarketProfitAndLossRespSimple containing slot annotations which is a data frame with P&L data.

Author(s)

Vitalie Spinu (spinuvit@gmail.com)

References

http://code.google.com/p/betfairly/, https://docs.developer.betfair.com/betfair/

See Also

betfairly-package bfSimpleOutput-class

betfairly-package bfSimpleOutput-class

betfairly-package bfSimpleOutput-class


vspinu/betfairly documentation built on May 3, 2019, 7:08 p.m.