llamaindex-proxyhat
Read the web in LlamaIndex through ProxyHat residential proxies — a web reader with rotating IPs, geo-targeting, and sticky sessions.
Why
RAG pipelines that read the open web from datacenter IPs get blocked, rate-limited, and served bot-detection pages instead of content. This package routes LlamaIndex's web reads through ProxyHat's residential IPs (50M+ across 148+ countries) — a fresh IP per page by default, or one pinned IP for a whole multi-page load.
ProxyHatWebReader— aBaseReaderwhoseload_data(urls)fetches each URL and returnsDocumentobjects for indexing, retrieval, or summarization.
Install
pip install llamaindex-proxyhat
llama-index-core is a peer — bring your own version (>=0.10), the same one your app and other LlamaIndex integrations already use.
Quick start
Load pages as Document objects:
from llamaindex_proxyhat import ProxyHatWebReader
# An API key auto-selects an active residential sub-user:
reader = ProxyHatWebReader(
api_key="ph_your_api_key",
country="us",
)
docs = reader.load_data(["https://example.com", "https://example.org"])
for doc in docs:
print(doc.metadata["url"], doc.metadata["status_code"], len(doc.text))
Feed the documents straight into an index:
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex.from_documents(docs)
answer = index.as_query_engine().query("What does the page say?")
Get an API key at proxyhat.com.
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
ProxyHatWebReader(
api_key="ph_your_api_key",
country="us", # ISO code or "any" (default)
region="california",
city="new_york",
filter="high", # AI IP-quality tier
sticky="30m", # keep one IP across the whole load; omit for rotating
protocol="http", # or "socks5"
)
Each Document carries text (the response body) and metadata with url, status_code, and content_type.
Rotating vs sticky
By default the reader is rotating: each page is fetched over a new connection with a stable gateway username, so ProxyHat hands out a fresh residential IP per page. Set sticky (e.g. sticky="30m" or sticky=True) to pin one residential IP across every page in the load_data call — the right choice for paginated sites, logged-in sessions, or anything that must look like a single user.
How it works
ProxyHatWebReader subclasses BaseReader (llama_index.core.readers.base) and returns Document objects (llama_index.core). It resolves your gateway credentials once (via the official proxyhat SDK — an API key auto-picks an active sub-user, or you supply username/password directly), then builds a ProxyHat gateway connection URL with the SDK's targeting grammar and fetches each URL through it with httpx. Rotating loads reuse a stable username so the gateway rotates the IP per connection; sticky loads reuse one session id (a single httpx client) so every request exits from the same IP.
Publishing to the LlamaHub / LlamaIndex integrations registry is a planned follow-up.
License
MIT © ProxyHat
Metadata
Release files for llamaindex-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)
| File | Size | Uploaded | |
|---|---|---|---|
| llamaindex_proxyhat-0.1.1.tar.gz | 9.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llamaindex_proxyhat-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / llamaindex_proxyhat-0.1.1.tar.gz
| Download URL | llamaindex_proxyhat-0.1.1.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b9da6118fecdd14e7091518ecce98f6c41067dfdbd14de69ddd88c1050468b2
|
|
BLAKE2b-256 checksum How to use checksums |
2a6aa667e4d7fed230906e03c04a8662d3e9fc906ab91b312e7b9ba1e00d5e50
|
| 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 logRelease files / llamaindex_proxyhat-0.1.1-py3-none-any.whl
| Download URL | llamaindex_proxyhat-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bfe53269ae1e8d3e78a6a7efbeb5ec6b17b1356683b290e2d66c6772a5b9659
|
|
BLAKE2b-256 checksum How to use checksums |
cbce6aa6dc4f5f656e80de8f499ef9500874c410eba2c8361ee7508e592428e4
|
| 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