desmondmorris / node-twitter

Client library for the Twitter REST and Streaming API's.
https://www.npmjs.com/package/twitter
MIT License
1.27k stars 237 forks source link

Stream API get Error: Status Code: 403 #359

Open guxuanye opened 1 year ago

guxuanye commented 1 year ago

I write the code, but get an error

client.stream("statuses/filter", { track: "twitter" }, function (stream) { stream.on("data", function (tweet) { console.log(tweet.text); }); stream.on("error", function (error) { console.log(error); }); });

The error is: Error: Status Code: 403 at Request.<anonymous> (D:\WebCode\TestAPI\node_modules\twitter\lib\twitter.js:277:28) at Request.emit (node:events:513:28) at Request.onRequestResponse (D:\WebCode\TestAPI\node_modules\request\request.js:1059:10) at ClientRequest.emit (node:events:513:28) at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:701:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:542:22) at TLSSocket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9)

Jgamber commented 1 year ago

Same issue here. Also says I have "elevated" access in developer dashboard.