A Myfxbook API Alternative: Your Trading Account as JSON, With a Key and No Session
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 API | Myfxbook API | |
|---|---|---|
| Signing in | A Developer API Key sent in a header. No key at all for a published account | A login method that takes the email and the password of your account and returns a session |
| Session | None. A key works until you revoke it | Valid only from the IP address of the login, for one month |
| Whose accounts | Yours, private ones included, and any account its owner has published | Yours and the ones you watch: "The API allows access to personal information only" |
| Closed trades | The whole history, in pages of 20 | "History is limited to the last 50 transactions" |
| Daily series | Growth, balance, equity and drawdown per day, in one section | Daily gain and daily data, between two dates |
| Monthly returns, results per symbol and per magic number, risk metrics | Sections on request, in the same answer | No method for them in the list |
| Times | UTC, in ISO 8601 | The time zone of the broker |
| Formats | JSON | XML and JSON |
| Community sentiment | No | Yes, up to 100 requests per 24 hours on the free version |
| For AI assistants | An MCP server with the same data | Not mentioned on the API page |
| Request limits | 30 per minute with a free key, 120 on the Pro and Ultra plans, 20 per IP address without a key | Stated for community sentiment only |
| Price | Free | Free |
| What it asks | On the free plan, the line "Data from ShowMyTrades" with a link, next to the data | Its 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_moreis 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 method | On ShowMyTrades |
|---|---|
login, logout | Not needed: the key goes in the Authorization header |
get-my-accounts | GET /api/v1/accounts |
get-watched-accounts | GET /api/v1/accounts/{slug} for any published account, or GET /api/v1/search/accounts |
get-open-trades | GET /api/v1/accounts/{slug}/positions?type=open |
get-open-orders | GET /api/v1/accounts/{slug}/positions?type=pending |
get-history | GET /api/v1/accounts/{slug}/trades, every page |
get-daily-gain, get-data-daily | GET /api/v1/accounts/{slug}?include=equity_curve |
get-gain | The daily twr_percent series of equity_curve, read at the two dates |
get-custom-widget | The widgets and self-updating images, or your own chart |
get-community-outlook | No equivalent |
The fields you already use have a close relative:
| In Myfxbook's answer | Here |
|---|---|
gain | performance.twr_percent |
absGain | performance.absolute_gain_percent |
drawdown | performance.max_drawdown_percent |
balance, equity, deposits, withdrawals | balance, equity, performance.deposits, performance.withdrawals |
demo | demo |
profit of a transaction | profit, 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.
🔗 Related Guides
- MT4 and MT5 account data as JSON: every endpoint and field, with code
- A self-updating trading chart on your website: the complete example, server and page
- A Myfxbook widget alternative: the same comparison for widgets
- ShowMyTrades as a Myfxbook alternative: the two services compared
- Your trading results in Google Sheets: the API from a spreadsheet
Connect your account free and try one request. Your Myfxbook page stays where it is.
Your Trading Results in Google Sheets, Updated Automatically
Get the balance, growth, drawdown, daily curve and monthly returns of your MT4, MT5, cTrader or TradeLocker account into Google Sheets with a short script and a free API. No CSV exports: the sheet refreshes on a timer.
A Practical Guide to Tracking Your Trading Performance 2026
Most traders have no idea if they are actually good. The metrics that matter, how to read them, and what real accounts show about each one.