Giter VIP home page Giter VIP logo

pinnaclewrapper's Introduction

C# Wrapper for the PinnacleSports API

A complete API client that builds on the PinnacleSports API Documentation

Update:

Pinnacle has deprecated GetFeed, instead offering GetFixtures and GetOdds. The wrapper has kept GetFeed for legacy purposes but it will be removed in a future release.

References:

These references are available via NuGet.

Newtonsoft.Json 
System.Net.Http.Formatting (part of the Microsoft.AspNet.WebApi.Client package)

Usage:

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

var client = new PinnacleClient("username", "password", "AUD", OddsFormat.Decimal);
var fixtures = client.GetFixtures(new GetFixturesRequest(12));	// 12 is the E-Sports Sport Id. This gets all Esports Events currently offered
var odds = client.GetOdds(new GetOddsRequest(12)); // this retrieves the odds that correspond to each fixture.

Refreshing lines:

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

Example (continuing from above):

Thread.Sleep(5000);    // wait 5 seconds between calls!
var var odds2 = await _client.GetOdds(new GetOddsRequest(12, odds.Last));

A future release will monitor lines for changes and fire an event when it updates.

I have cleaned up and extended the wrapper created by Nuno Freitas to support the JSON functions (GetClientBalance, PlaceBet, GetLine, GetBets, GetInRunning, GetFixtures and GetOdds).

Enjoy!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.