Subscribing to pendingTransactions > rate exceeded

Hi I’m using this web3.eth.subscribe(‘pendingTransactions’) after a few seconds I get an error “Error: Returned error: project ID request rate exceeded”

How many requests is the subscribe event calling?

1 Like

Hi @Andrew_K - welcome to the Infura community!
Depending on what tier you are using, you get a certain number of requests per day (free is 100K).
The Rate Limits section of our docs should help you determine the current rate per second versus your current allowed rate that you should be staying under. Occasionally projects will get rate limited if it’s sending too many JSONRPC requests during a short time window.

The Rate Limits section also provides you with some easy solutions that should help you fix this.

1 Like

How do I get the pendingTransaction to work then? It does a request every time there is a pending transaction on the block chain. Which means even your highest tier would not be able to support this many requests.

For example I went through 10000 requests in just a few seconds.

Can you send over the code snippet you’re using to make the pendingTransaction call? That’ll help us better be able to help you troubleshoot.

hi, has this been resolved? Because I have the same issue and my code is pretty similar to the snippet above.

Thanks.

From the web3js docs, have you tried adding the unsubscribe as well?