Skip to content

gttkeith/python-saxo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 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
s = Session(app_key, auth_endpoint, token_endpoint, secret)

Performing requests:

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

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

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

Query parameters are case-sensitive.

python-saxo is deliberately minimal, 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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages