Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in

Use a proxy in Python with requests: video guide

0:59··English captions

A 0:59 screen recording with voice and captions: pick a country in the QuanticData endpoint generator, set the output format to the URL form that requests expects, generate and copy one line, then a short Python script that reads it from an environment variable, passes it for http and https and prints the exit IP and its country.

The long version in writing: How to use a proxy with Python requests: syntax, auth, rotation and pitfalls.

Chapters

  1. 0:00A proxy in requests
  2. 0:06Pick the country
  3. 0:20The URL format
  4. 0:32The script
  5. 0:48Run it

Transcript

The captions of the video, line by line. Click a time to jump there.

  1. 0:00Use a proxy in Python with requests.
  2. 0:02Copy one line from your dashboard, and run a short script.
  3. 0:06Open your plan from My proxies.
  4. 0:09In the endpoint generator, pick the country you need.
  5. 0:12It is written into the username, so your code stays the same.
  6. 0:16Keep Rotating for a new IP on every request.
  7. 0:20Set the output format to the URL form.
  8. 0:23That is what requests expects: login, host and port in one line.
  9. 0:28Generate one line, and copy it.
  10. 0:32In your script, read it from an environment variable.
  11. 0:35Pass it for both http and https.
  12. 0:39The request goes to our IP echo endpoint: free, with no API key.
  13. 0:44The script prints the exit IP and its country.
  14. 0:48Set QD_PROXY to your line, and run it.
  15. 0:53The full API reference is at quanticdata.io/docs.

Where to go next

Rotating or sticky, from one endpoint

Residential, mobile and datacenter proxies with country targeting, rotating or sticky sessions, HTTP or SOCKS5, built in the endpoint generator or over the API.

More video guides