- API
- General
- XML
- JSON
Want to create an iPhone/Android application, or a Facebook widget? Now you can with the Myfxbook API.
The API allows you to access your account's data programmatically and create your own customized applications.
Well designed and properly working applications will be featured in our application area (coming soon).
The API allows you to access your account's data programmatically and create your own customized applications.
Important notes and tips
- A session is non-expiring. In order to expire a session, use the logout method.
- Use "debug=1" in json type for easier development (plain and formatted text).
- Use a secure connection (HTTPS) for maximal security.
- In case of an error, check the "message" field for the reason.
- Transaction timestamps (open orders/trades, history, data points for daily gain/balance) are in local broker's time zone.
- All response fields are self explanatory; id is the entity's id, accountId is the account's number.
- Sizing type can be lots or units (Oanda accounts).
- The API allows access to personal information only.
Methods
The API consists of the following methods:
Method | Description | Comments |
---|---|---|
login | Login to your account | Creates a new session |
logout | Logout from your account | Invalidates the current session |
get-my-accounts | Get a list of my accounts and their data | |
get-watched-accounts | Get a list of my watched accounts | |
get-open-trades | Get open trades for an account | |
get-open-orders | Get open orders for an account | |
get-history | Get history for an account | History is limited to the last 50 transactions |
get-daily-gain | Get daily gain values | Use to create a growth chart |
get-gain | Get gain value between dates | |
get-custom-widget | Get a custom widget | Use to create a custom widget of the balance or growth chart of the account |
get-community-outlook | Get the community outlook data | |
get-community-outlook-by-country | Get the community outlook by country data | Must provide symbol name |
get-data-daily | Get daily data | Use to create a growth, balance, equity, pips, or profit chart |
Error handling
There are several possible error types:
- Required fields missing.
- Wrong email/password.
- Invalid session.
- Invalid account.
Software guide lines
Since we strive at Myfxbook to keep our service free of any charge, any software you develop should be free.Well designed and properly working applications will be featured in our application area (coming soon).
Support
Please use the programming section to post any questions regarding the API.
Terms Of Use
By using the Myfxbook API, you agree to the Terms of Use.
API version
Current version of the API is v1.37 (April 10, 2012) - Please check back once in a while for changes and updates.
10/04/12 - get-daily-balance method deprecated, added pips to get-my-accounts, added get-data-daily. Version changed to 1.37
11/27/11 - added profit factor to get-my-accounts method. Version changed to 1.36
09/21/11 - added currency to get-my-accounts method. Version changed to 1.35
08/23/11 - added get-gain. Version changed to 1.34
08/07/11 - added profit to Daily Gain . Version changed to 1.33
06/23/11 - added invitationUrl . Version changed to 1.32
05/18/11 - added comment to open orders method and to open trades method. Version changed to 1.31
03/27/11 - added commission to get-my-accounts method. Added interest and commission to get-history method. Version changed to v1.3
11/14/10 - added avgLongPrice/avgShortPrice to get-community-outlook method. Version changed to v1.2
11/01/10 - get-community-outlook and get get-community-outlook-by-country added. Version changed to v1.1
10/03/10 - firstTradeDate added. Version changed to v1.03
06/27/10 - get-custom-widget added. Version changed to v1.02
05/23/10 - get-watched-accounts added. Version Changed to v1.01
04/11/10 - gmtOffset field deprecated.
11/27/11 - added profit factor to get-my-accounts method. Version changed to 1.36
09/21/11 - added currency to get-my-accounts method. Version changed to 1.35
08/23/11 - added get-gain. Version changed to 1.34
08/07/11 - added profit to Daily Gain . Version changed to 1.33
06/23/11 - added invitationUrl . Version changed to 1.32
05/18/11 - added comment to open orders method and to open trades method. Version changed to 1.31
03/27/11 - added commission to get-my-accounts method. Added interest and commission to get-history method. Version changed to v1.3
11/14/10 - added avgLongPrice/avgShortPrice to get-community-outlook method. Version changed to v1.2
11/01/10 - get-community-outlook and get get-community-outlook-by-country added. Version changed to v1.1
10/03/10 - firstTradeDate added. Version changed to v1.03
06/27/10 - get-custom-widget added. Version changed to v1.02
05/23/10 - get-watched-accounts added. Version Changed to v1.01
04/11/10 - gmtOffset field deprecated.