Skip to content

webclinic017/python-saxo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-saxo

Python wrapper for Saxo Bank's OpenAPI

You'll need

Usage

Create an app on your developer account (for either DEMO or LIVE) using the following settings:

An example main.py has been provided in the repo, where app details are stored in a params.json file. Queries can be made through the console, and results are dumped into out.csv in the same directory.

pysaxo negotiates the authentication procedure using the complete OAuth2 authorisation flow. Sessions are proactively refreshed to prevent unexpected logouts.

Creating a new session:

from pysaxo import Session
access = Session(app_key, auth_endpoint, token_endpoint, secret)

Performing requests:

# get information about authorised user
access.get('port/v1/users/me')

# retrieve a list of FX spot instruments containing SGD
access.get('ref/v1/instruments', KeyWords='SGD', AssetTypes='FxSpot')

# retrieve the historical 1H:1M bid/asks of asset UIC 45: USDSGD
access.get('chart/v1/charts', Uic=45, AssetType='FxSpot', Horizon=60)

Query parameters are case-sensitive.

python-saxo is deliberately designed in an abstract manner, and will retain compatibility through changes in Saxo's API endpoints. For a comprehensive overview of available endpoints and query/response formats, please refer to the Saxo OpenAPI documentation.

About

Python wrapper for Saxo Bank's OpenAPI

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages