Giter Club home page Giter Club logo

betfairng's Introduction

betfairng: A client library for Betfair API-NG

https://travis-ci.org/russgray/betfairng.svg?branch=master

Betfair API-NG is the next-gen version of the longstanding SOAP-based Betfair API v6. As of November 2014, API-NG will be the only way to programmatically access the Betfair exchange.

API-NG is a REST-based design rather than SOAP, and has improved consistency and convention that make it easier to work with. betfairng makes it easier still, with pythonic naming and sensible defaults.

>>> market_filter = {
        'eventTypeIds': [7],
        'marketCountries': ['GB'],
        'marketTypeCodes': ['WIN'],
        'sort': 'FIRST_TO_START',
        'from': datetime.now().isoformat()
    }
>>> next_race = api.list_market_catalogue(filter=market_filter, marketProjection=['RUNNER_METADATA'], maxResults=1)[0]
>>> book = api.list_market_book(marketIds=['1.114185343'], priceProjection=dict(priceData=['EX_BEST_OFFERS']))

betfairng also provides a backwards-compatibility layer so you can continue to use the SOAP naming conventions (e.g. placeBets instead of place_orders, getMarketPrices instead of list_market_book, etc).

Installation

From pypi:

pip install betfairng

Authentication

Betfair API-NG requires 2-way SSL for non-interactive logins (i.e. for bots or automated tools). Instructions for creating your certificate and registering it with Betfair can be found on Betfair's website.

Once done, simply pass the paths to the .crt and .key files to the authenticate function along with your username and password.

betfairng's People

Watchers

 avatar  avatar

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.