Please enter the email address used during signup or contact csd@pinnaclesports.com.
Please enter the country used during signup or contact csd@pinnaclesports.com.
EnglishKorean简体中文繁體中文

Back to Top

Pinnacle Sports API Specification v1.0

(updated: 07/03/2014)


Version Control

Version Date Change
1.0.0 2013/08/23 Initial release
1.0.1 2013/11/04 1. Added betterLineWasAccepted parameter to Place Bet response

2. Added following parameter to Get Bets response
· pitcher1
· pitcher2
· pitcher1MustStart
· pitcher2MustStart

3. Added LISTED_PITCHERS_SELECTION_ERROR to PLACEBET_ERROR_CODE enum
1.0.2 2013/11/14 Added the following properties to the Get Bets response:
· team1
· team2
1.0.3 2013/12/09 Corrected wording: · In Place Bet Response, updated Description column for errCode parameter
· Getting Started, Step 2 - Get Lines, Note
1.0.4 2014/01/27 Added period number description to Place Bet request, Get Feed response and Get Line request
Added Get Feed operation example in PHP

1.0.5 2014/02/10 Added to Overview “Please note that in order to access Pinnacle Sports API the account must be funded”

Overview

Pinnacle Sports API is a RESTful service for lines offering and betting on spread, total points, money line and team total for all sports. Current version does not support betting on accumulators, teasers and propositions (contests).

Please note that in order to access Pinnacle Sports API the account must be funded.

Data Formats

There are 2 groups of operations:

Group 1 - These operations support only XML format of the response:

  • Get Sports
  • Get Leagues
  • Get Feed
  • Get Currencies

Group 2 - These operations support XML and JSON format:

  • Get Client Balance
  • Place Bet
  • Get Line
  • Get Bets

For these methods you can use HTTP content negotiation for the response format. HTTP Request must have:

Accept: application/json
Or
Accept: application/xml

For POST requests you can use JSON and XML formats. HTTP Request must have:

Content-Type: application/json
Or
Content-Type: application/xml

Compression

API supports HTTP compression. We recommend using compression as it would give the best performances.

Date time

All dates and times are in UTC time zone, ISO 8601 format


Authentication

API use HTTP Basic access authentication . Always use HTTPS to access the API. You need to send HTTP Request header like this:

Authorization: Basic <Base64 value of UTF-8 encoded “username:password”>

For example:
Authorization: Basic U03MyOT23YbzMDc6d3c3O1DQ1


Operations

Get Sports

Returns all sports with the status whether they currently have lines or not.

Request

GET v1/sports

No request parameters

URL Example:
https://api.pinnaclesports.com/v1/sports

Response

Response is only in XML.

Rsp Type

Parameter Type Optional Description
@status FEED_STATUS_RESPONSE No Status of the response
sports Sport type Yes Sports container. It will be present if @status = “ok”
err GenericException2 type Yes Error details. It will be present if @status = “fail”

Sport type

Parameter Type Optional Description
@id Int No Sport Id
@feedContents BOOLEAN2 No Whether the sport currently has lines
sport String No Sport name

Example of successful response

<rsp status="ok">
<sports>
<sport id="1" feedContents="0">Badminton</sport>
<sport id="3" feedContents="1">Baseball</sport>
<sport id="4" feedContents="1">Basketball</sport>
<sport id="6" feedContents="0">Boxing</sport>
<sport id="8" feedContents="0">Cricket</sport>
<sport id="9" feedContents="0">Curling</sport>
<sport id="10" feedContents="0">Darts</sport>
<sport id="11" feedContents="0">Darts (Legs)</sport>
<sport id="12" feedContents="0">E Sports</sport>
<sport id="14" feedContents="0">Floorball</sport>
<sport id="15" feedContents="1">Football</sport>
<sport id="16" feedContents="0">Futsal</sport>
<sport id="17" feedContents="0">Golf</sport>
<sport id="18" feedContents="0">Handball</sport>
<sport id="19" feedContents="0">Hockey</sport>
<sport id="20" feedContents="0">Horse Racing</sport>
<sport id="22" feedContents="0">Mixed Martial Arts</sport>
<sport id="23" feedContents="0">Other Sports</sport>
<sport id="24" feedContents="0">Politics</sport>
<sport id="26" feedContents="0">Rugby League</sport>
<sport id="27" feedContents="0">Rugby Union</sport>
<sport id="28" feedContents="0">Snooker</sport>
<sport id="29" feedContents="1">Soccer</sport>
<sport id="30" feedContents="0">Softball</sport>
<sport id="31" feedContents="0">Squash</sport>
<sport id="32" feedContents="0">Table Tennis</sport>
<sport id="33" feedContents="0">Tennis</sport>
<sport id="34" feedContents="0">Volleyball</sport>
<sport id="35" feedContents="0">Volleyball (Points)</sport>
<sport id="36" feedContents="0">Water Polo</sport>
<sport id="39" feedContents="1">Aussie Rules</sport>
</sports>
</rsp>

Example of response with an error

<rsp status="fail">
<err code="99">Internal server error</err>
</rsp>

Get Leagues

Returns all sports leagues with the status whether they currently have lines or not.

Request

GET v1/leagues?sportid={sportid}

Parameter Type Optional Description
sportId Int No Sport id for which the leagues are requested

Example

To get all leagues for baseball:
https://api.pinnaclesports.com/v1/leagues?sportid=3

Response

Response is only in XML.

Rsp type

Parameter Type Optional Description
@status FEED_STATUS_RESPONSE No Status of the response
sportId Int Yes Echo of the requested sport id. It will be present if @status = “ok”
leagues Array of League Yes Leagues container. It will be present if @status = “ok”
err GenericException2 type Yes Error details. It will be present if @status = “fail”

League

