403 Forbidden when using https://polygon-mumbai.infura.io

I am trying to access Polygon from web3.py using Infura. The same code works fine with Ethereum (Mainnet or Ropsten) but I get a 403 when I change it to use Polygon (Mainnet or Mumbai). This is the code:

w3 = Web3(HTTPProvider('https://polygon-mumbai.infura.io/v3/XXXXXXXXXXXXXXX'))
res = w3.eth.getTransactionCount('0xXXXXXXXXXXX', 'pending')
1 Like

I have come across the same issue. Hope it could be fixed soon

Hi @Patricio_Mosse and @falcon_woods, and welcome to the Infura community!

We are currently experienced increased latencies on our Polygon Mainnet API and are working to resolve the issue. You can visit and subscribe to our status page here to stay up to date with the latest information.

Thanks! I found the issue though: I didn’t have the Polygon AddOn activated, even though the Polygon API Url was already available for me to use, which was misleading. Now it is working fine!

how to activated Polygon , i get the same question

Hi @local_darede, and welcome to the Infura community!

You can add Polygon on by going to the bottom of your dashboard page and selecting the orange “CHANGE PLAN” button. This will take you to your “Payment” page, where you can add on Polygon PoS under the third section, “NETWORK ADD-ONS”