Python SDK for the Crawlio web scraping API
Project description
🕷️ Crawlio Python SDK
Crawlio is a Python SDK for accessing the Crawlio API — a powerful service for web scraping, crawling, and content analysis. It supports single-page scraping, full site crawling, batch operations, and structured search across results.
📦 Installation
pip install crawlio-py
🚀 Getting Started
from crawlio.client import Crawlio
client = Crawlio(api_key="your-api-key")
result = client.scrape({
"url": "https://example.com",
"markdown": True
})
print(result["markdown"])
🔐 Authentication
You must pass your Crawlio api_key when instantiating the client.
client = Crawlio(api_key="your_api_key")
🧭 Usage
scrape(options: dict) -> dict
Scrape a single webpage.
client.scrape({
"url": "https://example.com",
"exclude": ["nav", "footer"],
"markdown": True
})
crawl(options: dict) -> dict
Start a full-site crawl.
client.crawl({
"url": "https://example.com",
"count": 10,
"sameSite": True
})
crawl_status(crawl_id: str) -> dict
Check the status of a crawl job.
client.crawl_status("crawl123")
crawl_results(crawl_id: str) -> dict
Get results from a completed crawl.
client.crawl_results("crawl123")
search(query: str, options: dict = None) -> dict
Search through previously scraped content.
client.search("privacy policy", {"site": "example.com"})
batch_scrape(options: dict) -> dict
Submit multiple URLs for scraping at once.
client.batch_scrape({
"url": ["https://a.com", "https://b.com"],
"options": {"markdown": True}
})
batch_scrape_status(batch_id: str) -> dict
Check the status of a batch scrape.
client.batch_scrape_status("batch456")
batch_scrape_result(batch_id: str) -> dict
Retrieve results of a completed batch scrape.
client.batch_scrape_result("batch456")
🧨 Error Handling
All exceptions inherit from CrawlioError.
Exception Types
| Exception Class | Description |
|---|---|
CrawlioError |
Base error class |
CrawlioRateLimit |
Too many requests |
CrawlioLimitExceeded |
API usage limit exceeded |
CrawlioAuthenticationError |
Invalid or missing API key |
CrawlioInternalServerError |
Server error |
CrawlioFailureError |
Other client or server failure |
Example:
try:
result = client.scrape({"url": "https://example.com"})
except CrawlioError as e:
print(f"Error: {e}, Details: {e.response}")
📄 Response Format (Example)
Scrape
{
"jobId": "abc123",
"html": "<html>...</html>",
"markdown": "## Title",
"meta": {"title": "Example"},
"urls": ["https://example.com/about"],
"url": "https://example.com"
}
📃 License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crawlio_py-0.1.0.tar.gz.
File metadata
- Download URL: crawlio_py-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb78b8c40d29f91a84c592685da332bc149fea4add46139fa20e187ea495a60d
|
|
| MD5 |
cd61c968340cf84e42d170c9ea2a56c5
|
|
| BLAKE2b-256 |
377e2d4145de3989335dde66da8a3751b231ae0de4010c1ded6243eb5c9796bc
|
File details
Details for the file crawlio_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: crawlio_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dafbac83299441028c4ccd186895de82ab69f6ea94a403b6db516626cd22cf7
|
|
| MD5 |
2e7011e252bd2e945061bf486bb6c9a2
|
|
| BLAKE2b-256 |
fc2f03ecc93992cadf70553ae5aa0ca7c3dc8aeaed42a7588278e8c26715387b
|