Parameter Type Optional Description
id Int No League id
feedContents BOOLEAN2 No Whether the sport currently has lines
league String No Name of the league

Example of successful response

<rsp status="ok">
<sportId>3</sportId>
<leagues>
<league id="214" feedContents="1">MLB Alternate Runlines</league>
<league id="216" feedContents="0">All Star Friendlies</league>
<league id="217" feedContents="0">Asia Series</league>
<league id="218" feedContents="0">Asian Games - World</league>
<league id="220" feedContents="1">NCAA Baseball</league>
<league id="225" feedContents="0">European Championships</league>
<league id="231" feedContents="1">Italy - Serie A1</league>
<league id="232" feedContents="1">Japan - All Star</league>
<league id="233" feedContents="0">Japan - Central League</league>
<league id="234" feedContents="0">Japan - Inter League</league>
<league id="235" feedContents="1">Japan Baseball LIVE</league>
<league id="236" feedContents="0">Japan - Pacific League</league>
<league id="237" feedContents="0">Nippon Series (Championship)</league>
<league id="238" feedContents="0">Konami Cup Asia Series</league>
<league id="6227" feedContents="0">Korea Professional Baseball</league>
<league id="241" feedContents="0">Little League World Series</league>
<league id="244" feedContents="0">Mexican League</league>
<league id="246" feedContents="0">MLB</league>
<league id="247" feedContents="0">MLB Live</league>
<league id="5425" feedContents="0">MLB - Pre Season</league>
<league id="251" feedContents="0">Baseball Games</league>
<league id="252" feedContents="0">Olympic Qualifier</league>
<league id="255" feedContents="0">Pan American Games</league>
<league id="256" feedContents="0">Campeonato Nacional de Beisbol Mayor</league>
<league id="257" feedContents="0">Serie Del Caribe</league>
<league id="262" feedContents="0">Venezuela - Liga Profesional</league>
<league id="264" feedContents="0">WNCAA Softball</league>
<league id="265" feedContents="0">World Cup Baseball</league>
<league id="266" feedContents="0">World Baseball Classic</league>
</leagues>
</rsp>

Example of response with an error

<rsp status="fail">
<err code="1">Invalid sport ID</err>
</rsp>

Get Feed

Returns current lines.

Request

GET /v1/feed?sportid={sportid}&leagueid={leagueid}&last={last}&oddsformat={oddsformat}&islive={islive}&currencycode={currencycode}

Parameter Type Optional Description
sportId Int Yes The sportid for which the feed is desired. Mandatory only if islive parameter is not set and is not equal to "1".
leagueId String Yes The league id that belongs to the same sport Id. If sportid/leagueid is an invalid pair, no results will be returned. You can also pass multiple leagues separated by a dash "-". Please see the examples below.
oddsFormat FEED_ODDS_FORMAT_TYPE Yes Default is American. If otherwise specified, returns odds in different format.
last Long Yes This is used to receive incremental updates. Use the value of feedTime from previous feed response.
When last parameter is not provided, the response does not return the freshest lines. Please always use last parameter to get the freshest line changes.
islive BOOLEAN2 Yes To retrieve ONLY live games set the value to islive=1. If sportid is provided along with the request, the result will be related to a single sport.
islive=0 cannot be used without the sportid parameter. This ensures that the speed of the feed is not compromised.
currencyCode String Yes To convert amounts (such as maximum bet amount) to another currency. If omitted, the default is United States Dollar (USD). The currency code should be one from the Get Currencies operation response.

URL Examples

All soccer lines:
https://api.pinnaclesports.com/v1/feed?sportid=29

Soccer line changes since last refresh:
https://api.pinnaclesports.com/v1/feed?sportid=29&last=1373383152874

All live Soccer lines:
https://api.pinnaclesports.com/v1/feed?sportid=29&islive=1

Live Soccer line changes since last refresh:
https://api.pinnaclesports.com/v1/feed?sportid=29&islive=1&last=1373383152874

Selected soccer leagues:
https://api.pinnaclesports.com/v1/feed?sportid=29&leagueid=1728-1792-1817

Selected soccer leagues line changes since last refresh:
https://api.pinnaclesports.com/v1/feed?sportid=29&leagueid=1728-1792-1817&last=1373383152874

Response

Response is only in XML

Rsp Type

Parameter Type Optional Description
@status FEED_STATUS_RESPONSE No Status of the response
fd Feed type Yes Container of the successful response. It will be present if @status = “ok”
err GenericException2 type Yes Error details. It will be present if @status = “fail”

Feed Type

Parameter Type Optional Description
@fdTime Long No Feed timestamp. Use this value for the subsequent feed requests for last query parameter to get just the line changes since previous response.
sports Array of FeedSport type No Container for sports. Can be empty array if we currently don’t have any offerings for the requested sport.

FeedSport Type

Parameter Type Optional Description
id Int No Sport id
leagues Array of FeedLeague type No Container for leagues

FeedLeague Type

Parameter Type Optional Description
id Int No League id
events Array of FeedEvent type No Container for events

FeedEvent Type

Parameter Type Optional Description
id Int No Event id
startDateTime Date Time No Date time when the event starts
IsLive YES_NO_TYPE No Whether or not the event is dealt for live betting
status EVENT_STATUS No Status of the event.
drawRotNum Int Yes Rotation number for draw. Present only for sports/leagues where draw is possible.
awayTeam FeedTeam type No Container for away team
homeTeam FeedTeam type No Container for home team
periods Array of FeedPeriod type No Container for periods

FeedTeam Type

Parameter Type Optional Description
@type TEAM_TYPE No Team type
Name String No Team name
rotNum Int No Rotation number
pitcher String Yes Pitcher name. Only for baseball.
score Int Yes Current score. Only for live soccer events.
redCards Int Yes Current red cards. Only for live soccer events.

FeedPeriod Type

