PinnacleWrapper 2.1.0

dotnet add package PinnacleWrapper --version 2.1.0                
NuGet\Install-Package PinnacleWrapper -Version 2.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PinnacleWrapper" Version="2.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PinnacleWrapper --version 2.1.0                
#r "nuget: PinnacleWrapper, 2.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PinnacleWrapper as a Cake Addin
#addin nuget:?package=PinnacleWrapper&version=2.1.0

// Install PinnacleWrapper as a Cake Tool
#tool nuget:?package=PinnacleWrapper&version=2.1.0                

C# Wrapper for the PinnacleSports API

A complete API client that builds on the PinnacleSports API Documentation

Update

2.1

  • Feature : New constructor that accepts an HttpClient
  • Feature : HttpClientFactory.GetNewInstance can be used to instantiate an HttpClient with necessary headers & baseUrl for Pinnacle's Api, with GZIP option
  • Bug fix : Fixed issue that was causing all limits returned by GetOdds to be in USD regardless of the currency provided
  • Bug fix : Now correctly populates Team Totals properties from GetOdds call
  • Breaking changes : PlaceBetResponse.UniquerequestId renamed PlaceBetResponse.UniqueRequestId
  • Breaking changes : Currency.rate renamed Currency.Rate

2.0

  • First version published on nuget.org
  • Library now targeting .netstandard 2.0 so should work from both .Net Framework 4.7.2 and .Net Core 2.2 projects
  • You can override the default version, v1, for the Fixtures and Odds requests
  • PinnacleClient constructor now has an optional baseUrl parameter, default value https://api.pinnacle.com
  • GetFeed functionalities removed as they are deprecated by Pinnacle, use GetFixtures and GetOdds instead. If you need GetFeed revert to v1.0 of this library.

References

These references are available via NuGet.

  • Newtonsoft.Json
  • Microsoft.AspNet.WebApi.Client package

Usage

Here's an example of getting all lines for upcoming Tennis matches (across all leagues):

var httpClient = HttpClientFactory.GetNewInstance("username", "password");

var api = new PinnacleClient("AUD", OddsFormat.DECIMAL, httpClient);

// 33 is the Tennis SportId. This gets all Events currently offered
var fixtures = await api.GetFixtures(new GetFixturesRequest(33));

// this retrieves the odds that correspond to each fixture.
var odds = await client.GetOdds(new GetOddsRequest(33));

Refreshing lines:

Use the "since" parameter with GetFixtures (update current events) and GetOdds (get latest odds).

Example (continuing from above):

Thread.Sleep(5000);  // wait between calls one way or another. Calling the API too aggressively may get you blocked from using the API.
var oddsChanges = await _client.GetOdds(new GetOddsRequest(33, odds.Last));   

This library started off as a cleaned up version by anderj017 of the Pinnacle API wrapper created by Nuno Freitas and has been extended and tweaked by various people since.

The initial location of this wrapper was https://github.com/anderj017/pinnaclewrapper

Enjoy!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 720 6/6/2019
2.1.0-beta 453 5/30/2019
2.0.0 563 5/25/2019