Official Python client for the Scraping SaaS REST API
Project description
fetchora — Python SDK
Official Python client for the Scraping SaaS REST API. Sync + async interfaces,
zero-setup auth (SCRAPING_API_KEY env var), wait-with-fallback semantics.
Install
pip install fetchora
Requires Python 3.9+.
Quickstart
from fetchora import ScrapingClient
client = ScrapingClient() # SCRAPING_API_KEY read from env
page = client.scrape("https://example.com")
print(page["result"]["markdown"])
import asyncio
from fetchora import AsyncScrapingClient
async def main():
async with AsyncScrapingClient() as client:
page = await client.scrape("https://example.com")
print(page["result"]["markdown"])
asyncio.run(main())
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
SCRAPING_API_KEY |
yes (unless passed explicitly) | — | Bearer token |
SCRAPING_BASE_URL |
no | https://api.scraping.io |
Override for self-hosted / dev |
API reference
| Method | REST |
|---|---|
get_balance() |
GET /v1/billing/balance |
scrape(url, *, wait=True, wait_timeout_s=60, cookies=None, format="markdown") |
POST /v1/scrape + poll |
get_scrape_status(task_id) |
GET /v1/scrape/{id} |
crawl(urls, *, wait=True, wait_timeout_s=600, cookies=None, include_items=True) |
POST /v1/crawl + poll |
get_crawl_status(crawl_id, *, include_items=True) |
GET /v1/crawl/{id} + fan-out |
On wait=True timeout → ScrapingTimeoutError. On wait=False → returns {"task_id": ...} / {"crawl_id": ...} immediately.
Errors
All errors inherit from fetchora.ScrapingError:
| Class | Code | Trigger |
|---|---|---|
InvalidApiKeyError |
invalid_api_key |
401 |
InsufficientBalanceError |
insufficient_balance |
402 |
ForbiddenError |
forbidden |
403 |
NotFoundError |
not_found |
404 |
AlreadyTerminalError |
already_terminal |
409 |
InvalidInputError |
invalid_input |
400, 422 |
ServerError |
server_error |
5xx |
ScrapingTimeoutError |
timeout |
SDK wait-timeout |
License
MIT. See repo root for source.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 fetchora-0.1.0.tar.gz.
File metadata
- Download URL: fetchora-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85e6f49e5c9475c7a37e5e49cbfe5cde22b53ef4e6c9c936e5e023d7cf60ed0b
|
|
| MD5 |
3b7de483f893d40240b29e186d9dbd5b
|
|
| BLAKE2b-256 |
8b34ea6a5a3f43ca39eee29897e5806f6cb4ff8f1db00ddb94065dbd9f273e57
|
Provenance
The following attestation bundles were made for fetchora-0.1.0.tar.gz:
Publisher:
publish-python-sdk.yml on Nodirbek2001/scraper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fetchora-0.1.0.tar.gz -
Subject digest:
85e6f49e5c9475c7a37e5e49cbfe5cde22b53ef4e6c9c936e5e023d7cf60ed0b - Sigstore transparency entry: 1366490752
- Sigstore integration time:
-
Permalink:
Nodirbek2001/scraper@07fc14d48179a261ffd617c59a0d8070eebd8d67 -
Branch / Tag:
refs/tags/sdk-python-v0.1.0 - Owner: https://github.com/Nodirbek2001
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@07fc14d48179a261ffd617c59a0d8070eebd8d67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fetchora-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fetchora-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9fbc8f9d08abdc802cc08dc5dbef545af0ca3c6bfbe6f3435e7702affbb8fb6
|
|
| MD5 |
d0eaf7eec05367ae73612794f3128670
|
|
| BLAKE2b-256 |
e63bcb0f8977d64ae2e589a7c2c63b6e4d6435ed214661f0d398e8e245ed3cee
|
Provenance
The following attestation bundles were made for fetchora-0.1.0-py3-none-any.whl:
Publisher:
publish-python-sdk.yml on Nodirbek2001/scraper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fetchora-0.1.0-py3-none-any.whl -
Subject digest:
e9fbc8f9d08abdc802cc08dc5dbef545af0ca3c6bfbe6f3435e7702affbb8fb6 - Sigstore transparency entry: 1366490841
- Sigstore integration time:
-
Permalink:
Nodirbek2001/scraper@07fc14d48179a261ffd617c59a0d8070eebd8d67 -
Branch / Tag:
refs/tags/sdk-python-v0.1.0 - Owner: https://github.com/Nodirbek2001
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@07fc14d48179a261ffd617c59a0d8070eebd8d67 -
Trigger Event:
push
-
Statement type: