Want to create an iPhone/Android application, or a Facebook widget? Now you can do it with the Myfxbook API. The API allows you to access your account's data programmatically and create your own customized applications.
- 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.
The API consists of the following methods:
Methods | 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 sentiment data. | Free version up to 100 requests per 24 hours. Paid version up to 2880 requests per 24 hours. |
get-community-outlook-by-country | Get the community sentiment by country data. | Must provide symbol name. |
get-data-daily | Get daily data. | Use to create a growth, balance, equity, pips, or profit chart. |
- Required fields missing
- Wrong email/password
- Invalid session
- Invalid account
07/19/20 - get-community-outlook has now two versions - in the free version it is limited to 100 requests per 24 hours while the paid version limit is increased to 2800 requests per 24 hours.
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.
Parameter | Description |
---|---|
User email | |
password | User password |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
start | Start date, format: yyyy-mm-dd |
end | End date, format: yyyy-mm-dd |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
start | Start date, format: yyyy-mm-dd |
end | End date, format: yyyy-mm-dd |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
width | Widget width |
height | Widget height |
bgcolor | Background color |
chartbgc | Chart background color |
gridcolor | Grid color |
linecolor | Line color |
barcolor | Bar color |
fontcolor | Font color |
bart | Bar title |
linet | Line title |
charttitle | Chart title |
titles | Title font size |
Parameter | Description |
---|---|
session | Session ID |
*Currency values are represented in USD ($).
Parameter | Description |
---|---|
session | Session ID |
symbol | Symbol name |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
start | Start date, format: yyyy-mm-dd |
end | End date, format: yyyy-mm-dd |
Parameter | Description |
---|---|
User email | |
password | User password |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
start | Start date, format: yyyy-mm-dd |
end | End date, format: yyyy-mm-dd |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
start | Start date, format: yyyy-mm-dd |
End | End date, format: yyyy-mm-dd |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
width | Widget width |
height | Widget height |
bgcolor | Background color |
chartbgc | Chart background color |
gridcolor | Grid color |
linecolor | Line color |
barcolor | Bar color |
fontcolor | Font color |
bart | Bar title |
linet | Line title |
charttitle | Chart title |
titles | Title font size |
Parameter | Description |
---|---|
session | Session ID |
Parameter | Description |
---|---|
session | Session ID |
symbol | Symbol name |
Parameter | Description |
---|---|
session | Session ID |
id | Account ID |
start | Start date, format: yyyy-mm-dd |
end | End date, format: yyyy-mm-dd |