Parameter Type Optional Description

@lineId
Int No Line id
number Int No This represents the period of the match. For example, for soccer we have:
0 - Game
1 - 1st Half
2 - 2nd Half
description String Period type description
cutoffDateTime Date Time No Period’s wagering cut off date
spreads Array of FeedSpread type Yes Container for spread lines
totals Array of FeedTotalPoints type Yes Container for total lines
moneyLine Array of FeedMoneyline type Yes Container for moneyLine lines
teamTotals FeedTeamTotalPointsContainer type Yes Container for team total points
maxBetAmount FeedMaxBet type Container for maximum bet amounts

FeedMaxBet Type

Parameter Type Optional Description
spread Decimal Yes Maximum spread bet
totalPoints Decimal Yes Maximum total points bet
moneyLine Decimal Yes Maximum moneyline bet
teamTotals Decimal Yes Maximum team total points bet

FeedSpread Type

Parameter Type Optional Description
@altLineId Int Yes This is present only if it’s is alternative line
awaySpread Decimal No Away team handicap
awayPrice Decimal No Away team price
homeSpread Decimal No Home team handicap
homePrice Decimal No Home team handicap

FeedMoneyline Type

Parameter Type Optional Description
awayPrice Decimal No Away team price
homePrice Decimal No Home team price
drawPrice Decimal Yes Draw price. This is present only for events we offer price for draw

FeedTotalPoints Type

Parameter Type Optional Description
@altLineId Int Yes This is present only if it’s alternative line
points Decimal No Total points
overPrice Decimal No Over price
underPrice Decimal No Under price

FeedTeamTotalPointsContainer Type

Parameter Type Optional Description
homeTeamTotal TotalPoints Yes Home team total points
awayTeamTotal TotalPoints Yes Away team total points

Example of successful response

<rsp status="ok">
<fd>
<fdTime>1372336682214</fdTime>
<sports>
<sport>
<id>29</id>
<leagues>
<league>
<id>2436</id>
<events>
<event>
<startDateTime>2013-06-28T00:31:00Z</startDateTime>
<id>309893600</id>
<IsLive>Yes</IsLive>
<status>O</status>
<drawRotNum>25</drawRotNum>
<homeTeam type="Team1">
<name>AC Milan</name>
<rotNum>23</rotNum>
<score>1</score>
</homeTeam>
<awayTeam type="Team2">
<name>AS Roma</name>
<rotNum>24</rotNum>
<score>2</score>
</awayTeam>
<periods>
<period lineId="103648769">
<number>0</number>
<description>Game</description>
<cutoffDateTime>2013-06-28T00:31:00Z</cutoffDateTime>
<spreads>
<spread>
<awaySpread>1</awaySpread>
<awayPrice>105</awayPrice>
<homeSpread>-1</homeSpread>
<homePrice>-115</homePrice>
</spread>
<spread altLineId="186287960">
<awaySpread>1.25</awaySpread>
<awayPrice>-121</awayPrice>
<homeSpread>-1.25</homeSpread>
<homePrice>110</homePrice>
</spread>
</spreads>
<totals>
<total>
<points>1</points>
<overPrice>-105</overPrice>
<underPrice>-105</underPrice>
</total>
<total altLineId="186287961">
<points>0.75</points>
<overPrice>110</overPrice>
<underPrice>-124</underPrice>
</total>
</totals>
<moneyLine>
<awayPrice>112</awayPrice>
<homePrice>121</homePrice>
<drawPrice>131</drawPrice>
</moneyLine>
<teamTotals>
<homeTeamTotal>
<total>1</total>
<overPrice>-105</overPrice>
<underPrice>-105</underPrice>
</homeTeamTotal>
<awayTeamTotal>
<total>2</total>
<overPrice>-105</overPrice>
<underPrice>-105</underPrice>
</awayTeamTotal>
</teamTotals>
<maxBetAmount>
<spread>4000</spread>
<totalPoints>4000</totalPoints>
<moneyLine>2000</moneyLine>
<teamTotals>5000</teamTotals>
</maxBetAmount>
</period>
</periods>
</event>
</events>
</league>
</leagues>
</sport>
</sports>
</fd>
</rsp>

Example of response with an error

<rsp status="fail">
<err code="1">Invalid sport ID</err>
</rsp>

Get Currencies

Returns the list of supported currencies

Request

GET v1/currencies

No parameters.

URL Example
https://api.pinnaclesports.com/v1/currencies

Response

Rsp Type

Parameter Type Optional Description
@status FEED_STATUS_RESPONSE No Status of the response
currencies Array of Currency type No Currencies container. It will be present if @status = “ok”
err GenericException2 type Yes Root of the response with an error. It will be present if @status = “fail”

Currency Type

Parameter Type Optional Description
@code String No Currency code
currency String No Currency name

Example of successful response

<rsp status="ok">
<currencies>
<currency code="AUD">Australia Dollars </currency>
<currency code="CAD">Canada Dollars</currency>
<currency code="CNY">China Yuan Renmimbi</currency>
<currency code="CSK">Czech Republic Koruna</currency>
<currency code="DKK">Denmark Kroner</currency>
<currency code="EUR">Euro</currency>
<currency code="GBP">United Kingdom Pounds</currency>
<currency code="HKD">Hong Kong Dollars</currency>
<currency code="JPY">Japan Yen</currency>
<currency code="MXP">Mexico Pesos</currency>
<currency code="MYR">Malaysia Ringgit</currency>
<currency code="NOK">Norway Kroner</currency>
<currency code="NZD">New Zealand Dollars</currency>
<currency code="PLZ">Poland Zloty</currency>
<currency code="RUB">Russian Rouble</currency>
<currency code="SEK">Sweden Krona</currency>
<currency code="SGD">Singapore Dollars</currency>
<currency code="THB">Thailand Baht</currency>
<currency code="TWD">Taiwan Dollars</currency>
<currency code="USD">United States Dollars</currency>
</currencies>
</rsp>

