One Python client for Google Search, ChatGPT, Perplexity, Gemini, Copilot, and Grok — one authenticated HTTP request per call, structured JSON back. No proxies, no headless browsers, no selectors to maintain.
4.8 · 42 reviewsInstall the SDK, store your API key in the environment, and make your first call. The cloro SDK wraps proxies, rendering, and anti-bot logic on the server — whether you're hitting the Google SERP API or an AI engine like ChatGPT — so your Python code shrinks to one method call and a parse. Working in Node or TypeScript? See the cloro API for JavaScript & Node.
pip install cloroStore your key in the environment — never hardcode secrets:
export CLORO_API_KEY="sk-..."Authenticate and make the first call:
from cloro import Cloro
# Reads your key from the CLORO_API_KEY environment variable.
client = Cloro()
# Google Search — structured SERP JSON, no proxies or selectors.
serp = client.monitor.google(query="best running shoes", country="US")
for item in serp["result"]["organicResults"]:
print(item["position"], item["link"])
# Any AI engine is the same client — just change the method.
answer = client.monitor.chatgpt(
prompt="What do you know about Acme Corp?",
country="US",
)
print(answer["result"]["text"])Google Search and every AI engine share one client and one credit pool. You add coverage by changing the method — each maps to one endpoint, shown below — not by writing a new scraper per engine.
| Engine | Endpoint | Credits |
|---|---|---|
| Google Search | POST /v1/monitor/google | 3 +2/page · +2 with AI Overview |
| Google News | POST /v1/monitor/google/news | 3 +2/page |
| Google AI Mode | POST /v1/monitor/aimode | 4 |
| ChatGPT | POST /v1/monitor/chatgpt | 7 (full) · 5 (web search) |
| Perplexity | POST /v1/monitor/perplexity | 3 |
| Gemini | POST /v1/monitor/gemini | 4 |
| Copilot | POST /v1/monitor/copilot | 5 |
| Grok | POST /v1/monitor/grok | 4 |
Base URL: https://api.cloro.dev. Full request and response schemas live in the API docs, and the Python SDK reference documents every client method.
The most common production job: a nightly tracker that checks a keyword list across several markets and writes results to JSONL you can load into pandas, BigQuery, or a database. It fans out 300 queries (100 keywords × 3 countries) across a capped pool of workers. For the endpoint-level detail, see the Google rank tracking API guide.
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import date
from cloro import Cloro
# The client reads CLORO_API_KEY and retries 429/5xx with backoff for you.
client = Cloro()
KEYWORDS = [
"best running shoes",
"trail running shoes men",
"waterproof running shoes",
# ... up to 100
]
COUNTRIES = ["US", "GB", "DE"]
TARGET_DOMAIN = "nike.com"
MAX_WORKERS = 10 # match your plan's concurrency limit, not your CPU count
def fetch_one(query: str, country: str) -> dict:
res = client.monitor.google(
query=query,
country=country,
include={"aioverview": {"markdown": True}},
)
result = res["result"]
positions = [
item["position"]
for item in result["organicResults"]
if TARGET_DOMAIN in item.get("link", "")
]
aio_sources = str(result.get("aioverview", {}).get("sources", []))
return {
"date": str(date.today()),
"query": query,
"country": country,
"rank": positions[0] if positions else None,
"in_ai_overview": TARGET_DOMAIN in aio_sources,
}
def run_tracker(output_path: str = "ranks.jsonl") -> None:
tasks = [(kw, c) for kw in KEYWORDS for c in COUNTRIES]
rows: list[dict] = []
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as pool:
futures = {pool.submit(fetch_one, kw, c): (kw, c) for kw, c in tasks}
for future in as_completed(futures):
kw, c = futures[future]
try:
rows.append(future.result())
print(f"OK {kw} / {c}")
except Exception as exc:
print(f"ERR {kw} / {c}: {exc}")
with open(output_path, "w") as f:
for row in rows:
f.write(json.dumps(row) + "\n")
print(f"\nDone. {len(rows)} rows written to {output_path}")
if __name__ == "__main__":
run_tracker()SERP calls are I/O-bound, so threads are the right tool here — not multiprocessing. Cap MAX_WORKERS at your plan's concurrency limit, and keep each returned row flat so it writes cleanly to JSONL, CSV, or a column.
Rank tracking no longer stops at Google. If your brand appears in a ChatGPT answer but not a Perplexity citation, that gap is worth measuring. Each AI engine is a separate endpoint on the same credit pool — notice how little changes from the rank-tracker code above.
from cloro import Cloro
client = Cloro()
# Same client, same call shape — only the method changes per engine.
ENGINES = {
"chatgpt": client.monitor.chatgpt,
"perplexity": client.monitor.perplexity,
"gemini": client.monitor.gemini,
}
BRAND_QUERIES = [
"best electric SUV 2026",
"tesla model y vs competitors",
"ev range comparison",
]
TARGET_BRAND = "tesla.com"
def check_ai_visibility(prompt: str, engine: str, call) -> dict:
result = call(prompt=prompt, country="US")["result"]
sources = result.get("sources", [])
return {
"engine": engine,
"prompt": prompt,
"brand_cited": any(TARGET_BRAND in (s.get("url") or "") for s in sources),
"answer_snippet": result.get("text", "")[:200],
}
def run_ai_visibility_audit() -> list[dict]:
results = []
for prompt in BRAND_QUERIES:
for engine, call in ENGINES.items():
try:
row = check_ai_visibility(prompt, engine, call)
results.append(row)
status = "cited" if row["brand_cited"] else "not cited"
print(f"[{engine}] {prompt[:40]}... -> {status}")
except Exception as exc:
print(f"ERR [{engine}] {prompt[:40]}...: {exc}")
return results
if __name__ == "__main__":
rows = run_ai_visibility_audit()
cited = sum(1 for r in rows if r["brand_cited"])
print(f"\n{cited}/{len(rows)} queries cite {TARGET_BRAND} across AI engines")This is the foundation of AI visibility monitoring: tracking where your brand surfaces (or doesn't) in generative answers alongside traditional search. You add engines by adding endpoints, not by writing new scrapers.
Five things separate a script that works once from one that runs on a schedule:
Cloro(max_retries=...).ThreadPoolExecutor size for sync code, an asyncio.Semaphore for async. Set it to the plan limit, not your CPU count.client.async_tasks.create_batch() and poll — the queue absorbs concurrency and retries instead of you hand-tuning a Semaphore..env file with python-dotenv, add .env to .gitignore, and rotate any key that lands in a commit..get() and handle missing keys — response shapes evolve, and not every query returns an AI Overview box.Batching high-volume work through the async task queue looks like this:
from cloro import Cloro
client = Cloro()
KEYWORDS = ["best running shoes", "trail shoes", "waterproof boots"]
# Enqueue up to 500 tasks in one request, then poll each to completion.
# The queue absorbs concurrency and retries — no Semaphore to hand-tune.
results = client.async_tasks.create_batch(
[{"task_type": "GOOGLE", "payload": {"query": kw, "country": "US"}} for kw in KEYWORDS]
)
for item in results:
if item["success"]:
done = client.async_tasks.wait(item["task"]["id"])
top = done["response"]["result"]["organicResults"][0]
print(item["task"]["id"], "->", top["link"])
else:
print("failed:", item["error"]["message"])The SDK raises typed exceptions, all subclassing CloroError. Catch the ones you want to handle specially and let the transient ones (which the client already retries) bubble. They map to the underlying HTTP status codes:
| Status | Meaning |
|---|---|
| 200 | Success — parsed JSON in the body. |
| 400 | Bad request — malformed payload or an invalid parameter. Not retryable; fix the request. |
| 401 | Unauthorized — missing or invalid API key. Check CLORO_API_KEY. |
| 429 | Rate / concurrency limit hit — back off and retry with jitter. |
| 5xx | Transient server error — retry with exponential backoff. |
from cloro import (
Cloro,
AuthenticationError,
BadRequestError,
RateLimitError,
CloroError,
)
client = Cloro()
try:
res = client.monitor.google(query="best running shoes", country="US")
except AuthenticationError as exc:
raise RuntimeError("Invalid or missing CLORO_API_KEY") from exc
except BadRequestError as exc:
raise RuntimeError(f"Bad request: {exc}") from exc
except RateLimitError:
... # the client already retried; back off further if this persists
except CloroError:
raise # timeouts, 5xx, task failures — all subclass CloroErrorThe DIY route — requests + BeautifulSoup + rotating proxies — is real, and sometimes the right call for a one-off. Our Python web scraping pillar guide covers the ecosystem end to end, and How to Scrape Google Search walks through the direct-scrape path, including headless rendering. For anything on a schedule, the API absorbs the maintenance the DIY path never stops demanding.
Start free. Price per credit drops as your volume grows — see every tier below.
| Plan | Price / mo | Credits | Per 1k | Concurrency | Seats | Support |
|---|---|---|---|---|---|---|
| Free | $0 | 500 | — | 1 | 1 | Community |
| Lite | $30 | 37,500 | $0.80 | 10 | Unlimited | |
| Hobby | $100 | 250,000 | $0.40 | 20 | Unlimited | |
| StarterPopular | $250 | 650,000 | $0.39 | 50 | Unlimited | |
| Growth | $500 | 1,350,000 | $0.37 | 75 | Unlimited | Priority email |
| Business | $1,000 | 2,800,000 | $0.36 | 100 | Unlimited | Priority email |
| Enterprise 2K | $2,000 | 5,871,025 | $0.34 | 135 | Unlimited | Slack |
| Enterprise 3K | $3,000 | 9,306,606 | $0.32 | 175 | Unlimited | Slack |
| Enterprise 4K | $4,000 | 12,756,261 | $0.31 | 215 | Unlimited | Slack |
| Enterprise 5K | $5,000 | 16,391,783 | $0.31 | 255 | Unlimited | Slack |
| Enterprise | $5,000+ | Increased concurrency, overages on credits and credit discounts for annual contracts.Know more | ||||
One client, one credit pool for Google Search and every AI engine. See how per-call SERP costs stack up in the cheapest SERP APIs breakdown, or measure your brand across generative answers with AI visibility tracking.
A SERP API is a hosted service you call from Python that returns structured JSON for a search query. Your code sends a query with a Bearer token; the API handles proxies, rendering, and anti-bot logic, so you get parsed organic results, AI Overviews, and positions back without maintaining selectors.
Install the SDK (pip install cloro), store your key in the CLORO_API_KEY environment variable, then call client.monitor.google(query=...) — you get parsed JSON back. The quickstart above is a complete first call you can paste and run. Prefer raw HTTP? Every method maps to one authenticated POST you can call directly.
No — pip install cloro gives you a typed client that wraps the HTTP layer, with automatic retries on sync calls. When you need to fan out hundreds of queries per minute, use the async task queue (client.async_tasks.create_batch) rather than hand-rolling httpx with asyncio.
Yes. One client covers them all — client.monitor.chatgpt, .perplexity, .gemini, .copilot, and .grok — on the same credit pool. The call shape is identical across engines; only the method changes, so one client covers Google and every AI engine.
cloro bills a single credit pool: each engine has a fixed per-call credit cost and your plan sets the monthly credit allowance. See the pricing page for current plan rates (it has a calculator to size your volume), and the cheapest SERP API comparison for how per-call costs stack up against other providers.
The SDK retries 429 and 5xx responses with exponential backoff automatically. Cap your worker count — a ThreadPoolExecutor sized to your plan's concurrency limit — or for large batches use the async task queue, which absorbs concurrency for you rather than flooding the API.