-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.txt
162 lines (90 loc) · 5.77 KB
/
endpoints.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
Follow the following points to configure the front end to listen
Add the below script to the listening page, backend will comtinuously feed the required data and can retrieve the data from e.data
<script>
var eventSource = new EventSource("http://localhost:5000/binance/listen/BNBBTC")
eventSource.addEventListener("message", function(e) {
var div = document.getElementById('counter');
div.innerHTML += e.data;
}, false)
</script>
############################################################### Listening Endpoints
Listening endpoints are available in the binanceStream __init__ file
To add endpoints to listening do the following things,
To extend the available crypto need to add the crypto to the symbols list in
* getStreamData __init__.py file
* pubsub data_center.py file
Once all the required crypto are added will add them to a collection in database and query so can easily extend the endpoints as required
[GET] localhost:5000/binance/listen/crypto_name/crypto_interval
Here crypto_name is one from the symbols list mentioned above
Here crypto_interval is one from the followings
1m 15m 30m 1h 1d
5m 1h 1d
############################################################### Listening Endpoints Ends
############################################################### Watch List Endpoints
To access the watch list of a user use the following end points
> Create a new watch list with one or more brands or add brands to the existing watch list
[POST] localhost:5000/wlist/addBrand
in the request body pass the following json
{
"email":"[email protected]",
"brands":["BNBBTC","BNBUSDT"]
}
> To get the brand names in an existing watch list use the following endpoints
[GET] localhost:5000/wlist/viewWlist/email_of_the_relevent_user
> To remove brands from the relevent watch list
[DELETE] localhost:5000/wlist/removeBrand/
pass the following as a json in the request body
{
"email":"[email protected]",
"brands":["brand01","brand02"]
}
############################################################### Watch List Endpoints Ends
############################################################ User end points
Login = localhost:5000/user/login
Register = localhost:5000/user/register
> To add and view the profile photo of the user
[POST] localhost:5000/user/add_profile_image
In the data section include the following json file
{
"email" : "[email protected]",
"file" : "Add the base64 encoded image string here"}
}
[GET] localhost:5000/user/get_profile_image/<Add the User Email here>
############################################################ User end points ends
############################################################ TA end points
RSI =
MACD = localhost:5000/ta/macd/type(stock or crypto)/stockOrCryptoName/interval/0000
Bollinger Bands = localhost:5000/ta/bbands/type(stock or crypto)/stockOrCryptoName/interval/0000
ROC = localhost:5000/ta/roc/type(stock or crypto)/stockOrCryptoName/interval/0000
STOCH = localhost:5000/ta/stoch/type(stock or crypto)/stockOrCryptoName/interval/0000
MA = localhost:5000/ta/ma/type(stock or crypto)/stockOrCryptoName/interval/0000
SMA = localhost:5000/ta/sma/type(stock or crypto)/stockOrCryptoName/interval/0000
EMA = localhost:5000/ta/ema/type(stock or crypto)/stockOrCryptoName/interval/0000
WMA = localhost:5000/ta/wma/type(stock or crypto)/stockOrCryptoName/interval/0000
OBV = localhost:5000/ta/obv/type(stock or crypto)/stockOrCryptoName/interval/0000
############################################################ TA end points ends here
############################################################ Historical Crypto Data End point starts
Can use this to get the historical data from the database.
[GET] localhost:5000/binance/historical/crypto_name_comes_here/interval_comes Here/start_date_in_milliseconds
>>>>>>>> By default end date is 5 days back to the start date. Can alter the value at data_center reverse_date variable
Intervals are defined under the listening endpoints.
############################################################ Historical Data End point Ends
############################################################ Historical Stock Data End point starts
Can use this to get the historical data from the database.
[GET] localhost:5000/stock/historical/stock_name_comes_here/interval_comes Here
Intervals are defined under the listening endpoints.
############################################################ Historical Data End point Ends
############################################################ General Endpoints starts
[GET] localhost:5000/binance/get_crypto - Get the available crypto list
[GET] localhost:5000/stock/get_stock_list - Get the available stock list
[POST] localhost:5000/binance/add_crypto/new_crypto_name_comes_here # Dont use this end point, there are some things to be added later
############################################################ General Endpoints Ends Here
############################################################ Notification Endpoints starts Here
[GET] localhost:/5000/notifications/listen_nots/open_price # Use this to listen to the real time notifications on open open_price
Example returned
data: {'message':'successful','type': 'Over 5 percent incriment', 'symbol': 'BNBBTC', 'open price': '0.00874100', 'current peak price': 0.00812}
type can be over 5,25,50 or 75 or else 25,50,75 decriment
"current peak price" is the closing price of the last days kline for the relevent symbol
You can use the following endpoint to get all the notifications from the last 5 days
[GET] localhost:5000/notifications/historical_nots/open_price
############################################################ Notification Endpoints ends Here