☰
Login
Signup
Home
›
Market data (WebSockets)
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
458
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
December 2019
Rupeshpr77
December 2019
sujith
How to get quote after subscribe instrument in browser
Rupeshpr77
December 2019
edited December 2019
in
Market data (WebSockets)
Hi Team
I am trying to populate instrument quote on web browser but getting this "Blob { size: 1, type: "" }
web3.html:79:21"
Please let me know solutions
code
<!DOCTYPE html>
WebSocket demo
body {
font-family: "Courier New", sans-serif;
text-align: center;
}
.buttons {
font-size: 4em;
display: flex;
justify-content: center;
}
.button,
.value {
line-height: 1;
padding: 2rem;
margin: 2rem;
border: medium solid;
min-height: 1em;
min-width: 1em;
}
.button {
cursor: pointer;
user-select: none;
}
.subscribe {
color: red;
}
.mode {
color: green;
}
subscribe
mode
var subscribe = document.querySelector('.subscribe'),
mode = document.querySelector('.mode'),
websocket = new WebSocket("wss://ws.kite.trade?api_key=xxx&access_token=xxx");
subscribe.onclick = function (event) {
console.log("subscribe clicked")
websocket.send(JSON.stringify({ "a": "subscribe", "v": [408065, 884737] }));
}
mode.onclick = function (event) {
console.log("mode clicked")
websocket.send(JSON.stringify({"a": "mode", "v": ["ltp", [408065]]}));
}
websocket.onmessage = function (event) {
console.log(event.data)
};
Tagged:
WebSocket
sujith
December 2019
@Rupeshpr77
,
I am afraid you can't do that because of CORS. One can't use our live market feeds on a third party website.
sujith
December 2019
The live market data is only for personal consumption.
Rupeshpr77
December 2019
edited December 2019
@sujith
This is for my personal use
Sign In
or
Register
to comment.
I am afraid you can't do that because of CORS. One can't use our live market feeds on a third party website.
This is for my personal use