Home Notices Documents Classes Download Others Rice
Classes  >  zaifapi  >  SwapHistory(string,string,string)
zaifapi class : SwapHistory(string,string,string) method

Description

Gets swap point history.

Syntax

zaifapiInstance.SwapHistory(string groupId, string currencyPair, string page)

Arguments

ClassNameDescription
stringgroupIdA group identifier.
stringcurrencyPairA currency pair.
stringpageA page number.

Return value

ClassDescription
stringA JSON-text.

Sample code

1:

zaifapi zaifapiIns = new zaifapi();

2:

string jsonStr = zaifapiIns.SwapHistory("1", "btc_jpy", "");

Example for JSON-text

groupId : "1" currencyPair : "btc_jpy" page : "1"
[{"timestamp": 1558213200, "swap_rate_bid": -0.36757897, "swap_rate_ask": 0.36757897}, {"timestamp": 1558206000, "swap_rate_bid": -0.22539726, "swap_rate_ask": 0.22539726}, {"timestamp": 1558198800, "swap_rate_bid": -0.2774411, "swap_rate_ask": 0.2774411}, {"timestamp": 1558191600, "swap_rate_bid": 0.03443902, "swap_rate_ask": -0.03443902}, {"timestamp": 1558184400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1558177200, "swap_rate_bid": -0.11678152, "swap_rate_ask": 0.11678152}, {"timestamp": 1558170000, "swap_rate_bid": -0.11166682, "swap_rate_ask": 0.11166682}, {"timestamp": 1558162800, "swap_rate_bid": 0.02827941, "swap_rate_ask": -0.02827941}, {"timestamp": 1558155600, "swap_rate_bid": -0.36449307, "swap_rate_ask": 0.36449307}, {"timestamp": 1558148400, "swap_rate_bid": -0.15303854, "swap_rate_ask": 0.15303854}, {"timestamp": 1558141200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1558134000, "swap_rate_bid": -0.0328427, "swap_rate_ask": 0.0328427}, {"timestamp": 1558126800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1558119600, "swap_rate_bid": -0.375, "swap_rate_ask": 0.375}, {"timestamp": 1558112400, "swap_rate_bid": -0.24189983, "swap_rate_ask": 0.24189983}, {"timestamp": 1558105200, "swap_rate_bid": 0.16732218, "swap_rate_ask": -0.16732218}, {"timestamp": 1558098000, "swap_rate_bid": -0.375, "swap_rate_ask": 0.375}, {"timestamp": 1558090800, "swap_rate_bid": -0.21627629, "swap_rate_ask": 0.21627629}, {"timestamp": 1558083600, "swap_rate_bid": -0.20980547, "swap_rate_ask": 0.20980547}, {"timestamp": 1558076400, "swap_rate_bid": -0.08380595, "swap_rate_ask": 0.08380595}, {"timestamp": 1558069200, "swap_rate_bid": 0.375, "swap_rate_ask": -0.375}, {"timestamp": 1558062000, "swap_rate_bid": 0.375, "swap_rate_ask": -0.375}, {"timestamp": 1558054800, "swap_rate_bid": -0.22519664, "swap_rate_ask": 0.22519664}, {"timestamp": 1558047600, "swap_rate_bid": 0.01957902, "swap_rate_ask": -0.01957902}]
groupId : "1" currencyPair : "btc_jpy" page : ""
[{"timestamp": 1558213200, "swap_rate_bid": -0.36757897, "swap_rate_ask": 0.36757897}, {"timestamp": 1558206000, "swap_rate_bid": -0.22539726, "swap_rate_ask": 0.22539726}, {"timestamp": 1558198800, "swap_rate_bid": -0.2774411, "swap_rate_ask": 0.2774411}, {"timestamp": 1558191600, "swap_rate_bid": 0.03443902, "swap_rate_ask": -0.03443902}, {"timestamp": 1558184400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1558177200, "swap_rate_bid": -0.11678152, "swap_rate_ask": 0.11678152}, {"timestamp": 1558170000, "swap_rate_bid": -0.11166682, "swap_rate_ask": 0.11166682}, {"timestamp": 1558162800, "swap_rate_bid": 0.02827941, "swap_rate_ask": -0.02827941}, {"timestamp": 1558155600, "swap_rate_bid": -0.36449307, "swap_rate_ask": 0.36449307}, {"timestamp": 1558148400, "swap_rate_bid": -0.15303854, "swap_rate_ask": 0.15303854}, {"timestamp": 1558141200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1558134000, "swap_rate_bid": -0.0328427, "swap_rate_ask": 0.0328427}, {"timestamp": 1558126800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1558119600, "swap_rate_bid": -0.375, "swap_rate_ask": 0.375}, {"timestamp": 1558112400, "swap_rate_bid": -0.24189983, "swap_rate_ask": 0.24189983}, {"timestamp": 1558105200, "swap_rate_bid": 0.16732218, "swap_rate_ask": -0.16732218}, {"timestamp": 1558098000, "swap_rate_bid": -0.375, "swap_rate_ask": 0.375}, {"timestamp": 1558090800, "swap_rate_bid": -0.21627629, "swap_rate_ask": 0.21627629}, {"timestamp": 1558083600, "swap_rate_bid": -0.20980547, "swap_rate_ask": 0.20980547}, {"timestamp": 1558076400, "swap_rate_bid": -0.08380595, "swap_rate_ask": 0.08380595}, {"timestamp": 1558069200, "swap_rate_bid": 0.375, "swap_rate_ask": -0.375}, {"timestamp": 1558062000, "swap_rate_bid": 0.375, "swap_rate_ask": -0.375}, {"timestamp": 1558054800, "swap_rate_bid": -0.22519664, "swap_rate_ask": 0.22519664}, {"timestamp": 1558047600, "swap_rate_bid": 0.01957902, "swap_rate_ask": -0.01957902}]
groupId : "2" currencyPair : "btc_jpy" page : "1"
[{"timestamp": 1498834800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498748400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498662000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498575600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498489200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498402800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498316400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498230000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498143600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498057200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497970800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497884400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497798000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497711600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497625200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497538800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497452400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497366000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497279600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497193200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497106800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497020400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1496934000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1496847600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}]
groupId : "2" currencyPair : "btc_jpy" page : ""
[{"timestamp": 1498834800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498748400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498662000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498575600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498489200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498402800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498316400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498230000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498143600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1498057200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497970800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497884400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497798000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497711600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497625200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497538800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497452400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497366000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497279600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497193200, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497106800, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1497020400, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1496934000, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}, {"timestamp": 1496847600, "swap_rate_bid": 0.0, "swap_rate_ask": 0.0}]

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 swap point 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 swap point history will be returned if there is an applicable futures transaction.

The page argument must be specified an empty string or a string from "1" to "100". The smaller the number, the new history will be returned. An empty string always returns the latest history.

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 © Rice All rights reserved.