Guide
BrokerMarket dataForexCFDsIndices API key

FXCM API guide

FXCM was among the first retail FX brokers to publish an API, and its Python tooling is still widely used in courses and books.

Last verified · Also known as FXCM REST API, fxcmpy, ForexConnect

Quick answer

FXCM offers a REST API over a socket.io connection (wrapped by the fxcmpy Python package), the ForexConnect SDK and FIX. You authenticate with a persistent token generated in Trading Station Web, and a free demo account uses the same API. FXCM does not accept US residents.

FXCM API at a glance

Pricing
API free with an account
Availability
UK, EU, Australia and international; not US residents
Paper trading
Free demo account
Integration type
Local gateway
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Auth
Persistent token from Trading Station Web
APIs
REST over socket.io, ForexConnect, FIX
Python
fxcmpy (REST), ForexConnect bindings
Demo
Free demo with API access

Build a FXCM strategy with AlgoGP

AlgoGP does not connect to FXCM natively yet. FXCM connects through a local gateway, socket, FIX or Protobuf stack rather than plain HTTPS, so it runs as a separate process next to your strategy.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in FXCM

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with FXCM’s SDK, or keep a built-in platform for paper trading and add FXCM when you go live.

Built-in brokers for the same markets: OANDA, Interactive Brokers.

FXCM API: frequently asked questions

Can US residents use the FXCM API?

No, FXCM does not onboard US clients.

Why does FXCM need socket.io?

The REST API is served over an authenticated socket.io session; libraries such as fxcmpy manage it.

Design and backtest your FXCM strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to FXCM. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to FXCM

Free plan, no card required.

FXCM alternatives

Independent guide. AlgoGP is not affiliated with FXCM. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy