GithubHelp home page GithubHelp logo

nachouve / betfairexchange Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nisseoscar/betfairexchange

0.0 0.0 0.0 33 KB

A python api-wrapper for the Swedish betfair exchange api. end-point.

Python 100.00%

betfairexchange's Introduction

BetfairExchange

A python api-wrapper for the Swedish betfair exchange api.

Full documentation and support can be found at https://docs.developer.betfair.com/display/1smk3cen4v3lu3yomq5qye0ni

Currently the Api is avalible for Swedish, Italian, Spain and Romania end point. If wanting to switch to any other of these endpoints modify line 22

 22       resp = requests.post('https://identitysso-cert.betfair.se/api/certlogin'

To the country code from .se to .it, .es or .ro.

How to set up for the Betfair exchange api

So in order to use the api you must enable non-Interactive (bot) login for your account and create a Self Signed Certificate. You can enable this setting at My Details page on your betfair account. To generate the Certificate you need to generate a RSA key pair using openssl by running the following command

openssl genrsa -out client-2048.key 2048

This may require you to override some default settings of openSSL which is done by creating a configuration file openssl.cnf with the following settings.

[ ssl_client ]
basicConstraints = CA:FALSE
nsCertType = client
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth

After this is done you need to generate a certificate signing request file to verify identity.

openssl req -new -config openssl.cnf -key client-2048.key -out client-2048.csr

Here it is important that the information submitted matches your account settings. The next step is to self-sign the certificate request to create a certificate used to verify yourself at the api endpoint.

openssl x509 -req -days 365 -in client-2048.csr -signkey client-2048.key -out client-2048.crt -extfile openssl.cnf -extensions ssl_client 

Once this certificate is generated log into your betfair account, go to My Details and upload your certificate by pressing edit under Automated Betting Program Access. After this is done, the api should be functional and ready to use.

If having trouble during the verification, betfair has their own guide which can be found here https://docs.developer.betfair.com/display/1smk3cen4v3lu3yomq5qye0ni/Non-Interactive+%28bot%29+login .

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.