Skip to main content

This library currently implements the features released under version 3.0.1 of OANDA's REST API.

Project description

PyPI latest PyPI Version Coverage Status Travis Build Status Code Health PyPI License


OANDAPY is a python3 wrapper for Oanda’s REST API v20. This library currently implements the features released under version 3.0.1 of OANDA’s REST API.

Head over to OANDA’s REST API v20 docs to go through their documentation. This repository start on fork from Gustavo Ferreira and have a massive change later


This project requires:

  • Python 3.4 or earlier
  • git client
  • virtualenvwrapper/virtualenv for local development


$ pip install oandapy

Or, you can download the source and

$ git clone
$ cd oandapy
$ python install


  1. Create a account on to get a API Access Token.
  2. Import the oandapy module and create an instance with your access token:
>> from oandapy import APIv20
>> from oandapy.exceptions import OandaError
>> access_token = "<OANDA Access token>"
>> oanda = APIv20(environment="practice", access_token=access_token)

>> try:
>>     result = con.account.get_accounts()
>> # In case of http status 400
>> except OandaError as exc:
>>     print(str(exc))
>> # Use the result as object
>> print(result.as_obj())
MyModel(accounts=[NamelessModel(tags=[], id='000-000-0000000-000')])
>> # Use the result as dict
>> print(result.as_dict())
{'accounts': [{'id': '000-000-0000000-000', 'tags': []}]}


Please send pull requests, very much appreciated.

  1. Fork the repository on GitHub.
  2. Create a virtualenv.
  3. Install requirements. pip install -r requirements-dev.txt
  4. Install pre-commit. pre-commit install
  5. Make a branch off of master and commit your changes to it.
  6. Create a Pull Request with your contribution


  • Oanda API REST-v20 is still under development, some functionality have not yet been implemented (Pricing History, Forex Labs), but I will keep an eye on it, and as soon as it gets implemented I will update this library accordingly.
  • DO NOT USE THIS LIBRARY ON PRODUCTION! It is under heavy development and still lacks testing suites. It is also partially documented.
  • Use this library at your own risk.
  • Happy hunting on the markets!!



  • Update url on


  • Update Sphinx doc
  • Update docstrings (its not ok yet)


  • Changes to Pypi view


  • Refactor: Move FactoryResponse to Core API and fix tests


  • Update Readme file to get simple examples


  • Change Setup data


  • Add Travis and Coveralls support
  • Remove Enum feature


  • Update readme fixing typos and changing the introduction

0.0.1 (2018-12-06)

  • initial release using changes file

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for oandapy, version 0.0.9
Filename, size File type Python version Upload date Hashes
Filename, size oandapy-0.0.9-py3-none-any.whl (17.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size oandapy-0.0.9.tar.gz (14.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page