Install
No other dependency. AvocadoVPN speaks standard HTTP CONNECT over Basic auth — requests has native support.
Minimal example
import os
import requests
PROXY_URL = f"http://{os.environ['AVP_KEY']}:{os.environ['AVP_SECRET']}@api.atlasvpn.live:7777"
proxies = {
"http": PROXY_URL,
"https": PROXY_URL,
}
r = requests.get("https://ifconfig.me", proxies=proxies, timeout=30)
print(r.text) # → residential FR / DE / ES / NL / UK IP
Never hard-code the secret in source. Read from env vars (os.environ) or a secrets manager (AWS Secrets Manager, GCP Secret Manager, Vault).
Session with sticky exit IP
session_tag = "product-scrape-run-2026-04-25"
proxy_with_session = f"http://avp_live_<key>-country-us-session-{session_tag}:<secret>@api.atlasvpn.live:7777"
proxies = {"http": proxy_with_session, "https": proxy_with_session}
# All requests in this Python process use the same US residential exit
# for the next 10 minutes of activity.
for url in urls_to_scrape:
r = requests.get(url, proxies=proxies, timeout=30)
...
Rotating IPs per-request
If your target rate-limits per-IP, drop the session tag so each request picks a fresh node:
proxy_rotating = "http://avp_live_<key>-country-us:<secret>@api.atlasvpn.live:7777"
proxies = {"http": proxy_rotating, "https": proxy_rotating}
Production: retries + backoff
import time
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
# Retry 429, 502, 504 with exponential backoff — don't retry 4xx auth/quota
adapter = HTTPAdapter(max_retries=Retry(
total=3,
backoff_factor=1.0,
status_forcelist=[429, 502, 504],
allowed_methods=["GET", "POST"],
))
session = requests.Session()
session.mount("https://", adapter)
session.mount("http://", adapter)
session.proxies = {"http": PROXY_URL, "https": PROXY_URL}
r = session.get("https://target.com")
Concurrency
requests itself is synchronous. For parallel scraping use httpx (async) or requests-futures (thread-pool). Our gateway handles concurrency fine up to your tier’s rate limit — 10 rps on Developer, 50 rps on Scale. Exceeding the rate limit returns 429; back off per the snippet above.
Common pitfalls
| Pitfall | Fix |
|---|
SSLError: certificate verify failed on HTTPS targets | Target server has a broken cert. Set verify=False (with understanding of the trade-off) or verify="/path/to/ca.pem" |
| Proxy works on Windows but fails on Linux | Check http_proxy / https_proxy env vars not shadowing your config |
| All requests 407 | Secret was rotated elsewhere. Fetch fresh credentials from /developer |
| All requests 502 | Beta-scale node pool might have 0 nodes in your requested country. Check status.atlasvpn.live or drop the -country-XX qualifier |