SDK > requests-proxyport

Python requests-proxyport package

The requests-proxyport package is a Python library that enables you to use rotating proxies with the popular requests HTTP library. Rotating proxies are a type of proxy server that automatically switches the IP address used for the connection after a certain number of requests or a certain amount of time has passed. This can be useful for web scraping, where you may want to avoid being blocked by websites for making too many requests from a single IP address.

pypi.org/project/requests-proxyport - page on PyPi.org

Prerequisites

Get API Key

Installation

$ pip install requests-proxyport

            

Getting Started

Before you get your first proxy, you need to assign an API Key. This can be done either through an environment variable

$ export PROXY_PORT_API_KEY=<API_KEY>

        
or directly in the code.

from requests_proxyport import Session

session = Session(proxyport_api_key='<API_KEY>') # here
r = session.get('https://example.com/')
print(r.text)