Does the streaming API still work?
See original GitHub issueI’ve followed the docs on your main github page, but my subscriptions to quotes/updates/etc doesn’t work. I receive a successful authentication message, but when I try to subscribe for quotes, I never get any notifications.
The docs on alpaca’s site it shows something like this, but I don’t see anything related to subscribing for updates.
{
"action": "listen",
"data": {
"streams": ["trade_updates"]
}
}
But in your example, the action is “subscribe” and the data doesn’t appear to be formatted in a similar format. I’m not sure what I’m missing…
Here is my code for connecting to the socket
this.socketConnection.once("authenticated", () => {
this.socketConnection.subscribe("quotes", ["AAPL, FB, SPY"]);
this.socketConnection.on("quote", (quote) => {
console.log(quote);
});
this.socketConnection.on("bar", (bar) => {
console.log(bar);
});
this.socketConnection.on("trade", (trade) => {
console.log(trade);
});
this.socketConnection.on("trade_updates", (update) => {
console.log(update);
});
});`
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Streaming API vs REST API – what is the difference?
Streaming APIs are stateful, and REST APIs are stateless (which means that the API itself saves no client context, except for the initial ......
Read more >The Key Differences Between Streaming APIs and REST APIs
When it comes to the differences between streaming APIs and REST APIs, real-time apps don't REST. Find out how they compare and contrast....
Read more >Stream api v1 deprecation - Twitter Developers
We recently graduated filtered stream into Twitter API v2: Early Access and announced a 60-day deprecation window. We will retire this endpoint in...
Read more >Consuming streaming data | Docs | Twitter Developer Platform
To open the data stream to have Tweets delivered, you need to send a connection request to the API. In the streaming model,...
Read more >REST vs Streaming APIs: How They Differ - Nordic APIs
Streaming still operates over the same HTTP methods as REST, but because of its event-driven interactions, the relationship shifts power from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow, I’m not sure how I missed the quotes needing to be individual strings. That seemed to be the issue. I did have market_data, just showed you the wrong one in the example. Thanks for taking the time to help with this! This library has been really helpful
In your socket connection you pass the array of quotes as one string:
This is incorrect they should be individual strings:
It is also important that you switch the
type
tomarket_data
in theAlpacaStream
constructor. If quotes is what you wish to receive, the example below works for me:I get the following output when running the above code:
Hope this ends up working for you. 😃