Product·

A Myfxbook API Alternative: Your Trading Account as JSON, With a Key and No Session

Looking for an alternative to the Myfxbook API? A free REST API for MT4, MT5, cTrader and TradeLocker accounts: a read-only key in a header, the whole trade history, statistics already computed. The two APIs compared method by method.

Myfxbook has an API, and many scripts, dashboards and small apps were built on it. If you are here, you are probably writing one of those and looking for something that API does not give you.

This page is about the API only: how the two work, where they differ, and how to move a script from one to the other. For the wider comparison between the two services, see ShowMyTrades as a Myfxbook alternative. For the widgets, see a Myfxbook widget alternative.

A fair note first: the Myfxbook API is free, it has been there for years, and it carries data we do not have, such as the sentiment of its community. You do not have to leave it to use ours. Both services connect to a trading account read-only, so the same account can be on both.

🧾 The Two APIs, Side by Side

The right-hand column comes from the Myfxbook API page, version 1.38 (October 19, 2025), as we read it on November 30, 2026. APIs change: check theirs before you decide.

ShowMyTrades APIMyfxbook API
Signing inA Developer API Key sent in a header. No key at all for a published accountA login method that takes the email and the password of your account and returns a session
SessionNone. A key works until you revoke itValid only from the IP address of the login, for one month
Whose accountsYours, private ones included, and any account its owner has publishedYours and the ones you watch: "The API allows access to personal information only"
Closed tradesThe whole history, in pages of 20"History is limited to the last 50 transactions"
Daily seriesGrowth, balance, equity and drawdown per day, in one sectionDaily gain and daily data, between two dates
Monthly returns, results per symbol and per magic number, risk metricsSections on request, in the same answerNo method for them in the list
TimesUTC, in ISO 8601The time zone of the broker
FormatsJSONXML and JSON
Community sentimentNoYes, up to 100 requests per 24 hours on the free version
For AI assistantsAn MCP server with the same dataNot mentioned on the API page
Request limits30 per minute with a free key, 120 on the Pro and Ultra plans, 20 per IP address without a keyStated for community sentiment only
PriceFreeFree
What it asksOn the free plan, the line "Data from ShowMyTrades" with a link, next to the dataIts terms of use, and "any software you develop should be free"

🎯 Where the Difference Shows

Four situations, taken from what people usually build.

  • Your code runs where the address changes. Cloud functions and many hosting platforms do not send every request from the same IP address. A session tied to the address of the login may have to be opened again. A key in a header does not depend on where the request comes from.
  • You would rather not keep a password in a script. A script for the Myfxbook API holds the email and the password of the account. A script for ours holds a Developer API Key: it can only read, and you revoke it on its own, without touching your login.
  • You need the trades, not the last few. A report, a tax summary or a statistic of your own needs the complete list. Here you page through it until has_more is false.
  • You show someone else's published account. With a published account you need neither a key nor to have it in a list: you pass its slug to the same endpoint.

And one where the Myfxbook API is the right tool: if what you want is the sentiment of the Myfxbook community, only that API has it.

📡 The Same Job, in One Request

A published account, with its daily curve and its monthly returns:

curl "https://showmytrades.com/api/v1/accounts/YOUR-ACCOUNT-SLUG?include=equity_curve,monthly"

A private account, or the list of all your accounts:

curl "https://showmytrades.com/api/v1/accounts" \
  -H "Authorization: Bearer smt_live_YOUR_KEY"

There is no login call before it and no logout after it. The key is created once, under Settings in the dashboard, and it starts with smt_live_. Every endpoint and field, with examples in cURL, Python and Node.js, is in MT4 and MT5 account data as JSON.

🔁 Moving a Script Over

Myfxbook methodOn ShowMyTrades
login, logoutNot needed: the key goes in the Authorization header
get-my-accountsGET /api/v1/accounts
get-watched-accountsGET /api/v1/accounts/{slug} for any published account, or GET /api/v1/search/accounts
get-open-tradesGET /api/v1/accounts/{slug}/positions?type=open
get-open-ordersGET /api/v1/accounts/{slug}/positions?type=pending
get-historyGET /api/v1/accounts/{slug}/trades, every page
get-daily-gain, get-data-dailyGET /api/v1/accounts/{slug}?include=equity_curve
get-gainThe daily twr_percent series of equity_curve, read at the two dates
get-custom-widgetThe widgets and self-updating images, or your own chart
get-community-outlookNo equivalent

The fields you already use have a close relative:

In Myfxbook's answerHere
gainperformance.twr_percent
absGainperformance.absolute_gain_percent
drawdownperformance.max_drawdown_percent
balance, equity, deposits, withdrawalsbalance, equity, performance.deposits, performance.withdrawals
demodemo
profit of a transactionprofit, plus net_profit with commission and swap already included

Three things change in your code besides the names. Times are in UTC, not in the broker's time zone. Dates are written 2026-11-30, in ISO 8601. And lists come in pages, with a pagination object that tells you when to stop.

You are not migrating an account. You are adding a second read-only connection to it: connect it here, wait for the history to import, and point the script at the new address. The connection on the Myfxbook side stays as it is.

🔍 Will the Numbers Match?

Mostly, and where they differ there is a reason. Growth here is a time-weighted return, drawdown depends on whether floating losses are counted and how often equity is sampled, and a time zone can move a trade from one day to the next. The details are in the widget comparison. A script that compares the two should expect the same story, not necessarily the same second decimal.

🤝 What the API Asks in Return

It is free. On the free plan, wherever you show the data, one visible line goes next to it: Data from ShowMyTrades, with a link. Every answer carries the text and the address in its attribution field. On the Pro and Ultra plans the line is optional.

❓ FAQ

Can I use both APIs at the same time? Yes. The two services read the account independently and read-only. Nothing changes on the Myfxbook side when you connect an account here.

Do I have to put my password in my code? No. You create a Developer API Key in the dashboard and send that. It can only read, and you can revoke it at any moment without changing your login.

Does it return the whole trade history? Yes. Closed trades come in pages of 20, and you go on until has_more is false. Open positions and pending orders have their own endpoint.

Is there community sentiment, as in Myfxbook's community outlook? No. That data describes the Myfxbook community, and it comes from their API.

Does it work with cTrader and TradeLocker? Yes. Accounts on MT4, MT5, cTrader and TradeLocker return the same format.

What does it cost? Nothing. On the free plan the line "Data from ShowMyTrades", with a link, goes next to the data. The paid plans raise the limits and make the line optional.


Connect your account free and try one request. Your Myfxbook page stays where it is.