Python Forum

Full Version: Oanda Api for price streaming
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone I am not sure if this is the right place to ask questions if not please refer me to the right place and I will move my question there . I am trying to make GUI application and implement Oanda API in it so I can stream forex pairs prices in my own GUI using matplotlib. I have everything set but the problem is I don't know how to retrieve the data using their API and most of the documentations on the net is all about algo trading , but what I am interested about at this point is to get instruments prices and stream them in my own GUI can anyone help me please on this? I m doing it to learn python
I use quandl to get the eur/usd quote:

#!/usr/bin/python3
import requests
import json

rsp = requests.get("https://www.quandl.com/api/v3/datasets/ECB/EURUSD.json?rows=1")
if rsp.status_code == 200:
    data = rsp.text.strip()
    jj = json.loads(data)
    print(jj["dataset"]["data"][0])
else:
    print("error:", rsp.status_code)