node-red-contrib-upbitpublic
v1.0.0
Published
Node-RED node for upbitpublic
Downloads
14
Maintainers
Readme
node-red-contrib-upbitpublic
Node-RED node for upbitpublic
Install
To install the stable version use the Menu - Manage palette - Install
option and search for node-red-contrib-upbitpublic, or run the following
command in your Node-RED user directory, typically ~/.node-red
npm install node-red-contrib-upbitpublic
Wrapper upbit public API
- https://apidocs.upbit.com/docs/ticker
Sample parameters
msg.params = {};
msg.params.markets = 'KRW-BTC'
return msg;
Sample flows
[{"id":"cd913a07.b71708","type":"upbitpublic","z":"2422d0a1.5c053","name":"market/all","api":"market/all","x":1080,"y":20,"wires":[["91e9294d.cdd8b8"]]},{"id":"23265940.0b6e06","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":20,"wires":[["3de05ba7.70bf34"]]},{"id":"3de05ba7.70bf34","type":"function","z":"2422d0a1.5c053","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":20,"wires":[["cd913a07.b71708"]]},{"id":"91e9294d.cdd8b8","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":20,"wires":[]},{"id":"16c1dd74.4dd903","type":"upbitpublic","z":"2422d0a1.5c053","name":"candles/days","api":"candles/days","x":1090,"y":60,"wires":[["f7072559.98ec18"]]},{"id":"8ba9e1b1.54e3d","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":60,"wires":[["d069109a.325c8"]]},{"id":"d069109a.325c8","type":"function","z":"2422d0a1.5c053","name":"","func":"msg.params = {};\nmsg.params.count = '1'\nmsg.params.market = 'KRW-BTC'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":60,"wires":[["16c1dd74.4dd903"]]},{"id":"f7072559.98ec18","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1270,"y":60,"wires":[]},{"id":"c9844bde.0b56d8","type":"upbitpublic","z":"2422d0a1.5c053","name":"candles/weeks","api":"candles/weeks","x":1100,"y":100,"wires":[["4ab20e20.47479"]]},{"id":"910e115f.89b34","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":100,"wires":[["d474c11a.28fb3"]]},{"id":"d474c11a.28fb3","type":"function","z":"2422d0a1.5c053","name":"","func":"msg.params = {};\nmsg.params.count = '1'\nmsg.params.market = 'KRW-BTC'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":100,"wires":[["c9844bde.0b56d8"]]},{"id":"4ab20e20.47479","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":100,"wires":[]},{"id":"d86ad09c.401c4","type":"upbitpublic","z":"2422d0a1.5c053","name":"candles/months","api":"candles/months","x":1100,"y":140,"wires":[["8a1ef04c.c0836"]]},{"id":"b070988e.4ff028","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":140,"wires":[["1c4b6ff4.4bdf4"]]},{"id":"1c4b6ff4.4bdf4","type":"function","z":"2422d0a1.5c053","name":"","func":"msg.params = {};\nmsg.params.count = '1'\nmsg.params.market = 'KRW-BTC'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":140,"wires":[["d86ad09c.401c4"]]},{"id":"8a1ef04c.c0836","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":140,"wires":[]},{"id":"2f073d89.5e2fa2","type":"upbitpublic","z":"2422d0a1.5c053","name":"trades/ticks","api":"trades/ticks","x":1090,"y":180,"wires":[["110ff011.afe8d"]]},{"id":"5f14ccbc.a40544","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":180,"wires":[["467b4c6d.8a8f34"]]},{"id":"467b4c6d.8a8f34","type":"function","z":"2422d0a1.5c053","name":"","func":"msg.params = {};\nmsg.params.market = 'KRW-BTC'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":180,"wires":[["2f073d89.5e2fa2"]]},{"id":"110ff011.afe8d","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":180,"wires":[]},{"id":"c553afec.64996","type":"upbitpublic","z":"2422d0a1.5c053","name":"ticker","api":"ticker","x":1070,"y":220,"wires":[["87a0a045.0ef7b"]]},{"id":"975ad0f6.c80ea","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":220,"wires":[["32b16e62.5fec82"]]},{"id":"32b16e62.5fec82","type":"function","z":"2422d0a1.5c053","name":"","func":"msg.params = {};\nmsg.params.markets = 'KRW-BTC'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":220,"wires":[["c553afec.64996"]]},{"id":"87a0a045.0ef7b","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":220,"wires":[]},{"id":"1005c82a.f5fba8","type":"upbitpublic","z":"2422d0a1.5c053","name":"orderbook","api":"orderbook","x":1080,"y":260,"wires":[["6ca2dce8.863ea4"]]},{"id":"df188ba1.190988","type":"inject","z":"2422d0a1.5c053","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":260,"wires":[["c043281e.fbd528"]]},{"id":"c043281e.fbd528","type":"function","z":"2422d0a1.5c053","name":"","func":"msg.params = {};\nmsg.params.markets = 'KRW-BTC'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":260,"wires":[["1005c82a.f5fba8"]]},{"id":"6ca2dce8.863ea4","type":"debug","z":"2422d0a1.5c053","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":260,"wires":[]}]
Sample result
{"market":"KRW-BTC","trade_date":"20210408","trade_time":"063102","trade_date_kst":"20210408","trade_time_kst":"153102","trade_timestamp":1617863462000,"opening_price":72850000,"high_price":73894000,"low_price":70432000,"trade_price":71446000,"prev_closing_price":72850000,"change":"FALL","change_price":1404000,"change_rate":0.0192724777,"signed_change_price":-1404000,"signed_change_rate":-0.0192724777,"trade_volume":0.00071227,"acc_trade_price":232703793901.70416,"acc_trade_price_24h":1283122843350.2224,"acc_trade_volume":3234.7119075,"acc_trade_volume_24h":17718.59156546,"highest_52_week_price":79500000,"highest_52_week_date":"2021-04-06","lowest_52_week_price":7929000,"lowest_52_week_date":"2020-04-16","timestamp":1617863462833}