Integrations / Language
Use Proxys with Python requests
Send requests through Proxys with the requests library.
Steps
- Install requests: pip install requests.
- Copy a sub-user's username and password from the dashboard.
- Pass the proxy for both http and https.
import requests
proxy = "http://USERNAME-country-us:PASSWORD@gw.proxys.co:8000"
r = requests.get("https://ipinfo.io/json", proxies={"http": proxy, "https": proxy}, timeout=30)
print(r.json())Before you start
Replace USERNAME and PASSWORD with a sub-user's credentials from the dashboard. Change -country-us to the country you need, or remove it for a random location. See targeting options for city, ASN and sticky sessions.