zaifapi class : Ticker(string,string) method

Description

Gets the ticker.

Syntax

zaifapiInstance.Ticker(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.Ticker("1", "btc_jpy");

3:

string jsonStr = zaifresIns.Result;

Example for JSON-text

groupId : "1" currencyPair : "btc_jpy"
{"last": 807500.0, "high": 823990.0, "low": 765000.0, "vwap": 795652.2753, "volume": 10488.7471, "bid": 807500.0, "ask": 808000.0, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}
groupId : "2" currencyPair : "btc_jpy"
{"last": 281285.0, "high": null, "low": null, "vwap": null, "volume": null, "bid": null, "ask": null}

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 ticker of the AirFX will be returned .

If you specify "2" or more for the groupId argument and "btc_jpy" for the currencyPair argument, the ticker 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.