Type/to search
Built-in Functions
Global
Log
Market
exchange.GetTicker
exchange.GetTickers
exchange.GetDepth
exchange.GetTrades
exchange.GetRecords
exchange.GetMarkets
exchange.GetRawJSON
exchange.SetData
exchange.GetData
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Get the raw content returned by the most recent rest request from the current exchange object (exchange, exchanges).

exchange.GetRawJSON()

Examples

Query the account, then read and parse the raw response from the exchange.

javascript
function main(){ exchange.GetAccount() var obj = JSON.parse(exchange.GetRawJSON()) Log(obj) // Output: the raw JSON object returned by the account endpoint; fields vary by exchange }
python
import json def main(): exchange.GetAccount() obj = json.loads(exchange.GetRawJSON()) Log(obj) # Output: the raw JSON object returned by the account endpoint; fields vary by exchange
rust
fn main() { let _ = exchange.GetAccount(); // In Rust GetRawJSON returns a String; parse it with JSONParse if let Some(obj) = JSONParse(&exchange.GetRawJSON()) { Log!(obj); // Output: the raw JSON object returned by the account endpoint; fields vary by exchange } }

Returns

TypeDescription

string

Response data from the rest request (including api calls of exchange.IO); when the request fails (no response received or the exchange returned an error), it is the error message, the same as what GetLastError returns.

See Also

Remarks

The exchange.GetRawJSON() function only supports live trading.