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.2.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.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scrapio_py-1.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ea886aa7e40589eb4ff7bac9d47a0cf435cfb43ce7963d101d65e5c1d4d0e8c0
MD5 f14d0566727b3b612356d4c0644b949c
BLAKE2b-256 2a95d48a31940b054383b53a9fef503d76fa6df018742c27a6c76355611bd0be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scrapio_py-1.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69a0441cef190c46a0ca3b51c13cd5967e23d75c853db010a551ecec9f078210
MD5 b22b1bfc05ee2432e9eb0ba54eabc8e9
BLAKE2b-256 dd3d7ad36c023626371503ddbbdc166df82a41f6c99b7ef3e285813b3d51cc48

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

This release

1.1.2 This release

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