scrapio
Official Python SDK for Scrapio — fetch, crawl, search, and extract structured data from any URL.
Install
pip install scrapio-py
Requires Python 3.9 or later.
Quickstart
from scrapio import ApiClient, FetchRequest
client = ApiClient(api_key="YOUR_API_KEY")
result = client.fetch.fetch(FetchRequest(
url="https://example.com",
output=["markdown"],
))
print(result.outputs["markdown"])
Usage
Fetch a page
result = client.fetch.fetch(FetchRequest(
url="https://news.ycombinator.com",
render_js=True,
output=["markdown"],
))
Google Search
from scrapio import GoogleSearchParams
results = client.google.search(GoogleSearchParams(
search="best web scraping API 2025",
country_code="us",
))
print(results.organic_results)
Amazon product
product = client.amazon.get_product("B08N5WRWNW")
print(product.title, product.price)
Walmart search
items = client.walmart.search("headphones")
YouTube transcript
video = client.youtube.get_video("dQw4w9WgXcQ")
Browser automation
result = client.interact.interact({
"url": "https://example.com",
"actions": [
{"type": "click", "selector": "#login"},
{"type": "type", "selector": "#email", "text": "user@example.com"},
],
})
Crawl a site
result = client.crawl.crawl({
"seeds": ["https://docs.example.com"],
"max_pages": 50,
})
Async jobs
from scrapio import CreateJobRequest
job = client.jobs.create(CreateJobRequest(
kind="fetch",
input={"url": "https://example.com", "output": ["markdown"]},
))
result = client.jobs.wait_for_completion(job.job_id, poll_interval=2.0, timeout=120.0)
Async client
import asyncio
from scrapio import AsyncApiClient, FetchRequest
async def main():
async with AsyncApiClient(api_key="YOUR_API_KEY") as client:
result = await client.fetch.fetch(FetchRequest(
url="https://example.com",
output=["markdown"],
))
print(result.outputs["markdown"])
asyncio.run(main())
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
api_key |
str |
required | Your API key |
base_url |
str |
https://api.scrapio.dev |
Override for local/staging |
timeout |
float |
30.0 |
Per-request timeout (seconds) |
max_retries |
int |
3 |
Max retries on 429/503 |
Error handling
from scrapio import (
ApiClient, FetchRequest,
AuthError, RateLimitError, CreditsExhaustedError, ApiError,
)
try:
client.fetch.fetch(FetchRequest(url="https://example.com"))
except AuthError:
print("Invalid API key")
except CreditsExhaustedError:
print("No credits remaining")
except RateLimitError:
print("Rate limited — back off and retry")
except ApiError as e:
print(f"API error {e.status_code}: {e}")
Links
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scrapio_py-1.2.0.tar.gz
(12.6 kB
view details)
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 scrapio_py-1.2.0.tar.gz.
File metadata
- Download URL: scrapio_py-1.2.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03485fb32a24320178818619d12d775e8c65c36449f45310df538d64a1eaf49a
|
|
| MD5 |
c2f2669bfec1672fd527cfdd9b7b4c38
|
|
| BLAKE2b-256 |
900bf0106c423f3ad4a5933929e1e391ebac574e78716b50562d5bd9cd57ac7e
|
File details
Details for the file scrapio_py-1.2.0-py3-none-any.whl.
File metadata
- Download URL: scrapio_py-1.2.0-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07852dce977c97b479afdf21204bcb216553b8ab129e6347c88c13ce89dd68ff
|
|
| MD5 |
033faf8a6aef5745bfa8767bea443468
|
|
| BLAKE2b-256 |
e75dbe8ad8a4f2d7eca01070a4f689bba4872b3484902eef0d8e469959c2d34d
|