Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapio_py-1.2.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

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

Hashes for scrapio_py-1.2.0.tar.gz
Algorithm Hash digest
SHA256 03485fb32a24320178818619d12d775e8c65c36449f45310df538d64a1eaf49a
MD5 c2f2669bfec1672fd527cfdd9b7b4c38
BLAKE2b-256 900bf0106c423f3ad4a5933929e1e391ebac574e78716b50562d5bd9cd57ac7e

See more details on using hashes here.

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

Hashes for scrapio_py-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07852dce977c97b479afdf21204bcb216553b8ab129e6347c88c13ce89dd68ff
MD5 033faf8a6aef5745bfa8767bea443468
BLAKE2b-256 e75dbe8ad8a4f2d7eca01070a4f689bba4872b3484902eef0d8e469959c2d34d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page