Example of response with an error

<rsp status="fail">
<err code="99">Internal server error</err>
</rsp>

Get Client Balance

Returns current client balance.

GET /v1/client/balance

Request

No request parameters

URL Example
https://api.pinnaclesports.com/v1/client/balance

Response

Table 1 - Get Client Balance Response

Parameter Type Required Description
availableBalance decimal Yes Amount available for betting
outstandingTransactions decimal Yes Sum of not yet settled bet amounts
givenCredit decimal Yes Client’s credit
currency decimal Yes Client’s currency code

JSON example

{
"availableBalance":49354.37,
"outstandingTransactions":533.84,
"givenCredit":50000.0,
"currency":"CAD"

}
XML example

<clientBalanceResponse>
<availableBalance>49354.37</availableBalance>
<currency>CAD</currency>
<givenCredit>50000</givenCredit>
<outstandingTransactions>533.84</outstandingTransactions>
</clientBalanceResponse>

Throws

GenericException type

Place Bet

Place bet in the system.

POST /v1/bets/place

Request

Table 2 - Place Bet Request

Parameter Type Required Description
uniqueRequestId GUID Yes This unique id of the place bet requests. This is to support idempotent requests
acceptBetterLine BOOLAEN Yes Whether or not to accept a bet when there is a line change in favor of the client
customerReference String No Reference to a customer in third party system.
oddsFormat ODDS_FORMAT Yes Bet is processed with this odds format.
stake Decimal Yes Wagered amount in Client’s currency
winRiskStake WIN_RISK_TYPE Yes Whether the stake amount is risk or win amount
sportId Int Yes
eventId Int Yes
periodNumber Int Yes

This represents the period of the match. For example, for soccer we have:

0 - Game

1 - 1st Half

2 - 2nd Half

betType BET_TYPE Yes
team TEAM_TYPE No Chosen team type. This is needed only for SPREAD, MONEYLINE and TEAM_TOTAL_POINTS bet types
side SIDE_TYPE No Chosen side. This is needed only for TOTAL_POINTS and TEAM_TOTAL_POINTS bet type
lineId Int Yes Line identification
altLineId Int No Alternate line identification
pitcher1MustStart BOOLAEN No Baseball only. Refers to the pitcher for TEAM_TYPE.Team1. This applicable only for MONEYLINE bet type, for all other bet types this has to be TRUE
pitcher2MustStart BOOLAEN No Baseball only. Refers to the pitcher for TEAM_TYPE. Team2. This applicable only for MONEYLINE bet type, for all other bet types this has to be TRUE

JSON Example

{
"uniqueRequestId":"3ca3e7a7-12e1-4907-8b84-00f02e814b1d",
"acceptBetterLine":"TRUE",
"stake":150,
"winRiskStake":"WIN",
"lineId":103648474,
"sportId":29,
"eventId":307962592,
"periodNumber":0,
"betType":"MONEYLINE",
"team":"DRAW",
"oddsFormat":"AMERICAN"

}
XML Example

<placeBetRequest>
<uniqueRequestId>3ca3e7a7-12e1-4907-8b84-00f02e814b1d</uniqueRequestId>
<acceptBetterLine>TRUE</acceptBetterLine>
<stake>150</stake>
<winRiskStake>WIN</winRiskStake>
<lineId>103648474</lineId>
<sportId>29</sportId>
<eventId>307962592</eventId>
<periodNumber>0</periodNumber>
<betType>MONEYLINE</betType>
<team>DRAW</team>
<oddsFormat>AMERICAN</oddsFormat>
</placeBetRequest>

Response

Table 3 - Place Bet Response

Parameter Type Required Description
status PLACEBET_RESPONSE_STATUS Yes
errorCode PLACEBET_ERROR_CODE No If Status is PROCESSED_WITH_ERROR, errorCode will be in the response.
betId Int No The bet ID of the new bet. May be empty on failure.
uniqueRequestId GUID Yes Echo of the uniqueRequestId from the request.
betterLineWasAccepted BOOLAEN Yes

Whether or not the bet was accepted on the line that changed in favour of client.

This can be true only if acceptBetterLine in the Place Bet request is set to TRUE.

JSON Example - Accepted bet

{
"status":"ACCEPTED",
"errorCode":null,
"betId":309891823,
"uniqueRequestId":"3ca3e7a7-12e1-4907-8b84-00f02e814b1d",
"betterLineWasAccepted":true,
}

JSON Example - Bet processed with error

{
"status":"PROCESSEDWITHERROR",
"errorCode":"LINE_CHANGED",
"betId":null,
"uniqueRequestId":"3ca3e7a7-12e1-4907-8b84-00f02e814b1d"
}

XML Example - Accepted bet

<placeBetResponse>
<betId>309891825</betId>
<errorCode nil="true" />
<status>ACCEPTED</status>
<uniqueRequestId>3ca3e7a7-12e1-4907-8b84-00f02e814b1d</uniqueRequestId>
</placeBetResponse>

JSON Example - Bet processed with error

<placeBetResponse>
<betId nil="true" />
<errorCode>LINE_CHANGED</errorCode>
<status>PROCESSEDWITHERROR</status>
<uniqueRequestId>3ca3e7a7-12e1-4907-8b84-00f02e814b1d</uniqueRequestId>
<betterLineWasAccepted>true</betterLineWasAccepted>
</placeBetResponse>

Throws

GenericException type

Get Line

Returns latest line.

Request

GET /v1/line?sportId={sportId}&leagueId={leagueId}&eventId={eventId}&periodNumber={periodNumber}&betType={betType}&team={team}&side={side}&handicap={handicap}

