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(
    job_type="fetch",
    payload={"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.0.tar.gz (9.5 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.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scrapio_py-1.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for scrapio_py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8578fab0bbb57a2fd2b56a8316fdf1fcae2ab02c653510d0db0378275b95b19c
MD5 60ba885d3d598f1a6ae33f59ed9cea29
BLAKE2b-256 f4327ff0c74e6a54f99f4a4db4581cba0844772075a7bf95c75c1246298bd865

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scrapio_py-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for scrapio_py-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9be5bb9dae332614c23a8652b16e7a5a449dc0e17e15b5174c30aee30601bbac
MD5 7edd5c44ee2979fb2c5a400089673a8e
BLAKE2b-256 a0641f48ba2f489ed89a7df32ab2b041a3bcf7e263251261f335593525d798b6

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

This release

1.1.0 This release

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