Quick answer
FOREX.com (StoneX) exposes the GAIN Capital REST trading API used by FOREX.com and City Index: log in with username, password and an app key to get a session, then trade forex and CFDs, read prices and stream through Lightstreamer. It is one of the few NFA-regulated FX brokers in the US with an API, and demo accounts work the same way.
FOREX.com API at a glance
- Pricing
- API free with an account
- Availability
- US (NFA-regulated), UK, EU, Canada, Australia, Japan
- Paper trading
- Demo account
- Integration type
- REST + API key
- In AlgoGP
- Design and backtest in AlgoGP, connect the exported code
- Auth
- Username + password + app key → session token
- Streaming
- Lightstreamer price feed
- US
- Available (NFA/CFTC regulated)
- Sister brand
- City Index (UK/EU/AU)
Build a FOREX.com strategy with AlgoGP
AlgoGP does not connect to FOREX.com natively yet. FOREX.com uses plain HTTPS with an API key, so it is a good candidate for a native adapter; it is not built in yet.
- 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
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in FOREX.com
Implement the four adapter methods (
account,positions,submit_market_orderand a candle fetcher) with FOREX.com’s SDK, or keep a built-in platform for paper trading and add FOREX.com when you go live.
Built-in brokers for the same markets: OANDA, Interactive Brokers.
FOREX.com API: frequently asked questions
Can I trade FOREX.com through an API in the US?
Yes; FOREX.com US accounts can use the API.
How do I get a FOREX.com app key?
Request API access from FOREX.com support for your account.
Design and backtest your FOREX.com strategy first
AlgoGP turns an idea into Python and tests it on years of history before you connect it to FOREX.com. 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 FOREX.com
Free plan, no card required.
FOREX.com alternatives
- OANDA API Built into AlgoGPRegulated forex and CFD broker whose v20 REST API serves both orders and candles, with a free demo account.
- IG API GuideRegulated CFD, spread-betting and FX broker with a REST trading API, Lightstreamer streaming and a demo account.
- FXCM API GuideForex and CFD broker with a REST/socket.io API, a Python wrapper (fxcmpy) and ForexConnect, authenticated with a persistent token.
- Interactive Brokers API Built into AlgoGPThe broadest multi-asset broker API: stocks, options, futures, FX and bonds on 150+ markets, through TWS or IB Gateway.
Independent guide. AlgoGP is not affiliated with FOREX.com. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.