SDKs and examples
Official TypeScript and Python SDKs, runnable examples, MCP client configs, integrations and a Next.js starter — all open source on GitHub.
Everything here is MIT-licensed and public at github.com/FXapis. The SDKs wrap the same REST API these docs describe — nothing is SDK-only — so use one if it suits your stack, or call the API directly from any language with the guides.
Official SDKs
npm install fxapisimport { Fxapis, newIdempotencyKey } from "fxapis";
const fx = new Fxapis(process.env.FXAPIS_API_KEY!);
const order = await fx.postAccountsByIdOrdersMarket(
accountId,
{ symbol: "EURUSD", side: "buy", volume: "0.01" },
{ idempotencyKey: newIdempotencyKey() },
);One typed method per endpoint, generated from the OpenAPI spec. Zero runtime
dependencies, ESM, and typed errors carrying the API's stable code. From
0.1.4, verifyWebhook() checks a webhook delivery's
signature and returns the event.
From 0.2.0, managing API keys is under fx.admin.keys and needs an
admin key. The console-only member and
invitation endpoints are not in the client.
fxapis on npm ·
fxapis-typescript on GitHub ·
a walkthrough on the blog
Runnable examples and starters
Examples
A quickstart, click-to-trade and a trade copier, each in Python, Node/TypeScript and curl — plus curl scripts for multi-account orders and history.
Next.js starter
A small working app: connect an MT5 account, watch its positions, and place a market order behind an explicit confirm step.
MCP client examples
Tested configs for Claude, Claude Code, Cursor, VS Code, the OpenAI API and the Anthropic API.
Integrations
A Postman collection for every endpoint, webhooks included, TradingView alert templates and n8n workflows.
Each has a walkthrough on the blog: the examples,
the Next.js starter,
connecting an AI agent with MCP and
Postman, TradingView and n8n. The MCP
and TradingView guides cover those two in depth. Run every example against a broker demo account: there is no simulated
market, and an fx_test_ key reaches a real broker like any other.
Any other language
The REST API works from anything that can send HTTPS and JSON. The
guides have complete programs in PHP, C#, Go, Java and Ruby, and the
API reference has samples for each endpoint in 13 languages.
To generate your own client, the OpenAPI spec is at
api.fxapis.com/openapi.json.