Table 4 - Get Line Request

Parameter Type Required Description
sportId Int Yes
leagueId Int Yes
eventId Int Yes
periodNumber Int Yes

This represents the period of the match. For example, for soccer we have:

0 - Game

1 - 1st Half

2 - 2nd Half

betType BET_TYPE Yes
team TEAM_TYPE No Chosen team type. This is needed only for SPREAD, MONEYLINE and TEAM_TOTAL_POINTS bet types
side SIDE_TYPE No Chosen side. This is needed only for TOTAL_POINTS and TEAM_TOTAL_POINTS bet type
handicap Decimal No This is needed for SPREAD, TOTAL_POINTS and TEAM_TOTAL_POINTS bet type
oddsFormat ODDS_FORMAT Yes

URL Example

https://api.pinnaclesports.com/v1/line?sportId=29&leagueId=1728&eventId=308195882&betType=SPREAD&oddsFormat=DECIMAL&periodNumber=0&team=TEAM1&handicap=-1

Response


Table 5 - Get Line Response

Parameter Type Required Description
status GETLINE_RESPONSE_STATUS Yes If the value is NOT_EXISTS, than this will be the only parameter in the response. All other params would be empty.
price Decimal No Latest price
lineId Int No Line identification needed to place a bet
altLineId Int No This would be needed to place the bet if the handicap is on alternate line, otherwise it will not be in the response.
team1Score Int No Away team score. Applicable to soccer only
team2Score Int No Home team score. Applicable to soccer only
team1RedCards Int No Away team red cards. Applicable to soccer only.
team2RedCards Int No Away team red cards. Applicable to soccer only.
maxRiskStake Decimal No Maximum bettable risk amount
minRiskStake Decimal No Minimum bettable risk amount
maxWinStake Decimal No Maximum bettable win amount
minWinStake Decimal No Minimum bettable win amount
effectiveAsOf Date Time No Line is effective as of this date and time

JSON Example

{
"status":"SUCCESS",
"price":1.952,
"lineId":100282782,
"altLineId":null,
"team1Score":null,
"team2Score":null,
"team1RedCards":null,
"team2RedCards":null,
"maxRiskStake":4061.76,
"minRiskStake":50.77,
"maxWinStake":3866.80,
"minWinStake":48.34,
"effectiveAsOf":"2013-06-18T14:02:26.6508"
}

XML Example

<lineResponse>
<altLineId nil="true" />
<effectiveAsOf>2013-06-20T14:01:23.6200</effectiveAsOf>
<lineId>103648482</lineId>
<maxRiskStake>986.43</maxRiskStake>
<maxWinStake>966.70</maxWinStake>
<minRiskStake>49.32</minRiskStake>
<minWinStake>48.34</minWinStake>
<price>1.98</price>
<status>SUCCESS</status>
<team1RedCards nil="true" />
<team1Score nil="true" />
<team2RedCards nil="true" />
<team2Score nil="true" />
</lineResponse>

Throws

GenericException type

Get Bets

Returns running and settled bets.

Request

GET /v1/bets?betlist={betlist}&fromDate={fromDate}&toDate={toDate}& betids=[1,2,3]

Table 6 - Get Bets Request

Parameter Type Required Description
betlist BETLIST_TYPE No Not needed when betids is submitted
betids Int[] No

Array 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.

fromDate Date Time No

Start date of the requested period. Required when betlist parameter is submitted.

Difference between fromDate and toDdate can’t be more than 30 days.

toDate Date Time No End date of the requested period Required when betlist parameter is submitted.


URL Examples

Get bets by bet Ids

https://api.pinnaclesports.com/v1/ bets?betids=299633842,299629993

Get settled bets by date range

https://api.pinnaclesports.com/v1/bets?betlist=settled&fromDate=2013-06-01&toDate=2013-06-05

Response

Table 7 - Get Bets Response

Parameter Type Required Description
betId Int Yes Bet identification
wagerNumber Int Yes

Wager identification. All bets placed thru the API will have value 1.

Website supports multiple bets (wagers) placement in the same bet slip. In that case the bet would have appropriate wager number.

placedAt Date Time Yes Date time when the bet was placed
win Decimal Yes Win amount
risk Decimal Yes Risk amount
winLoss Decimal No Win-Loss for settled bets
betStatus BET_STATUS Yes
betType BET_TYPE Yes
sportId Int Yes
leagueId Int Yes
eventId Int Yes
handicap Decimal No Handicap that the bet was placed on
price

Decimal

Yes Price that the bet was placed on
teamName String No Team name. If the bet was placed on moneyline draw side, the value will be Draw
side SIDE_TYPE No
oddsFormat ODDS_FORMAT Yes Bet odds format.
clientCommission Decimal No Client’s commission on the bet
pitcher1 String No Team1 pitcher name. Baseball only.
pitcher2 String No Team2 pitcher name. Baseball only.
pitcher1MustStart BOOALEAN No Whether the team1 pitcher must start in order for bet to take action. Baseball only.
pitcher2MustStart BOOALEAN No Whether the team2 pitcher must start in order for bet to take action. Baseball only.
team1 String Yes Team 1 name.
team2 String Yes Team 2 name.

JSON example

