Crawlora Docs
Use the official Python SDK for application code, or copy raw requests examples for data pipelines, notebooks, scheduled jobs, JSONL exports, and analysis workflows.
The current promoted SDK tag is v1.5.0-sdk.3. PyPI publication is not enabled yet, so install from the explicit Git tag.
pip install "git+https://github.com/Crawlora-org/crawlora-python-sdk.git@v1.5.0-sdk.3"
Use environment variables for secrets and keep Crawlora API keys server-side.
import os
import requests
API_KEY = os.environ["CRAWLORA_API_KEY"]
BASE_URL = "https://api.crawlora.net/api/v1"
payload = {
"country": "us",
"keyword": "chatgpt",
"language": "en",
"limit": 10,
"page": 1
}
response = requests.request(
"POST",
f"{BASE_URL}/google/search",
headers={
"x-api-key": API_KEY,
"Content-Type": "application/json",
},
json=payload,
timeout=60,
)
try:
data = response.json()
except ValueError:
data = {"raw": response.text}
if not response.ok:
raise RuntimeError(f"Crawlora request failed: {response.status_code} {data}")
print(data)import json
keywords = ["project management software", "crm for startups", "sales automation"]
with open("crawlora-search-results.jsonl", "w", encoding="utf-8") as output:
for keyword in keywords:
try:
data = crawlora_request(
"/google/search",
{"keyword": keyword, "country": "us", "language": "en", "limit": 10, "page": 1},
)
output.write(json.dumps({"keyword": keyword, "response": data}) + "\n")
except RuntimeError as exc:
output.write(json.dumps({"keyword": keyword, "error": str(exc)}) + "\n")import time
import requests
def request_with_retry(method, url, **kwargs):
retryable = {429, 500, 502, 503, 504}
for attempt in range(1, 4):
response = requests.request(method, url, timeout=60, **kwargs)
if response.ok:
return response
if response.status_code not in retryable or attempt == 3:
raise RuntimeError(f"Crawlora request failed: {response.status_code} {response.text}")
time.sleep(min(2 ** (attempt - 1), 8))Crawlora is designed for responsible structured public web data workflows. Customers are responsible for using Crawlora in compliance with applicable laws, third-party rights, target-platform rules, and Crawlora terms.
Read Crawlora termsInstall the official SDK for generated endpoint groups, then open endpoint docs to confirm required fields, response structures, and credit cost before scheduling jobs.