ABCDEFGHIJKLMNOPQRST
1
2
3
BTC-e API for Google spreadsheet
4
5
First copy this spreadsheet. This will give you full (write) access to the spreadsheet and the JavaScript:
6
File -> Make a Copy… -> Enter a new document name
7
8
ABOUT
9
Implements the API of the crypto currency exchange BTC-e. Via this API it is possible to retrieve all kind of trade data into a Google spreadsheet. It is also possible to give trade orders. The implementation is made in Google JavaScript and provides UDFs (User Defined Functions) that can be used from Google spreadsheets.
10
11
Info about the public BTC-e API: http://bitcoin.stackexchange.com/questions/11965/btc-e-price-quotes-throught-api
12
Info about the account specific BTC-e API:https://btc-e.com/api/documentation
13
https://support.btc-e.com/index.php?/Knowledgebase/List/Index/4/api
14
15
email:ronald@vanimmerzeel.net
16
BTC address (donations are appreciated):1LfTwDXXaUvaCL63FRrXRsjnWcfBqFur4S
17
18
CONTENT
19
The JavaScript implementation can be found in:Tools -> Script editor... -> btceApi.gs
20

Implemented User Defined Functions (UDFs):
1) btceGetTrades(tradePair, nrOfTrades)
2) btceGetDepth(tradePair, nrOfOrders)
3) btceGetTicker(tradePair)
4) btceGetFee(tradePair)
5) btceGetInfo(keyPair)
6) btceGetActiveOrders(keyPair, tradePair, reverseSort)
7) btceGetTransHistory(keyPair, count, dateStart, dateEnd, reverseSort)
8) btceGetTradeHistory(keyPair, tradePair, count, dateStart, dateEnd, reverseSort)
9) btceTrade(keyPair, nonce, tradePair, type, rate, amount)
10) btceCancelOrder(keyPair, orderId)

The provided sheets contain examples of the implemented functions.
21
22
KNOWN ISSUES
23
1) The yellow message box "Working ..." stays on the screen
The more date you retrieve, the bigger the chance that this will happen. Everything still seems to work and it looks that this message can safely be ignored.

2) "Frozen" blank sheet
This sometimes happens during a refresh/update of a sheet. The sheet becomes completely blank and the spreadsheet no longer responds. In a browser environment you can reload the page. From Google Drive you need to close and reopen this spreadsheet.

3) Buttons not supported on all devices
Google drive on certain devices (e.g Android and IOS) don't support buttons.

I like to collect info about issue 1 and 2, so please send me a mail if you see them and mention your OS and browser version (or Google Drive version).
24
25
HISTORY
26
V1.1 (1 Mar 2014)
Added missing btceGetFee function

V1.0 (1 Mar 2014)
Initial version
27
28
LICENSE & DISCLAIMER
29
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100