Broker API request builder
Choose an API and one of its documented endpoints, and get the request written out as curl, Python and JavaScript, with every credential read from an environment variable.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
For a broker, this page writes text and sends nothing. The only request it can send is to this site's own practice API, which is invented data and not any broker's API, and only when you press Send. It has no field for a key, a username, a password or any other credential. Never type one into a web page, this one included.
Build a request
curl
Python
JavaScript
Send makes one GET request from your browser to a fixed file on this site and prints what comes back. The data is invented. Nothing you have typed is sent, because there is nothing to type.
Written from the method, path and parameters in the endpoint's record, against the demo host where the record holds one. Not executed against any account. Read the endpoint's page and the provider's own reference before you run it.
Endpoint pages, API by API
The builder covers 359 documented endpoints across 12 APIs. Each has a page of its own with its parameters, a mock response and its source.
The builder writes HTTP requests only. The 215 functions and messages recorded here for interfaces that are not HTTP have no method and no path, so the builder does not list them. They are listed by task, each with a page of its own.
- Capital.com API endpoints, 36 documented
- Deriv API endpoints, 5 documented
- eToro API endpoints, 51 documented
- IG API endpoints, 49 documented
- Interactive Brokers API endpoints, 23 documented
- OANDA API endpoints, 33 documented
- Saxo API endpoints, 68 documented
- Trading 212 API endpoints, 16 documented
- DXtrade API endpoints, 21 documented
- Match-Trader API endpoints, 17 documented
- MetaApi API endpoints, 17 documented
- TradeLocker API endpoints, 23 documented
What it does, and what it cannot tell you
It takes the method, the path, the required headers and the required parameters from the endpoint's record and arranges them as a request in three languages. A header or a body field that carries a credential is written as an environment variable, which you set on your own machine and which never appears on this site.
Values it cannot know are left as placeholders: a path part in braces, three dots for text and a zero for a number. A snippet will not work until you replace them. Optional headers and parameters are named in a comment and left out.
The practice API is the one exception to nothing being sent. Choose it as the API and a Send button appears, because its addresses are fixed files on this site that need no key and hold only invented data. A broker request is never sent from this page: you run it yourself, on your own machine, against a demo account.
It cannot tell you whether a request will succeed, what your account is permitted to do, or how to sign in first where an API needs a session. No snippet here was run against a live or a demo account. Some of these endpoints place or change orders: try them on a demo account only, and read the endpoint's page first.