Docs menu

Docs Reference

Haystack

Fetch pages for a Haystack pipeline or agent through residential, datacenter or mobile IPs.

Last verified: October 2026

What it does

The proxmint-haystack package connects Haystack to your Proxmint proxies. Its ProxmintFetcher component takes a list of URLs and returns documents (the page as readable text, or the raw HTML) and failed_urls. Use it as the first step of an indexing pipeline, or wrap it in a ComponentTool to give an agent a page-reading tool.

Requests go straight from your code to the gateway, from the IPs and location you pick, and use the bandwidth of your own product. The source is on GitHub and the package on PyPI.

Install and connect

Install the package and create an API key under Settings in the dashboard (the same read-only key the customer API uses):

Shell
pip install proxmint-haystack
export PROXMINT_API_KEY="pmk_YOUR_KEY"

The key looks up the proxy login of the product you choose, so there is nothing else to copy. If you would rather not use a key, set PROXMINT_USERNAME and PROXMINT_PASSWORD to the proxy login from your product page.

Fetch pages

Python
from haystack_integrations.components.fetchers.proxmint import ProxmintFetcher

fetcher = ProxmintFetcher(country="gb")
result = fetcher.run(urls=["https://example.com", "https://example.org"])

result["documents"][0].content  # readable page text
result["documents"][0].meta      # source, requested_url, status, title, content_type, country
result["failed_urls"]            # URLs the proxy or the site refused

Each URL gets a new IP unless session_minutes is set. A URL that fails is logged, skipped and listed in failed_urls. When the gateway refuses a request, for example because the product is out of bandwidth or no IP matches the targeting, the message says what to change. The error codes page lists them all.

Use it in a pipeline or as an agent tool

Indexing pipeline
from haystack import Pipeline
from haystack.components.preprocessors import DocumentSplitter
from haystack.components.writers import DocumentWriter
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.components.fetchers.proxmint import ProxmintFetcher

store = InMemoryDocumentStore()
pipe = Pipeline()
pipe.add_component("fetcher", ProxmintFetcher(country="us", city="New York", session_minutes=30))
pipe.add_component("splitter", DocumentSplitter(split_by="sentence", split_length=5))
pipe.add_component("writer", DocumentWriter(store))
pipe.connect("fetcher.documents", "splitter.documents")
pipe.connect("splitter.documents", "writer.documents")

pipe.run({"fetcher": {"urls": ["https://example.com/pricing", "https://example.org/pricing"]}})
Agent tool
from haystack.tools import ComponentTool
from haystack_integrations.components.fetchers.proxmint import ProxmintFetcher

tool = ComponentTool(
    component=ProxmintFetcher(),
    name="fetch_pages",
    description="Fetch web pages through a proxy in a chosen country and return their text.",
)

Options

OptionDefaultWhat it does
api_keyPROXMINT_API_KEYA Haystack Secret. Without a key, PROXMINT_USERNAME and PROXMINT_PASSWORD are read.
product"residential"residential, premium-residential, datacenter or mobile.
countryanyExit country as a two-letter code. run(urls, country=...) overrides it for one run.
state, city, zip_code, asnnoneFiner targeting inside the country. Needs country.
session_minutesnoneKeep one exit IP across runs for 1 to 120 minutes. Default: a new IP for every URL.
output"text"text returns readable text, html the raw page.
timeout60Seconds per request.
raise_on_failureFalseRaise on a failed URL instead of listing it in failed_urls.

Good to know

  • State, city, ZIP and ASN targeting can meter at twice the bandwidth; the targeting page says which products.
  • Pages load over the destination ports the network forwards, which cover the usual web ports (see port access). A short list of sites is refused outright (see blocked websites).
  • Each product allows up to 2,000 concurrent connections.
  • The component does not run JavaScript. It reads what the server sends.