zaifapi class : LastPrice(string,string) method

Description

Gets the closing price.

Syntax

zaifapiInstance.LastPrice(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.LastPrice("all", "");

3:

string jsonStr = zaifresIns.Result;

Example for JSON-text

groupId : "all" currencyPair : ""
[{"last_price": 807500.0, "group_id": 1}, {"last_price": 281285.0, "group_id": 2}, {"last_price": 480167.0, "group_id": 3}, {"last_price": 1574617.0, "group_id": 4}, {"last_price": 930000.0, "group_id": 5}]
groupId : "active" currencyPair : ""
[{"last_price": 808000.0, "group_id": 1}]
groupId : "1" currencyPair : "btc_jpy"
[{"last_price": 808000.0, "group_id": 1}]

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 "all", "active", or "1" or more.

If you specify "all" for the groupId argument and an empty string for the currencyPair argument, the closing price of all futures trading will be returned. Please note that it also includes futures trading already closed.

If you specify "active" for the groupId argument and an empty string for the currencyPair argument, the closing price of active futures trading will be returned. The active futures trading is only AirFX, so the closing price of the AirFX will be returned.

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

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