Anti-bot bypass scraping API. Use KnoxProxy directly as a lower-cost alternative to ZenRows for residential proxy rotation, with the same geo-targeting capabilities and no per-request API fees.
Install your preferred HTTP client.
pip install requests # Python
npm install axios # JavaScriptInstead of sending requests through the ZenRows API endpoint, route them directly through KnoxProxy.
# ZenRows approach (per-request cost):
# requests.get("https://api.zenrows.com/v1/", params={"url": target})
# KnoxProxy approach (per-GB cost, much cheaper):
proxies = {"http": "http://user:pass@gw.knoxproxy.com:7000", "https": "http://user:pass@gw.knoxproxy.com:7000"}Target specific countries by appending a country code to your username.
proxies = {
"http": "http://your_username-country-us:your_password@gw.knoxproxy.com:7000",
"https": "http://your_username-country-us:your_password@gw.knoxproxy.com:7000"
}Add browser-like headers to your requests for better success rates on protected sites.
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Accept": "text/html,application/xhtml+xml",
"Accept-Language": "en-US,en;q=0.9"
}Implement simple retry logic for failed requests.
for attempt in range(3):
resp = requests.get(url, proxies=proxies, headers=headers, timeout=30)
if resp.status_code == 200:
breakRun a test scrape and compare output with ZenRows. KnoxProxy residential IPs achieve comparable success rates at a fraction of the cost.
import requests
from typing import Optional
# Migration from ZenRows to KnoxProxy
# Before: $2.80/1000 requests with ZenRows
# After: ~$X/GB with KnoxProxy (much lower for typical pages)
KNOX_PROXY = {
"http": "http://your_username-country-us:your_password@gw.knoxproxy.com:7000",
"https": "http://your_username-country-us:your_password@gw.knoxproxy.com:7000",
}
HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9",
"Accept-Language": "en-US,en;q=0.9",
}
def scrape(url: str, country: str = "us", retries: int = 3) -> Optional[str]:
"""Scrape a URL through KnoxProxy with retry logic."""
proxy_url = f"http://your_username-country-{country}:your_password@gw.knoxproxy.com:7000"
proxies = {"http": proxy_url, "https": proxy_url}
for attempt in range(retries):
try:
resp = requests.get(url, proxies=proxies, headers=HEADERS, timeout=30)
if resp.status_code == 200:
return resp.text
except requests.RequestException:
continue
return None
html = scrape("https://example.com/products")
if html:
print(f"Success: {len(html)} bytes")KnoxProxy rotates IPs automatically per connection. No API key or per-request fees. Pay only for bandwidth used.
| Problem | Fix |
|---|---|
| Target returns CAPTCHA | Combine KnoxProxy with a headless browser (Playwright or Puppeteer) for JS-rendered pages. KnoxProxy handles the IP, the browser handles the rendering. |
| Connection refused | Verify proxy URL format: http://user:pass@gw.knoxproxy.com:7000. Check credentials in KnoxProxy dashboard. |
USER-country-de-city-berlin-session-profile07Order matters -- geo flags before the session flag. The session name is free text; use the profile ID so the mapping is self-documenting. Password stays as issued; no flags belong there. HTTP on :7000, SOCKS5 on :7001, same credentials.
ZenRows charges per API request. KnoxProxy charges per GB of bandwidth, which is significantly cheaper for most scraping workloads.
KnoxProxy is a proxy service. For JS rendering, pair it with Playwright or Puppeteer. The proxy handles IP rotation while the browser handles rendering.
Almost. Replace the ZenRows API URL with a direct proxy configuration. The request flow is simpler since you hit the target URL directly through the proxy.
KnoxProxy residential IPs have high trust scores. Combine with browser-like headers and a headless browser for sites with advanced anti-bot protection.
Free trial on rotating residential -- 3 minutes setup, no credit card.