Skip to main content

llama-index-tools-cloro

LlamaIndex tools for cloro. cloro loads the live page of a search engine or an AI assistant for a query and a country, and returns the result as structured data.

Tool cloro endpoint Returns Credits per call
google_search POST /v1/monitor/google One Document per Google organic result: title, URL and snippet. With include_ai_overview=True, the Google AI Overview and its sources first. 5, or 7 with the AI Overview
bing_search POST /v1/monitor/bing One Document per Bing organic result: title, URL and snippet. With include_ai_overview=True, the Bing AI Overview and its sources first. 5, or 7 with the AI Overview
google_ai_mode POST /v1/monitor/aimode The Google AI Mode answer as Markdown, with its sources 6
bing_ai_mode POST /v1/monitor/bing/aimode The Bing AI Mode (Copilot Search in Bing) answer, with its sources 6
chatgpt POST /v1/monitor/chatgpt The ChatGPT answer that users see, with its sources 7
gemini POST /v1/monitor/gemini The Gemini answer, with its sources 6
meta_ai POST /v1/monitor/meta-ai The Meta AI answer, with its sources 6

Installation

pip install llama-index-tools-cloro

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=....

Usage

With an agent

import asyncio

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.cloro import CloroToolSpec

cloro = CloroToolSpec(country="US", include_ai_overview=True)
agent = FunctionAgent(
    tools=cloro.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
    system_prompt="Answer with live search results. Cite the URLs you use.",
)


async def main() -> None:
    print(await agent.run("What do Google AI Mode and ChatGPT say are the best SERP APIs?"))


asyncio.run(main())

To give the agent only some tools, filter the list:

tools = [t for t in cloro.to_tool_list() if t.metadata.name in ("google_search", "google_ai_mode")]

Direct calls

from llama_index.tools.cloro import CloroToolSpec

cloro = CloroToolSpec()

for doc in cloro.google_search("retrieval-augmented generation", max_results=5, country="GB"):
    print(doc.metadata["title"], doc.metadata["url"])

answer = cloro.google_ai_mode("What is retrieval-augmented generation?")[0]
print(answer.text)
print(answer.metadata["sources"])

Each tool returns a list of Document. The text is what the agent reads:

  • google_search and bing_search: one Document per result. The text is the title, the URL and the snippet. metadata has title, url and position. Results with an empty link or a Google redirect link are skipped. With the AI Overview turned on, the first Document is the AI Overview and its sources, with metadata["engine"] == "google_ai_overview" or "bing_ai_overview". With include_ads=True, the ads on the page are the last Documents. The text of an ad starts with Ad:, and metadata["engine"] is "google_ad" or "bing_ad". metadata also has block_position, type, price and store, when the ad has them.
  • The AI answer tools: one Document. The text is the answer as Markdown, then a "Sources" list. metadata has engine, prompt and sources (a list of title and url).

Parameters

CloroToolSpec(api_key=None, country="US", timeout=180.0, include_ai_overview=False, include_ads=False)

  • api_key: the cloro API key. Defaults to the CLORO_API_KEY environment variable.
  • country: ISO 3166-1 alpha-2 country code for the search location. Each tool also takes country per call.
  • timeout: request timeout in seconds. An AI answer can take 15 to 60 seconds.
  • include_ai_overview: make google_search and bing_search also return the AI Overview. It costs 2 more credits per search.
  • include_ads: make google_search and bing_search also return the ads on the page. The ads cost no more credits and do not count towards max_results.

Limits

  • Bing Search and Bing AI Mode accept a query of up to 3,500 characters after URL encoding. Non-Latin scripts allow fewer characters. bing_search and bing_ai_mode refuse a longer query before they send the request.
  • The Bing Search tool gets the first results page. The country sets the Bing market. Bing Search and Bing AI Mode accept all countries except CN, KR and RU.
  • Meta AI accepts a prompt of up to 10,000 characters and all countries except CN and RU. Meta AI gives no answer to some "best X" product prompts. meta_ai then raises CloroError, and a retry does not help.
  • Your plan sets how many requests can run at the same time. A request sent while all slots are busy gets a 429 (CONCURRENCY_LIMIT_EXCEEDED).
  • An API error raises CloroError with the HTTP status, the cloro error code and the message.

Development

uv run --with 'llama-index-core>=0.13,<0.15' --with httpx --with pytest -- python -m pytest tests

The tests mock the network. The API reference is at cloro.dev/docs.

License

MIT

Metadata

Release files for llama-index-tools-cloro 0.5.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 llama-index-tools-cloro 0.5.0
File Size Uploaded Provenance Actions
llama_index_tools_cloro-0.5.0.tar.gz 8.6 kB With provenance Details for llama_index_tools_cloro-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-tools-cloro 0.5.0
File Interpreter ABI Platform Actions
llama_index_tools_cloro-0.5.0-py3-none-any.whl Python 3 none any Details for llama_index_tools_cloro-0.5.0-py3-none-any.whl

Total release size: 16.6 kB

Release files / llama_index_tools_cloro-0.5.0.tar.gz

Download URL llama_index_tools_cloro-0.5.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bc47c2cd75edf1633e9445c478484ae7b6dd60a90394921ee0bb1e89612a6452
BLAKE2b-256 checksum
How to use checksums
2027c7a09fea14160dc778bb0f3401e3eb956fe27adfca41e784510e820dded8
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 log

Release files / llama_index_tools_cloro-0.5.0-py3-none-any.whl

Download URL llama_index_tools_cloro-0.5.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19f364676c861a26fb8a131a22e9c72229c2304a3ef21175dfc9bd986155cab4
BLAKE2b-256 checksum
How to use checksums
1f3a763ac690690e8607e412797f0ba76a93cf20df50ffc8ab1f1dd562c3076e
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 log

Security for llama-index-tools-cloro 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.

Select from 2 files

Attestation for llama_index_tools_cloro-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 log

A 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.

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