{ "bets" : [ { "Handicap" : -1.0,
"placedAt" : "2013-06-19T15:00:31",
"betId" : 309889744,
"wagerNumber" : 1,
"betStatus" : "REFUNDED",
"betType" : "SPREAD",
"customerCommission" : null,
"eventId" : 308195856,
"leagueId" : 1728,
"oddFormat" : "AMERICAN",
"price" : 135.0,
"risk" : 50.0,
"side" : null,
"sportId" : 29,
"teamName" : "BK Hacken",
"win" : 67.5,
"winLoss" : null,
"pitcher1" : null,
"pitcher2" : null,
"pitcher1MustStart" : null,
"pitcher1MustStart" : null,
"team1" : "BK Hacken",
"team2" : "Crucero del Norte",
},
{ "Handicap" : 0.75,
"placedAt" : "2013-06-20T10:05:46",
"betId" : 309893592,
"wagerNumber" : 1,
"betStatus" : "ACCEPTED",
"betType" : "SPREAD",
"customerCommission" : null,
"eventId" : 308195893,
"leagueId" : 1728,
"oddFormat" : "AMERICAN",
"price" : -2001.0,
"risk" : 9341.0,
"side" : null,
"sportId" : 29,
"teamName" : "Syrianska FC",
"win" : 466.81999999999999,
"winLoss" : null,
"pitcher1" : null,
"pitcher2" : null,
"pitcher1MustStart" : null,
"pitcher2MustStart" : null,
"team1" : "Syrianska FC",
"team2" : "Crucero del Norte",
}
] }

XML example

<betsResponse>
<bets>
<straightBet>
<Handicap>-1</Handicap>
<placedAt>2013-06-19T15:00:31</placedAt>
<betId>309889744</betId>
<wagerNumber>1</ wagerNumber >
<betStatus>REFUNDED</betStatus>
<betType>SPREAD</betType>
<customerCommission nil="true" />
<eventId>308195856</eventId>
<leagueId>1728</leagueId>
<oddFormat>AMERICAN</oddFormat>
<price>135</price>
<risk>50</risk>
<side nil="true" />
<sportId>29</sportId>
<teamName>BK Hacken</teamName>
<win>67.5</win>
<pitcher1 nil="true" />
<pitcher2 nil="true" />
<pitcher1MustStart nil="true" />
<pitcher2MustStart nil="true" />
<team1>BK Hacken</team1>
<team2>Crucero del Norte</team2>
</straightBet>
<straightBet>
<Handicap>0.75</Handicap>
<placedAt>2013-06-20T10:05:46</placedAt>
<betId>309893592</betId>
<wagerNumber>1</ wagerNumber >
<betStatus>ACCEPTED</betStatus>
<betType>SPREAD</betType>
<customerCommission nil="true" />
<eventId>308195893</eventId>
<leagueId>1728</leagueId>
<oddFormat>AMERICAN</oddFormat>
<price>-201</price>
<risk>9341</risk>
<side nil="true" />
<sportId>29</sportId>
<teamName>Syrianska FC</teamName>
<win>466.82</win>
<winLoss nil="true" />
<pitcher1 nil="true" />
<pitcher2 nil="true" />
<pitcher1MustStart nil="true" />
<pitcher2MustStart nil="true" />
<team1>Syrianska FC</team1>
<team2>Crucero del Norte</team2>
</straightBet>
</bets>
</betsResponse>

Throws

GenericException type

Enums

BET_STATUS

Value Description
ACCEPTED
PENDING_ACCEPTANCE Live bets in danger zone
REJECTED
REFUNDED
CANCELLED
LOSE
WON

ODDS_FORMAT

Value Description
AMERICAN
DECIMAL
HONGKONG
INDONESIAN
MALAY

BET_TYPE

Value Description
SPREAD
MONEYLINE
TOTAL_POINTS
TEAM_TOTAL_POINTS

SIDE_TYPE

Value Description
OVER
UNDER

BOOLAEN

Value Description
TRUE
FALSE

WIN_RISK_TYPE

Value Description
WIN Stake is win amount
RISK Stake is risk amount

PLACEBET_RESPONSE_STATUS

Value Description
ACCEPTED Accepted
PENDING_ACCEPTANCE Pending Acceptance. This is for live bets in danger zone
PROCESSED_WITH_ERROR Processed with error

PLACEBET_ERROR_CODE

Value Description
ALL_BETTING_CLOSED Betting is not allowed at this moment
ALL_LIVE_BETTING_CLOSED Live betting is not allowed at this moment
BLOCKED_CLIENT Client is no longer active
INVALID_COUNTRY Client country is not allowed for betting
BLOCKED_BETTING Not allowed betting for the client
INVALID_EVENT Invalid eventid
ABOVE_MAX_BET_AMOUNT Stake is above allowed maximum amount
BELOW_MIN_BET_AMOUNT Stake is below allowed minimum amount
OFFLINE_EVENT Bet is submitted on a event that is offline
INSUFFICIENT_FUNDS Bet is submitted by a client with insufficient funds
LINE_CHANGED Bet is submitted on a line that has changed
RED_CARDS_CHANGED Bet is submitted on a live soccer event with changed red card count
SCORE_CHANGED Bet is submitted on a live soccer event with changed score
TIME_RESTRICTION Bet is submitted within too short of a period from the same bet previously placed by a client
PAST_CUTOFFTIME Bet is submitted on a game after the betting cutoff time
ABOVE_EVENT_MAX Bet cannot be placed because client exceeded allowed maximum of risk on a line
INVALID_ODDS_FORMAT If a bet was submitted with the odds format that is not allowed for the client
LISTED_PITCHERS_SELECTION_ERROR If bet was submitted with pitcher1MustStart and/or pitcher2MustStart parameters in Place Bet request with values that are not allowed.

GETLINE_RESPONSE_STATUS

Value Description
SUCCESS OK
NOT_EXISTS Line not offered anymore

TEAM_TYPE

Value Description
Team1 Team 1
Team2 Team 2
Draw Draw. This is used for MONEYLINE bet type only.

BETLIST_TYPE

Value Description
SETTLED Settled bets
RUNNING Running bets

EVENT_STATUS

Value Description
O This is the starting status of a game. It means that the lines are open for betting.
I This status indicates that one or more lines have a red circle (a lower maximum bet amount).
H This status indicates that the lines are temporarily unavailable for betting.

YES_NO_ TYPE

