Docs

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 fxapis
import { 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

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.

On this page