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.
👉 Visit Crawlio | 📚 View API Docs
📦 Installation
pip install crawlio-py
🚀 Getting Started
from crawlio.client import Crawlio
from crawlio.types import ScrapeOptions
client = Crawlio(api_key="your-api-key")
options: ScrapeOptions = {
"url": "https://example.com",
"markdown": True
}
result = client.scrape(options)
print(result["markdown"])
🔐 Authentication
You must pass your Crawlio api_key when instantiating the client:
from crawlio.client import Crawlio
client = Crawlio(api_key="your_api_key")
🧭 Usage
scrape(options: ScrapeOptions) -> ScrapeResponse
Scrape a single webpage.
from crawlio.types import ScrapeOptions
client.scrape({
"url": "https://example.com",
"exclude": ["nav", "footer"],
"markdown": True
})
crawl(options: CrawlOptions) -> CrawlResponse
Start a full-site crawl.
from crawlio.types import CrawlOptions
client.crawl({
"url": "https://example.com",
"count": 10,
"sameSite": True
})
crawl_status(crawl_id: str) -> CrawlStatusResponse
Check the status of a crawl job.
client.crawl_status("crawl123")
crawl_results(crawl_id: str) -> CrawlResultResponse
Get results from a completed crawl.
client.crawl_results("crawl123")
search(query: str, options: Optional[SearchOptions] = None) -> SearchResponse
Search through previously scraped content.
client.search("privacy policy", {"site": "example.com"})
batch_scrape(options: BatchScrapeOptions) -> BatchScrapeResponse
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) -> BatchScrapeStatusResponse
Check the status of a batch scrape.
client.batch_scrape_status("batch456")
batch_scrape_result(batch_id: str) -> BatchScrapeResultResponse
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:
from crawlio.exception import CrawlioError
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.3.tar.gz.
File metadata
- Download URL: crawlio_py-0.1.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c0a57c7c17295cb6c466b77e5a3a788635903eccb497b2bf014594adf0cb6ab
|
|
| MD5 |
695ef9b6f1dc86b9fa4a54e91f5a0f2f
|
|
| BLAKE2b-256 |
4be4dfcdcf4873ad263cee21ec9eecc5328dbba2d9faaafd485b264e39abdab3
|
File details
Details for the file crawlio_py-0.1.3-py3-none-any.whl.
File metadata
- Download URL: crawlio_py-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.7 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 |
516f665b22cbceeb62f8395568a917ee967d114a3eb7038d49d302a153426d45
|
|
| MD5 |
f5bacbb0853b16dcf0b0db38a8eb53e6
|
|
| BLAKE2b-256 |
af899058df7e1aef67cb40fd4ed14098068a7096f7d782f076252cf53189db0f
|