Value Description
Yes
No

BOOLEAN2

Value Description
0 False
1 True

FEED_ODDS_FORMAT_TYPE

Value Description
0 American odds format
1 Decimal odds format
2 HongKong odds format
3 Indonesian odds format
4 Malay odds format
5 Fraction odds format

FEED_STATUS_RESPONSE

Value Description
ok Feed has response
fail There was an error

Exceptions

GenericException type

Parameter

Type Required Description
code string Yes Error code
message string Yes Additional details of the error

HTTP Status Code code Description
500 UNEXPECTED_ERROR Unexpected error
409 INVALID_REQUEST_DATA Invalid request parameters
409 INVALID_CREDENTIALS Invalid username and password combination
409 DUPLICATED_REQUEST Request with the same uniqueRequestId was already processed
409 RESUBMIT_REQUEST You would need to resubmit the request. Please use new uniqueRequestId

JSON example

{
"code":"UNAUTHORIZED",
"message":"Invalid credentials"
}

XML example

<error>
<code>UNEXPECTED_ERROR</code>
<message>An error has occurred.</message>
</error>

GenericException2 type

Parameter

Type Required Description
@code string Yes Error code
err string Yes Error message

HTTP Status Code code Description
200 1 Invalid sport ID
200 2 Invalid league(s) ID(s)
200 3 Invalid 'last' timestamp
200 5 Request client ID blocked
200 401 Invalid credentials
200 8 Invalid odds format
200 9 Invalid 'Is Live' parameter
200 10 Invalid currency code
200 11 Currency code has no up-to-date exchange rate available
200 99 Internal server error

Example

<rsp status="fail">
<err code="1">Invalid sport ID</err>
</rsp>


Getting Started

Step 1 – Sign Up

To get started you would need to create an account.

Step 2 - Get Lines

First, you would need to get the list of sports from Get Sports operation.
If you are interested in particular leagues you can get sport leagues by calling Get Leagues operation.
To get the actual lines call Get Feed operation.

NOTE:

When you call the Get Feed operation without the last parameter the response will not have the latest lines.

To get the latest lines you would need to issue subsequent request with the last parameter value from the feedTime parameter, from the previous response. This would return the changes since the previous Get Feed request.

All subsequent calls after that should have last parameter.

This would assure that you always get the fastest Get Feed response with the freshest lines.

Step 3 - Get Line (optional)

Call Get Line operation if you need exact stake limits or if you are interested only in a specific line. Please note that the limits in the Get Feed response are just general limits. Limits in the Get Line response are the exact limits.

Table 8 shows how to do mapping of Get Feed response to Get Line request.

Step 4 - Place Bet

To place a bet you need to call Place Bet operation.
Table 8 shows how to do mapping of Feed response to Place Bet request.
If you previously call Get Line operation, use the lineId (altLineId) from the response.

Step 5 - Get Bets

To check the status of the placed bet you need to call Get Bets operation. The recommended way is to use bet id.
For bets on live events that are in PENDING_ACCEPTANCE state, you can call Get Bets every 5 sec to get the new status of the bet, to see if it’s accepted or rejected.

Table 8 - Map of the feed response to Get Line and Place Bet operation parameters.

Parameter Path in the feed response
sportId rsp/fd/sports/sport/id
leagueId rsp/fd/sports/sport/leagues/league/id
eventId rsp/fd/sports/sport/leagues/league/events/event/id
periodNumber rsp/fd/sports/sport/leagues/league/events/event/periods/period/number
team rsp/fd/sports/sport/leagues/league/events/event/homeTeam(awayTeam)/@type
handicap SPREAD:
rsp/fd/sports/sport/leagues/league/events/event/periods/period/spreads/spread/awaySpread(homeSpread)

TOTAL_POINTS:
rsp/fd/sports/sport/leagues/league/events/event/periods/period/totals/total/points

TEAM_TOTAL_POINTS:
rsp/fd/sports/sport/leagues/league/events/event/periods/period/teamTotals/homeTeamTotal(awayTeamTotal)/total

MONEYLINE:
Moneylines do not have handicap.
lineId rsp/fd/sports/sport/leagues/league/events/event/periods/period/@lineId
altLineId SPREAD:
rsp/fd/sports/sport/leagues/league/events/event/periods/period/spreads/spread/@altLineId

TOTAL_POINTS:
rsp/fd/sports/sport/leagues/league/events/event/periods/period/totals/total/@altLineId

TEAM_TOTAL_POINTS
Team total points do not have alternative lines

MONEYLINE
Moneylines do not have alternative lines

Commands

  1. Get list of sports Provides a list of all sports supported by Pinnacle.
  2. Get list of leagues Provides a list of active leagues for a given sport.
  3. Get list of currencies Provides a list of supported currencies (for amount conversions in feed)
  4. Get feed (using GET request method) Provides the revised sports feed in XML format.
  5. Get feed (using POST request method) Provides the revised sports feed in XML format.

Error Messages

  • Message 1
  • Message 2

