Skip to main content

proxyzen — Python client for the ProxyZen proxy API

Official, dependency-free Python client for the ProxyZen API. Buy, renew and list private IPv4 / IPv6 proxies and residential / mobile traffic from your own code, scripts or bots.

  • Private IPv4 and IPv6 proxies in many countries, HTTP(S) and SOCKS5 on every proxy
  • Residential (140+ countries) and mobile proxies billed per GB, traffic never expires
  • Standard library only, Python 3.8+

Docs: https://proxyzen.net/en/api · Prices: https://proxyzen.net/en/prices

Install

pip install proxyzen

Quick start

Create an API key in your dashboard: https://proxyzen.net/cabinet/api

from proxyzen import ProxyZen

pz = ProxyZen("pz_your_key")        # or set the PROXYZEN_KEY environment variable

print(pz.balance())

# countries with IPv4 in stock and prices
in_stock = [c["code"] for c in pz.countries() if c["available"]["ipv4"] > 0]
print(in_stock)
print(pz.prices("DE", "ipv4"))

# buy 2 IPv4 proxies in Germany for 30 days (spends money from the balance)
order = pz.buy("DE", quantity=2, days=30)
for p in order["proxies"]:
    print(ProxyZen.proxy_url(p))                 # http://login:pass@host:port
    print(ProxyZen.proxy_url(p, "socks5"))       # socks5://login:pass@host:port

Manage your proxies

for p in pz.iter_proxies(status="active"):
    print(p["host"], p["http_port"], p["expires_at"])

pz.renew([123, 124], days=30)          # renew by id
pz.set_auto_renew(123, True)           # auto-renew from the balance

Residential and mobile proxies (per GB)

print(pz.traffic_products())                       # prices
pz.buy_traffic(1, "residential")                   # 1 GB, spends money
for plan in pz.traffic_plans():
    user = f"{plan['username']}-country-US-session-ab12cd-time-10"   # US, sticky IP for 10 minutes
    print(f"http://{user}:{plan['password']}@{plan['host']}:{plan['http_port']}")

Use with requests

import requests
proxy = ProxyZen.proxy_url(order["proxies"][0])
print(requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}).text)

More examples: how to use proxies in Python and Node.js, Puppeteer, Playwright, Selenium and curl.

Errors

API errors raise ProxyZenError with .status, .code and .message:

from proxyzen import ProxyZenError
try:
    pz.buy("DE", quantity=1, days=30)
except ProxyZenError as e:
    print(e.code, e.message)            # e.g. insufficient_funds

MIT License.

Metadata

Release files for proxyzen 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for proxyzen 0.1.0
File Size Uploaded Provenance Actions
proxyzen-0.1.0.tar.gz 5.1 kB Without provenance Details for proxyzen-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for proxyzen 0.1.0
File Interpreter ABI Platform Actions
proxyzen-0.1.0-py3-none-any.whl Python 3 none any Details for proxyzen-0.1.0-py3-none-any.whl

Total release size: 11.2 kB

Release files / proxyzen-0.1.0.tar.gz

Download URL proxyzen-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6844bf481df2c55ba70a2b8e7c19db9313a38a0d7468adca7bb23592fdc92a2d
BLAKE2b-256 checksum
How to use checksums
4447b95163965faf95e2253f1788169813b584b3d483bd4cd3c23af607295353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / proxyzen-0.1.0-py3-none-any.whl

Download URL proxyzen-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7af150f76ec2f2d1c16263803c01071418f6d277bf88d8ed135e9f258514bb3
BLAKE2b-256 checksum
How to use checksums
a07069fb3275fc1f95ba1dcf712c3bc201b7dfe5a52a85a4460ecbfdaee5cf12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for proxyzen 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page