You can connect to Rayobyte Residential Proxies in Python using the requests library. The example below shows a basic Residential Proxy request using username and password authentication.
For the latest proxy configuration options, including targeting, sessions, and supported protocols, visit Rayobyte Proxy Docs.
➡️ Python Example
How do I connect to a Residential Proxy using Python?
First, make sure you have the requests library installed:
pip install requestsThen replace the placeholder username and password below with your Residential Proxy credentials:
import requests
username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"
proxy = f"http://{username}:{password}@la.residential.rayobyte.com:8000"
proxies = {
"http": proxy,
"https": proxy
}
response = requests.get(
"https://httpbin.org/ip",
proxies=proxies,
timeout=30
)
print(response.text)If the connection is successful, the response will show the exit IP used for the request.
➡️ Adding Targeting
Can I use targeting with the Python example?
Yes! Residential Proxy targeting is configured through your proxy credentials, so the same Python structure can be used with supported targeting options.
Residential Proxies support options such as country, state/region, city, ZIP/postal code, ASN, operating system, and IP version targeting.
Rather than maintaining separate Python examples for every targeting combination here, see our Residential Proxy Targeting documentation for the latest parameters and configuration options.
➡️ Sticky Sessions
Can I keep the same IP across multiple Python requests?
Yes. Residential Proxies support sticky sessions, which allow multiple requests to use the same Residential exit IP when available.
See our Residential Proxy Sessions documentation for current session configuration and behavior.
➡️ Troubleshooting
What should I check if the Python request fails?
Start by checking the basics:
- Make sure your Residential Proxy username and password are correct.
- Confirm that your account has available Residential bandwidth.
- Test the connection without targeting or session parameters first.
- Make sure your application can connect to
la.residential.rayobyte.comon port8000. - If you're using targeting, try broadening or removing the targeting criteria and test again.
If the basic connection works but fails after targeting is added, see Why is my targeted Residential Proxy not connecting?.
➡️ Need Help?
For current Residential Proxy setup, targeting, sessions, protocols, and other configuration options, visit Rayobyte Proxy Docs.
If your Python connection still isn't working, our Support team is happy to help.
When contacting us, please include the error you're receiving and a copy of the relevant portion of your Python code.
Important: Remove your proxy password and any other sensitive credentials before sending your code, screenshots, or logs.
Email: support@rayobyte.com
Submit a Ticket: Contact Rayobyte Support