Skip to main content

browser-use-proxyhat

Route browser-use AI agents through ProxyHat residential proxies — a sticky residential IP pinned for the whole agent session, plus geo-targeting and rotation.

CI Compatible with browser-use latest PyPI License: MIT

Why

Browser agents driving a real browser from a datacenter IP get flagged, CAPTCHA-walled, and blocked. This package plugs ProxyHat's residential IPs (50M+ across 148+ countries) into any browser-use agent through its first-class proxy= option — one pinned residential IP for the whole session by default, so cookies and fingerprint stay consistent while the agent works. No fork, no boilerplate.

Install

pip install browser-use-proxyhat

browser-use is a peer dependency — bring your own version (and its Playwright browser). proxyhat_proxy() (the proxy dict builder) works on its own; proxyhat_browser_session() needs browser-use installed:

pip install browser-use-proxyhat browser-use

Quick start

from browser_use import Agent, ChatOpenAI
from browser_use_proxyhat import proxyhat_browser_session

# An API key auto-selects an active residential sub-user:
agent = Agent(
    task="Find the cheapest flight from SFO to Tokyo next month.",
    llm=ChatOpenAI(model="gpt-4o-mini"),
    browser_session=proxyhat_browser_session(country="us"),  # sticky US IP for the whole session
)
await agent.run()

Get an API key at proxyhat.com.

Just want the proxy dict for your own Browser / BrowserSession / BrowserProfile?

from browser_use import BrowserSession
from browser_use_proxyhat import proxyhat_proxy

session = BrowserSession(proxy=proxyhat_proxy(country="de", sticky="1h"))
# proxyhat_proxy(...) -> {"server": "http://gate.proxyhat.com:8080", "username": ..., "password": ...}

Credentials

Pass them explicitly or via environment variables — options win over env:

Option Env var Notes
api_key PROXYHAT_API_KEY Auto-selects an active sub-user with remaining traffic
sub_user PROXYHAT_SUBUSER Pick a specific sub-user by uuid or name (with an API key)
username PROXYHAT_USERNAME Explicit gateway proxy_username (skips the API)
password PROXYHAT_PASSWORD Explicit gateway proxy_password

Targeting

proxyhat_browser_session(
    protocol="http",   # or "socks5"
    country="us",      # ISO code or "any" (default)
    region="california",
    city="new_york",
    filter="high",     # AI IP-quality tier
    sticky="30m",      # session lifetime (default); sticky=False rotates every request
    headless=True,     # any extra kwarg is forwarded to BrowserSession
)

Sticky IP per agent session (default)

A browser agent takes many steps against the same site — logging in, clicking, scrolling. If the exit IP changed mid-session the site would see a user teleporting between cities and block it. So this package is sticky by default: one residential IP is pinned for the whole BrowserSession (sticky="30m", renewed as the agent works), keeping cookies and fingerprint coherent.

Want a fresh IP on every request instead (e.g. many independent one-shot fetches)? Turn stickiness off:

proxyhat_browser_session(country="us", sticky=False)  # rotating residential IP per connection

Set a custom lifetime with sticky="2h".

How it works

proxyhat_proxy(...) resolves your gateway credentials (via the official proxyhat SDK — an API key auto-picks an active sub-user, or pass username/password), then builds a Playwright-style proxy dict: server is the ProxyHat gateway (http://gate.proxyhat.com:8080, or socks5://…:1080), and username carries ProxyHat's targeting grammar (<user>-country-us-sid-<id>-ttl-30m). proxyhat_browser_session(...) passes that dict to browser-use's proxy= parameter on a BrowserSession — which browser-use hands to Playwright. A sticky username pins one residential IP; a rotating one makes the gateway hand out a fresh IP per connection.

License

MIT © ProxyHat

Metadata

Release files for browser-use-proxyhat 0.1.1

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

Source distribution (sdist)

Source distribution for browser-use-proxyhat 0.1.1
File Size Uploaded
browser_use_proxyhat-0.1.1.tar.gz 238.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for browser-use-proxyhat 0.1.1
File Interpreter ABI Platform
browser_use_proxyhat-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 246.2 kB

Release files / browser_use_proxyhat-0.1.1.tar.gz

Download URL browser_use_proxyhat-0.1.1.tar.gz
Size 238.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ab4c951ddf76163c4bc438ab624af808dab7522d4d5279f06e77a6aa862c05ed
BLAKE2b-256 checksum
How to use checksums
49168bf432bef33487454cf591d33855026291a3f86420a0a27ca4a39213eeb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / browser_use_proxyhat-0.1.1-py3-none-any.whl

Download URL browser_use_proxyhat-0.1.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
558982114cbace1dae13d24f8e215ae03477ea6551e0190101fbfd17f34ecf33
BLAKE2b-256 checksum
How to use checksums
13d592a78d7ca6b9ef6b495426a2df0ddad075fb92ad5a7c4b066100c74bd975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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