StoneX API Basics
Authentication
Every request sent to the API must carry two pieces of authentication information:
- UserName
- Session token
This can be provided either in the headers of the request:
Request Method: GET
Request Headers:
Session:A-SESSION-TOKEN
UserName:A-USERNAME
Request URL: /news/?Category=UK
OBSOLETE It will be not supported from 1st March 2024 onwards.
or in the query string (for clients that don't support headers):
Request Method:GET
Request URL:/news/?Category=UK&UserName=A-USERNAME&Session=A-SESSION-TOKEN
Obtaining a Session Token
A Session token is created by submitting your account credentials (UserName and Password) together with API Key to the LogOn v2 service method. This session token is guaranteed to be valid for at least 20 minutes, and should be used for all StoneX API requests until the user closes the Trading UI application.
The UI application must be able to handle the Session token expiring, indicated by the return of a 401 HTTP status code. When a Session token expires, this means the user account is no longer logged in. One way to handle this is informing the user that they are no longer logged in (due to an expired Session token), and prompting the user to create a new Session token by re-entering their UserName and Password.
You can manually delete a Session token, or leave it to be automatically deleted.
Note: subscribing to the real-time data streams also requires this authentication information.
Standards
Datetime as UTC
All dates and times are always expressed as UTC and encoded in JSON as "/Date((1289231327280)/" where the numeric portion represents a JavaScript date in milliseconds since 1970-01-01.
API Server Side Logging
Client UI application developers are not currently able to access the server side logs generated by the API.
Client Side Caching
The front-end UI application should have NO caching on the client side. Currently, all StoneX API service requests return headers with:
Cache-Control:private
There is one exception to this rule, the messages lookup method. A 1 hour client cache time is suggested with the client libraries performing the appropriate caching.
StoneX API Supported Order Types
The StoneX API supports all the order types currently available on the StoneX trading system. These are:
- Buy/Sell Market Orders
-
Attached Stop Loss Orders
-
Attached Take Profit Orders
-
If/Done Contingent Orders
See the "Glossary" for definitions of these order types.
Throttling or Rate Limiting
The StoneX API servers have been set to throttle requests from the client UI application, if more than 500 requests are sent over a 5 second window. When throttling is activated, a 429 HTTP status code is returned. In this case, the client UI application must wait 1 second before sending further API requests.
Two common cases that can trigger the throttling threshold are:
- requesting market information
- requesting price history
Market Information Requests
When requesting market information, the
Price History Requests
Client UI applications should not calculate higher time frame prices from lower time frame data. For example, requesting 60x 1-minute price data and then calculating a 1-hour data point. Instead, the client UI should request the 1-hour price history data from the server directly.
Last updated: 07 November 2025
|
Copyright © 2026 StoneX