zaifapi class : Trades(string,string) method

Description

Gets the trade history of all users.

Syntax

zaifapiInstance.Trades(string groupId, string currencyPair)

Arguments

ClassNameDescription
stringgroupIdA group identifier.
stringcurrencyPairA currency pair.

Return value

ClassDescription
zaifresA response to the request which have a JSON-text.

Sample code

1:

zaifapi zaifapiIns = new zaifapi();

2:

zaifres zaifresIns = zaifapiIns.Trades("1", "btc_jpy");

3:

string jsonStr = zaifresIns.Result;

Example for JSON-text

groupId : "1" currencyPair : "btc_jpy"
[{"date": 1558215159, "price": 803800.0, "amount": 0.2986, "tid": 8491108, "currency_pair": "btc_jpy", "trade_type": "bid"}, {"date": 1558215159, "price": ...
groupId : "2" currencyPair : "btc_jpy"
[{"date": 1499825134, "price": 281285.0, "amount": 0.0001, "tid": 151413, "currency_pair": "btc_jpy", "trade_type": "bid"}, {"date": 1498834917, "price": ...

Notes

It is a public API for the futures transaction. You can get the information without setting the API key and the secret key.

The groupId argument must be specified "1" or more. "all" and "active" can not be specified.

If you specify "1" for the groupId argument and "btc_jpy" for the currencyPair argument, the trade history of the AirFX will be returned .

If you specify "2" or more for the groupId argument and "btc_jpy" for the currencyPair argument, the trade history will be returned if there is an applicable futures transaction.

An instance of the zaifres class is returned as the response to the request. This instance holds the JSON-text of the result of the response.

If an API error occurs, the following JSON-text will be returned.

{"error": "..."}

"error" is different for each API error.

If an HTTP error occurs, the following JSON-text will be returned.

{"success": -1000,"error": { "statuscode" : 404, "message": "Not Found"}}

"statuscode" and "message" are different for each HTTP error.

If the request times out, the following JSON-text will be returned.

{"success": -1001,"error": { "typename" : "TaskCanceledException", "message": "A task was canceled."}}

If the request fails due to other exceptions, the following JSON-text will be returned.

{"success": -1002,"error": { "typename" : "...", "message": "..."}}

"typename" and "message" are different for each exception.

Links for reference

Copyright © Cooker All rights reserved.