Integrations / Language

Use Proxys with Python httpx

Use Proxys with httpx, sync or async.

Steps

  1. Install httpx: pip install httpx.
  2. Pass the proxy URL to the client.
Python
import httpx

with httpx.Client(proxy="http://USERNAME-country-us:PASSWORD@gw.proxys.co:8000", timeout=30) as c:
    print(c.get("https://ipinfo.io/json").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.

Try 1 GB for $1