Too Many Requests 429

Hi friends,

I started earlier to get the error: “Too Many Requests 429”, on the stream, it’s weird because I used these keys for a long time with no issues and now suddenly I’m getting this, why, what is the problem?

Thanks in advance!

Error:

Promise 0 succeeded
🌎🔄 Attempting to reconnect to the stream...
🌎🔄 Attempting to reconnect to the stream...
🌎🔄 Attempting to reconnect to the stream...
{ path: '/filings', res: { statusMessage: 'OK', statusCode: 200 } } 📰 Response received from filings stream
✅Filings Stream💦 started successfully, piping through json parser!
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at _write (node:internal/streams/writable:487:11)
    at Writable.write (node:internal/streams/writable:508:10)
    at Transform.ondata (node:internal/streams/readable:1007:22)
    at Transform.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushObjectMode (node:internal/streams/readable:536:3)
    at Readable.push (node:internal/streams/readable:391:5)
    at push (C:\Users\burac\Desktop\Apps\companies_aws\companies\node_modules\split2\index.js:76:10)
    at Transform.transform [as _transform] (C:\Users\burac\Desktop\Apps\companies_aws\companies\node_modules\split2\index.js:44:7)
    at Transform._write (node:internal/streams/transform:171:8) {
  code: 'ERR_STREAM_WRITE_AFTER_END'
} 🛑🛑🛑 MESSAGE: 🚨 Error: on -filings- parser stream
🛑 Stream ended or error occurred
{ path: '/filings', res: { statusMessage: 'OK', statusCode: 200 } } 📰 Response received from filings stream
✅Filings Stream💦 started successfully, piping through json parser!
{ path: '/filings', res: { statusMessage: 'OK', statusCode: 200 } } 📰 Response received from filings stream
✅Filings Stream💦 started successfully, piping through json parser!
{
  path: '/disqualified-officers',
  res: { statusMessage: 'Too Many Requests', statusCode: 429 }
} 📰 Response received from -Disqualified- stream
🥵 Exiting due to hitting rate limit

429 is returned when you are sending in more requests than is permitted. Upon receipt of a 429 you need to throttle your requests. You are allowed 750 requests per 5m period - if you need any more than this I would suggest you look at the streaming-api which provides data in real time

It looks like the json parser is causing your repeated rapid re-connections which in turn leads to the 429. Find out why the parser is chocking in the first place, then introduce a delay of at least 500 milliseconds before you re-connect if the parser chokes and that should get you up and running again.
PS: You really should find out why your parser is chocking - log the payloads before parsing - till you get to the bottom of it!