An option you have is to use the http_proxy and https_proxy environment variables. You can set these variables in your code or the command line before running your script. For example, you can set the https_proxy variable to the URL of your proxy server: import os os.environ['https_proxy'] = 'https://proxy.example.com:8080' Another option is to use a third-party proxy service such as shiftproxy.io which can be a great solution for secure and easy access to your APIs over HTTPS. hese are just a few examples, but it's important to keep in mind that the specific implementation will depend on your use case and the requirements of the environment.