python_forex_quotes is a Python Library for fetching realtime forex quotes
- Python 3.7.*
- An API key which you can obtain for free at https://1forge.com/register
pip install python_forex_quotes
import python_forex_quotes
#You can get an API key for free at 1forge.com
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
import python_forex_quotes
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
print client.getSymbols()
import python_forex_quotes
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
print client.getQuotes(['EUR/USD', 'GBP/JPY'])
import python_forex_quotes
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
print client.convert('EUR', 'USD', 100)
import python_forex_quotes
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
if client.marketIsOpen() == True:
print "Market is open!"
import python_forex_quotes
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
print client.quota()
import python_forex_quotes
def onUpdate(value):
print(value)
def onMessage(value):
print(value)
def onConnect():
client.subscribeToAll()
client = python_forex_quotes.ForexDataClient('YOUR_API_KEY')
client.onUpdate(onUpdate)
client.onConnect(onConnect)
client.onMessage(onMessage)
client.connect()
def onConnect():
client.subscribeTo("USD/CHF")
client.subscribeTo(["EUR/USD", "BTC/USD"])
def onConnect():
client.unsubscribeFromAll()
def onConnect():
client.unsubscribeFrom("USD/CHF")
client.unsubscribeFrom(["EUR/USD", "BTC/USD"])
Thank you for considering contributing! Any issues, bug fixes, suggestions, improvements or help in any other way is always appreciated. Please feel free to open an issue or create a pull request.
Please contact me at [email protected] if you have any questions or requests.
This library is provided without warranty under the MIT license.