Response Format
Tradier supports a couple of different response formats. The way you should request a specific format is by using the standard HTTP header Accept.
XML
This is the default format of the API due to its ubiquity in the financial space. You can omit or use the following Accept header to get XML:
'Accept: application/xml'
Note: XML format will be removed in future versions of all Tradier APIs.
JSON
JSON format is lightweight and readable. It is recommended you use this format for your requests. You should use the following Accept header to get JSON:
'Accept: application/json'
JSON format is supported through XML to JSON translation. Due to this conversion, there is a known issue where responses can change depending on the data, specifically for arrays. In these cases, a list may present as an object or as an array, depending on the value. This will be fixed in future versions of the API.
Compression
All APIs support GZip compression if sending the appropriate headers. For example:
Accept-Encoding: gzip
Updated 3 months ago