Intermittent errors on connecting with bitbucket.org via api.bitbucket.org

Facing issues when connecting to api.bitbucket.org. We get different errors every time such “Connection Timed out”, “Forbidden” or “Unauthenticated with Bitbucket”. Could you please guide us on this what is the reason and how can we resolve it. We are using the free tier of bitbucket.org. Please note we are using the basic username and password for authentication.