Python Package: fxcmpy

FXCM offers a modern REST API with algorithmic trading as its major use case. fxcmpy is a Python package that exposes all capabilities of the REST API via different Python classes. The classes allow for a convenient, Pythonic way of interacting with the REST API on a high level without needing to take care of the lower-level technical aspects. Traders, data scientists, quants and coders looking for forex and CFD python wrappers can now use fxcmpy in their algo trading strategies.

Getting Started

Create your API Token by logging into our HTML5 Trading Station Web platform.

Need credentials? Sign up for a FREE practice account now.

Create your token by going to the upper right hand area of the platform and select 'Token Management'.

Token Management
Token Management 2
FXCM - Python REST API login

Installation of the fxcm Python package is easy and straight forward with pip:

pip install fxcmpy

Connect to the server using your API token and get started:

import fxcmpy TOKEN = YOUR_FXCM_TOKEN
con = fxcmpy.fxcmpy(access_token = TOKEN, log_level = 'error')
instruments = con.get_instruments()
print(instruments[:5]) ['EUR/USD', 'USD/JPY', 'GBP/USD', 'USD/CHF', 'EUR/CHF']

Need credentials? Sign up for a FREE practice account now.

If you have questions, check out our Github or get in touch via


${} / ${getInstrumentData.ticker} /

Exchange: ${}

${} ${getInstrumentData.divCcy} ${getInstrumentData.priceChange} (${getInstrumentData.percentChange}%) ${getInstrumentData.priceChange} (${getInstrumentData.percentChange}%)

${getInstrumentData.oneYearLow} 52/wk Range ${getInstrumentData.oneYearHigh}