Skip to main content

GetBetsService

A list of all methods in the GetBetsService service. Click on the method name to view detailed information about that method.

MethodsDescription
Bets_GetBetsByTypeV4Returns bets. ### Get running bets by time range: https://api.pinnacle.com/v4/bets?betlist=RUNNING&fromDate=2017-11-21T00:00:00Z&toDate=2017-11-29T00:00:00Z Running bets are queried by placedAt date time ### Get settled bets by time range: https://api.pinnacle.com/v4/bets?betlist=SETTLED&fromDate=2015-12-28T00:00:00Z&toDate=2015-12-29T00:00:00Z Settled bets are queried by settledAt date time https://api.pinnacle.com/v4/bets?betlist=SETTLED&fromDate=2017-11-20T00:00:00Z&toDate=2017-11-23T00:00:00Z ### Get settled cancelled bets by time range: https://api.pinnacle.com/v4/bets?betList=SETTLED&fromDate=2018-03-01&toDate=2018-03-28&betStatuses=CANCELLED ### Get bets by bet ids: https://api.pinnacle.com/v4/bets?betIds=775856112,775856113,775856114 ### Get bets by uniqueRequestIds: https://api.pinnacle.com/v4/bets?uniqueRequestIds=62335222-dae4-479a-8c05-46440ccdd3bb,42335222-dae4-479a-8c05-46440ccdd3bb

Bets_GetBetsByTypeV4

Returns bets. ### Get running bets by time range: https://api.pinnacle.com/v4/bets?betlist=RUNNING&fromDate=2017-11-21T00:00:00Z&toDate=2017-11-29T00:00:00Z Running bets are queried by placedAt date time ### Get settled bets by time range: https://api.pinnacle.com/v4/bets?betlist=SETTLED&fromDate=2015-12-28T00:00:00Z&toDate=2015-12-29T00:00:00Z Settled bets are queried by settledAt date time https://api.pinnacle.com/v4/bets?betlist=SETTLED&fromDate=2017-11-20T00:00:00Z&toDate=2017-11-23T00:00:00Z ### Get settled cancelled bets by time range: https://api.pinnacle.com/v4/bets?betList=SETTLED&fromDate=2018-03-01&toDate=2018-03-28&betStatuses=CANCELLED ### Get bets by bet ids: https://api.pinnacle.com/v4/bets?betIds=775856112,775856113,775856114 ### Get bets by uniqueRequestIds: https://api.pinnacle.com/v4/bets?uniqueRequestIds=62335222-dae4-479a-8c05-46440ccdd3bb,42335222-dae4-479a-8c05-46440ccdd3bb

  • HTTP Method: GET
  • Endpoint: /v4/bets

Parameters

NameTypeRequiredDescription
betlistBetlistType of bet list to return. Not needed when betids is submitted.
betStatusesBetStatuses[]Type of bet statues to return. This works only in conjustion with betlist, as additional filter.
fromDatestringStart date of the requested period. Required when betlist parameter is submitted. Start date can be up to 30 days in the past. Expected format is ISO8601 - can be set to just date or date and time.
toDatestringEnd date of the requested period. Required when betlist parameter is submitted. Expected format is ISO8601 - can be set to just date or date and time. toDate value is exclusive, meaning it cannot be equal to fromDate.
sortDirSortDirSort direction by postedAt/settledAt. Respected only when querying by date range.
pageSizenumberPage size in case. Max is 1000. Respected only when querying by date range.
fromRecordnumberStarting record (inclusive) of the result. Respected only when querying by date range. To fetch next page set it to toRecord+1
betidsnumber[]A comma separated list of bet ids. When betids is submitted, no other parameter is necessary. Maximum is 100 ids. Works for all non settled bets and all bets settled in the last 30 days.
uniqueRequestIdsstring[]A comma separated list of uniqueRequestId from the place bet request. If specified, it's highest priority, all other parameters are ignored. Maximum is 10 ids. If client has bet id, preferred way is to use betIds query parameter, you can use uniqueRequestIds when you do not have bet id. That are 2 cases when client may not have a bet id: 1. When you bet on live event with live delay, place bet response in that case does not return bet id, so client can query bet status by uniqueRequestIds. 2. In case of any network issues when client is not sure what happened with his place bet request. Empty response means that the bet was not placed. Please check Deduplication section for more details. Note that there is a restriction: querying by uniqueRequestIds is supported for straight and special bets and only up to 30 min from the moment the bet was place.
betTypeBetsGetBetsByTypeV4BetType[]A comma separated list of bet types.

Return Type

GetBetsByTypeResponseV4

Example Usage Code Snippet

import { PinnacleBets } from 'pinnacle_bets';

(async () => {
const pinnacleBets = new PinnacleBets({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
});

const betlist = Betlist.SETTLED;
const sortDir = SortDir.ASC;

const { data } = await pinnacleBets.getBets.betsGetBetsByTypeV4({
betlist: betlist,
betStatuses: [betStatuses],
fromDate: 'fromDate',
toDate: 'toDate',
sortDir: sortDir,
pageSize: 1000,
fromRecord: 9,
betids: [2],
uniqueRequestIds: ['uniqueRequestIds'],
betType: [betsGetBetsByTypeV4BetType],
});

console.log(data);
})();

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →