cloro-haystack
Haystack components for cloro.
| Component | cloro endpoint | Output | Credits per run |
|---|---|---|---|
CloroWebSearch |
POST /v1/monitor/google or /bing |
documents and links from Google or Bing organic results. With include_ai_overview=True, the AI Overview is the first Document. |
5, or 7 with the AI Overview |
CloroAIAnswer |
POST /v1/monitor/chatgpt, /aimode, /gemini, /bing/aimode or /meta-ai |
replies (the answer as Markdown), documents and links (the cited sources) |
ChatGPT 7, Google AI Mode 6, Gemini 6, Bing AI Mode 6, Meta AI 6 |
Installation
pip install cloro-haystack
Get an API key at dashboard.cloro.dev.
The free plan includes 500 credits each month. Set the key as CLORO_API_KEY, or pass
api_key=Secret.from_token(...).
Usage
CloroWebSearch
from haystack_integrations.components.websearch.cloro import CloroWebSearch
websearch = CloroWebSearch(top_k=5, country="US", include_ai_overview=True)
result = websearch.run(query="What is retrieval-augmented generation?")
for doc in result["documents"]:
print(doc.meta.get("title"), doc.meta.get("link"))
Each organic result is a Document. Its content is the result snippet and its meta has title,
link and position. The AI Overview Document has meta["source"] == "google_ai_overview" (or
"bing_ai_overview") and the URLs it cites in meta["links"]. Results with an empty link or a Google
redirect link are skipped.
With include_ads=True, the ads on the Google or Bing page are the last Documents. The content of an ad
starts with Ad:. Its meta["source"] is "google_ad" or "bing_ad", and its meta has title, link,
position, block_position, ad_type, price and store, when the ad has them. links has no ads.
Parameters:
api_key: defaults to theCLORO_API_KEYenvironment variable.top_k: maximum number of organic results. Defaults to 10. One request returns one page of results (about 10). Setsearch_params={"pages": 2}for more (2 credits for each extra page).country: ISO 3166-1 alpha-2 country code. Defaults to"US".allowed_domains: domains to limit the search to, sent assite:filters.include_ai_overview: request the AI Overview. Defaults toFalse.search_params: other request fields, for exampledevice,location,hlorpagesfor Google, andpagesorfirstfor Bing.timeout: request timeout in seconds. Defaults to 60.engine:"google"(Google Search) or"bing"(Bing Search). Defaults to"google".include_ads: return the ads on the page. Defaults toFalse. The ads cost no extra credits and do not count towardstop_k.
With engine="bing", the component searches Bing. The country sets the Bing market. Bing Search accepts
all countries except CN, KR and RU. It has no device, location or hl fields. Set
search_params={"pages": 2} for more results (2 credits for each extra page) or search_params={"first": 11}
to start at a later result. Bing shows its AI summary only on the first page. The query can have a maximum of 3,500 characters after URL encoding, and fewer for
non-Latin scripts.
websearch = CloroWebSearch(engine="bing", country="GB", include_ai_overview=True)
CloroAIAnswer
from haystack_integrations.components.websearch.cloro import CloroAIAnswer
ai_answer = CloroAIAnswer(engine="aimode") # "chatgpt", "aimode", "gemini", "bing_aimode" or "meta_ai"
result = ai_answer.run(query="What is retrieval-augmented generation?")
print(result["replies"][0])
print(result["links"])
replies has one string: the answer as Markdown. documents has one Document for each source that
the answer cites, with title, link and position in meta. An answer can take 15 to 60 seconds,
so the default timeout is 180 seconds.
With engine="bing_aimode", the query can have a maximum of 3,500 characters after URL encoding,
and fewer for non-Latin scripts. To send the query from a US state, set
search_params={"state": "CA"} with country="US" (2 more credits).
With engine="meta_ai", the query can have a maximum of 10,000 characters. Meta AI accepts all
countries except CN and RU. To send the query from a US state, set search_params={"state": "CA"}
with country="US" (2 more credits). The Meta AI Markdown has no citation links, so use documents
or links for the sources. Meta AI gives no answer to some "best X" product prompts. Those requests
raise CloroError, and a retry does not help.
In a pipeline
The output names of CloroAIAnswer match AnswerBuilder:
from haystack import Pipeline
from haystack.components.builders import AnswerBuilder
from haystack_integrations.components.websearch.cloro import CloroAIAnswer
pipe = Pipeline()
pipe.add_component("ai", CloroAIAnswer(engine="chatgpt"))
pipe.add_component("answer", AnswerBuilder())
pipe.connect("ai.replies", "answer.replies")
pipe.connect("ai.documents", "answer.documents")
query = "Which vector databases support hybrid search?"
result = pipe.run({"ai": {"query": query}, "answer": {"query": query}})
print(result["answer"]["answers"][0].data)
CloroWebSearch connects like the other Haystack web search components, for example to a
ChatPromptBuilder through documents, or to a fetcher through links.
Both components have run_async for AsyncPipeline.
Errors
A cloro error response raises CloroError with the cloro error code, for example
INVALID_API_KEY_FORMAT (401), INSUFFICIENT_CREDITS (403) or CONCURRENCY_LIMIT_EXCEEDED (429).
A timeout raises TimeoutError.
Development
uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run mypy src
uv build
The tests use httpx.MockTransport and do not call the cloro API.
License
MIT
Metadata
Release files for cloro-haystack 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cloro_haystack-0.5.0.tar.gz | 17.0 kB | With provenance | Details for cloro_haystack-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cloro_haystack-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for cloro_haystack-0.5.0-py3-none-any.whl |
Total release size: 28.8 kB
Release files / cloro_haystack-0.5.0.tar.gz
| Download URL | cloro_haystack-0.5.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f37b980ab9a6bf0e76cdea1cf8670a1a2a6714a2156440421b2a48f06cfd3496
|
|
BLAKE2b-256 checksum How to use checksums |
ea0fdd5b7df6af60de69b44543b70342814edfb937386eefaf609d4cf06c8be9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 29, 2026.
Transparency logRelease files / cloro_haystack-0.5.0-py3-none-any.whl
| Download URL | cloro_haystack-0.5.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d989c2cb8ee560212a6efc580fbcae9d27202ab8f70699dec27f75161acdf439
|
|
BLAKE2b-256 checksum How to use checksums |
5b0309d3f518b33851acfe8a92574d7cbf2f8cf1aa083f659b29136986b37424
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 29, 2026.
Transparency logSecurity for cloro-haystack 0.5.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cloro_haystack-0.5.0.tar.gz
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 Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.