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.1.1.tar.gz (10.4 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.1.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file scrapio_py-1.1.1.tar.gz.

File metadata

  • Download URL: scrapio_py-1.1.1.tar.gz
  • Upload date:
  • Size: 10.4 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.1.1.tar.gz
Algorithm Hash digest
SHA256 2bbc54ab001db6bed5ce7885cb932db07febcdb3886da5c58794dc594a4b8d38
MD5 fe68ea6644df055471098994a8c6035e
BLAKE2b-256 1dc25a7f5cd1232f3e8929713c569760e0011ff46b7669664d37b9a14cb31bf0

See more details on using hashes here.

File details

Details for the file scrapio_py-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: scrapio_py-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3bb406b6a48619ec297eb9f6408b4a622de438e82a6acb43a6804537b61177c6
MD5 114bf89c61c1f597c262bd582a6ee175
BLAKE2b-256 dc3b856a6cfd7509417bb7c002978ca313c52796fa9b99d46391b445e0c72d2b

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.2

2 files

This release

1.1.1 This release

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