Skip to main content

cloro Python SDK

The official Python client for cloro — one API for Google Search and every AI answer engine (ChatGPT, Gemini, Perplexity, Copilot, Grok, AI Overview, AI Mode). Real-time, structured JSON.

Use the SDK, or just curl it — same clean response either way. The SDK adds typed methods, sensible retries, and a polling helper for the async task queue so you don't hand-roll it.

Installation

pip install cloro

Requires Python 3.8+.

Quickstart

from cloro import Cloro

client = Cloro(api_key="sk_live_...")  # or set CLORO_API_KEY

res = client.monitor.chatgpt(
    prompt="What do you know about Acme Corp?",
    country="US",
    include={"markdown": True},
)

print(res["result"]["text"])
for source in res["result"]["sources"]:
    print(source["position"], source["url"], source["label"])

The API key is read from the CLORO_API_KEY environment variable when you don't pass api_key=. Get a key (and 500 free credits) at dashboard.cloro.dev.

Engines

Every engine is a method on client.monitor. AI engines take a prompt; Google Search and Google News take a query.

client.monitor.chatgpt(prompt="...", country="US")
client.monitor.gemini(prompt="...", country="US")
client.monitor.perplexity(prompt="...", country="US")
client.monitor.copilot(prompt="...", country="US")
client.monitor.grok(prompt="...", country="US")
client.monitor.aimode(prompt="...", country="US")           # Google AI Mode

client.monitor.google(query="best crm", country="US", pages=1)
client.monitor.google_news(query="acme corp", country="US")

Pass include={...} to request extra formats — markdown, html, searchQueries, shopping, and more, depending on the engine.

Async task queue

For high-volume or long-running work, enqueue tasks and poll them to completion. run() does create-then-wait in one call:

result = client.async_tasks.run(
    task_type="CHATGPT",
    payload={"prompt": "What is cloro?", "country": "US"},
)
print(result["response"])       # present once COMPLETED
print(result["credits"])        # credits reserved / charged

Prefer to manage the lifecycle yourself:

task = client.async_tasks.create(
    task_type="GOOGLE",
    payload={"query": "serp api", "country": "US"},
    priority=5,
)
status = client.async_tasks.retrieve(task)   # non-blocking snapshot
result = client.async_tasks.wait(task, timeout=120, poll_interval=2)

Batch up to 500 tasks in a single request (results preserve input order):

results = client.async_tasks.create_batch([
    {"task_type": "CHATGPT", "payload": {"prompt": "q1", "country": "US"}},
    {"task_type": "PERPLEXITY", "payload": {"prompt": "q2", "country": "GB"}},
])
for item in results:
    if item["success"]:
        client.async_tasks.wait(item["task"]["id"])
    else:
        print("failed:", item["error"]["message"])

Queue-wide status:

client.async_tasks.status()   # queued / processing counts, concurrency usage

Valid task_type values: CHATGPT, GEMINI, PERPLEXITY, COPILOT, GROK, AIMODE, GOOGLE, GOOGLE_NEWS.

Configuration

client = Cloro(
    api_key="sk_live_...",
    base_url="https://api.cloro.dev",  # override if needed
    timeout=300.0,                      # per-request seconds (the default)
    max_retries=2,                      # timeouts, connection errors, 429/5xx
)

The client is a context manager and pools connections:

with Cloro() as client:
    client.monitor.chatgpt(prompt="...", country="US")

Error handling

All errors subclass CloroError. HTTP failures map to status-specific types:

from cloro import Cloro, AuthenticationError, RateLimitError, CloroError

try:
    client.monitor.chatgpt(prompt="...", country="US")
except AuthenticationError:
    ...  # 401 — bad or missing API key
except RateLimitError as e:
    ...  # 429 — back off and retry
except CloroError as e:
    ...  # everything else

BadRequestError (400), PermissionDeniedError (403), NotFoundError (404), ConflictError (409), and InternalServerError (5xx) are also available, along with TaskFailedError / TaskTimeoutError from the poller and APITimeoutError / APIConnectionError from the transport.

Reference data

client.countries()             # supported countries
client.countries(model="chatgpt")
client.states()                # US states for location-targeted Google

License

MIT

Metadata

Release files for cloro 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloro 0.1.2
File Size Uploaded
cloro-0.1.2.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloro 0.1.2
File Interpreter ABI Platform
cloro-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / cloro-0.1.2.tar.gz

Download URL cloro-0.1.2.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f80d484f129bedef2c65ed88c9835b3d8c489c52090834e0996cdb8560457832
BLAKE2b-256 checksum
How to use checksums
a3e8be61beea0a39bda8c6baa5d7ce8f57c716dc3199c9ab38fdf9db0a52370e
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 Oct 7, 2026.

Transparency log

Release files / cloro-0.1.2-py3-none-any.whl

Download URL cloro-0.1.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76eb74dd7d90a3dca2eac8d7e80e67041d59ec2d614f8e2dbff9284dc27e393c
BLAKE2b-256 checksum
How to use checksums
70bc1734132cc5aad79303a7b3cdd0c9eab1303dd6d34f31c5efd8ac3e34f221
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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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