Skip to main content

Context.dev for Haystack

PyPI Python Test License

Haystack components for live web search, webpage and YouTube transcript retrieval, and bounded website crawling with Context.dev.

Installation

pip install context-dev-haystack

Create an API key in the Context.dev dashboard, then export it:

export CONTEXT_API_KEY="your-api-key"

Components

Component Purpose Import
ContextWebSearch Search the live web and return ranked Haystack Documents and source links haystack_integrations.components.websearch.context
ContextFetcher Fetch webpages or YouTube videos as clean Markdown Documents haystack_integrations.components.fetchers.context
ContextCrawler Crawl websites into Documents with explicit page and depth limits haystack_integrations.components.fetchers.context

All components support both run() and run_async(), Haystack serialization, custom timeouts, and retry configuration.

Search the live web

from haystack_integrations.components.websearch.context import ContextWebSearch

search = ContextWebSearch(top_k=5, include_markdown=True)
result = search.run(query="Recent advances in retrieval-augmented generation")

documents = result["documents"]
links = result["links"]

Use include_domains, exclude_domains, freshness, and country to constrain results. Extra Context.dev Search API fields can be supplied through search_params.

Fetch webpages or YouTube transcripts

from haystack_integrations.components.fetchers.context import ContextFetcher

fetcher = ContextFetcher()
result = fetcher.run(
    urls=[
        "https://haystack.deepset.ai",
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    ]
)

documents = result["documents"]

Each URL becomes a Haystack Document. Webpages contain clean Markdown and page metadata; supported YouTube URLs return timestamped transcript Markdown.

Crawl a website

from haystack_integrations.components.fetchers.context import ContextCrawler

crawler = ContextCrawler(crawl_params={"maxPages": 25, "maxDepth": 2})
result = crawler.run(urls=["https://docs.haystack.deepset.ai"])

documents = result["documents"]

ContextCrawler defaults to one page to prevent accidental credit consumption. Set maxPages explicitly for larger crawls.

Async usage

result = await search.run_async(query="Haystack agents")
documents = result["documents"]

The fetcher and crawler process multiple input URLs concurrently in their async methods.

Development

See CONTRIBUTING.md for the Hatch-based development and release workflow.

License

Apache-2.0. See LICENSE.

Release files for context-dev-haystack 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 context-dev-haystack 0.1.0
File Size Uploaded
context_dev_haystack-0.1.0.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for context-dev-haystack 0.1.0
File Interpreter ABI Platform
context_dev_haystack-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.6 kB

Release files / context_dev_haystack-0.1.0.tar.gz

Download URL context_dev_haystack-0.1.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7eb3b1f86777c0a7838b159329ac1647099f92e543bd3b8b83f1c54532d339c9
BLAKE2b-256 checksum
How to use checksums
afa73e39298acb69f65ab377271c7bfcdc81ef567b9380aa3cfe29a7e9e42982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

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

Download URL context_dev_haystack-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b7c44457a4b39d7414ba8f3e7c48f7c383969742bb95b8378a254964a31ec18
BLAKE2b-256 checksum
How to use checksums
19234ff24fe954fa6df2b0b9d3a6935b645124c50374bff9946ce683c0249aae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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