FAQs

  • How often can I refresh your odds?
  • You are able to make calls for any changes to the feed every five (5) seconds.
  • Where are your odds for Contests, Futures and Propositions?
  • These will be added to the API over the coming months. We will contact you and update these FAQs when these are included.
  • How do I make sure my links to www.pinnaclesports.com are tracking correctly?
  • Please ensure that any links back to www.pinnaclesports.com are tagged with your tracking link. Your tracking links are available from your affiliate account accessed at http://affiliates.pinnaclesports.com

    A correct tracking link will have the format:

    http://affiliates.pinnaclesports.com/processing/clickthrgh.asp?btag=a_numbersb_numbers
  • Do you cache responses? For how long?
  • All feed command requests that have the same parameters (e.g. same client ID/API key/sport ID) are cached for one minute.
  • Why can’t I access your Outrights and Futures markets or your Boxing or Golf odds?
  • These are currently being integrated into the API. To access these odds, please use our older, free-to-access feed at: http://xml.pinnaclesports.com/pinnacleFeed.aspx
  • Can I link directly to the relevant odds pages on www.pinnaclesports.com (deep linking)?
  • Yes. To link directly to our odds pages please get in touch via csd@pinnaclesports.com
  • How can I return only those sports and leagues which have data?
  • The attribute feedContents of <sport> and <league> elements define whether there is content or not. The possible values are:
    • 1: contains data
    • 0: does not contain data
    • -1: status unknown
  • By iterating through the sports or leagues you can filter out the unnecessary ones.
  • How do you calculate maximum bet amounts for currencies other than USD?
  • We use exchange rates provided by oanda.com which we update every 24 hours. Please note that for non-USD currencies, we round them to the largest integer less than or equal to the specified decimal number resulting from currency conversion. For example, a maximum bet amount of £345.23 would be rounded down to £345.
  • What time zone is used for the feed?
  • All times displayed in the feed are in GMT.

Fair Use

This API is provided free of charge to our players, partners and affiliates. However, use of this free resource is subject to our "Fair Use Policy" which is set out below.

When you utilise the API, you are agreeing to this policy. Any breeches of this policy, whether intentional or not, may result in a temporary suspension of your access. In extreme cases, we reserve the right to terminate your access completely. These decisions will be taken after discussions with you (where possible) and will be entirely at our discretion.

Fair usage

The following limitations must be observed:

  • Requests made for the "feed" command without the "last" parameter must be restricted to once every 60 seconds
  • Requests made for the "feed" command with the "last" must be restricted to once every 5 seconds

Also, you will not attempt or encourage others to:

  • Attempt to interfere with, disrupt, or disable any API features
  • Sell, rent, lease, sublicense, redistribute, or syndicate the API to any third party without prior written approval from Pinnacle Sports.

Best practice

Please use an incremental feed ("feed" command with "last" parameter) instead of a full feed ("feed" command without "last" parameter).


Disclaimer

While every effort is made to ensure the accuracy and validity of the information included in this feed, Pinnacle Sports make no representation that the operation of this feed will be uninterrupted or error free. As such, Pinnacle Sports provide this service at the users own risk and will not be liable for any consequences arising from any interruptions or errors.


Code Examples

Place Bet call in C#

var request = (HttpWebRequest) WebRequest.Create("https://api.pinnaclesports.com/v1/bets/place");
string credentials = String.Format("{0}:{1}", "yourclientid", "yourpassword");
byte[] bytes = Encoding.UTF8.GetBytes(credentials);
string base64 = Convert.ToBase64String(bytes);
string authorization = String.Concat("Basic ", base64);
request.Headers.Add("Authorization", authorization);
request.Method = "POST";
request.Accept = "application/json";
request.ContentType = "application/json; charset=utf-8";
string postJson =
"{\"uniqueRequestId\":\"3ca3e7a7-12e1-4907-8b84-00f02e814b1d\"," +
"\"acceptBetterLine\":\"TRUE\"," +
"\"stake\":150," +
"\"winRiskStake\":\"WIN\"," +
"\"lineId\":104520034," +
"\"sportId\":29," +
"\"eventId\":311458946," +
"\"periodNumber\":0," +
"\"betType\":\"SPREAD\"," +
"\"team\":\"TEAM1\"," +
"\"oddsFormat\":\"AMERICAN\"" +
"}";

byte[] byteArray = Encoding.UTF8.GetBytes(postJson);
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();

HttpWebResponse response;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException ex)
{
response= (HttpWebResponse)ex.Response;
}

var stream = response.GetResponseStream();
string responseBody;
using (var reader = new StreamReader(stream))
{
responseBody = reader.ReadToEnd();
}

Get Feed call in PHP

<?php
// This fetches the initial feed from the Pinnacle Sports API
$feedUrl = 'https://api.pinnaclesports.com/v1/feed?sportid=29';

// Set your credentials here, format = clientid:password from your account.
$credentials = base64_encode("yourclientid:yourpassword");

// Build the header, the content-type can also be application/json if needed
$header[] = 'Content-length: 0';
$header[] = 'Content-type: application/xml';
$header[] = 'Authorization: Basic ' . $credentials;

// Set up a CURL channel.
$httpChannel = curl_init();
// Prime the channel
curl_setopt($httpChannel, CURLOPT_URL, $feedUrl);
curl_setopt($httpChannel, CURLOPT_RETURNTRANSFER, true);
curl_setopt($httpChannel, CURLOPT_HTTPHEADER, $header);
// Unless you have all the CA certificates installed in your trusted root authority, this should be left as false.
curl_setopt($httpChannel, CURLOPT_SSL_VERIFYPEER, false);

// This fetches the initial feed result. Next we will fetch the update using the fdTime value and the last URL parameter
$initialFeed = curl_exec($httpChannel);
echo $initialFeed;

// You need to pick an XML library that is suitable for you, in this case i am using the built-in simple XML feature of PHP.
$xmlDocument = simplexml_load_string($initialFeed);
// Simple XML has now build an array of arrays or a dictionary of values, you may access this information by index or name.
$feedTime = $xmlDocument->rsp->fd[0]->fdTime;
echo $fdTime;

// Now we simply alter the URL with the last parameter and feed in the value of fdTime
$feedUrl = 'https://api.pinnaclesports.com/v1/feed?sportid=29&last=' . $fdTime;

// Now we can fetch the updates.
$updates = curl_exec($httpChannel);

// Build an XML document from simple XML to read your data as an object again.
// ...
?>


  • Feedback for the API XML odds feed should be directed to csd@pinnaclesports.com, however, we do not offer technical support or instructions beyond the available manual