Skip to main content

readfetch-client

Python x402 REST client for readfetch.com — all published catalog routes plus feedback and claims.

Checkout: tools/client-py. GitHub: ./scripts/publish-client-py.sh.

Install

pip install readfetch-client

Use

from readfetch import Client

rf = Client(private_key="0x…")  # funded account with USDC on Base; or export EVM_PRIVATE_KEY
result = rf.fetch("https://example.com/article")
print(result["text"])

fetch() calls /v1/text (article text in the JSON). x402 402 → sign → retry is automatic. Inside asyncio, use await rf.text(url) instead of sync fetch().

Lower-level API (async helpers, every catalog route):

export EVM_PRIVATE_KEY=0x…   # paid routes only
import asyncio
from readfetch import Client

async def main():
    rf = Client()
    check = await rf.probe_async("https://example.com")
    if not check.get("challenge"):
        await rf.fetch_async("https://example.com")
    page = await rf.call("map", {"url": "https://example.com", "limit": 20})
    job = await rf.call("crawl", {"url": "https://example.com", "max_pages": 3})
    await rf.call("crawl_status", None, path_params={"id": job["job_id"]})

asyncio.run(main())

Named helpers: readfetch_text, readfetch_map, readfetch_scrape, readfetch_residential, readfetch_fetch, readfetch_batch, readfetch_pdf, readfetch_section, readfetch_diff, readfetch_screenshot, readfetch_search, readfetch_crawl, readfetch_crawl_status. Generic: await call("search", {"query": "…"}).

Payment (x402)

Paid routes use x402 + x402HttpxClient: on 402, the client signs and retries. No key is required for quotes.

from readfetch_client import (
    payment_config,
    quote,
    call_with_meta,
    x402_http_client,
)

print(payment_config())  # base_url, network, max_payment_usd, buyer_address, signing_ready

q = await quote("text", {"url": "https://example.com"})  # 402 + payment_required

meta = await call_with_meta("text", {"url": "https://example.com"})
# meta["data"], meta["request_id"], meta["payment"] (receipt, payment_response, …)

async with x402_http_client() as http:
    ...

pay(name, body) aliases call() for paid endpoints.

Environment

Variable Default Purpose
EVM_PRIVATE_KEY / X402_BUYER_KEY — Required before paid calls
READFETCH_BASE_URL https://readfetch.com Production host only unless dev
READFETCH_MAX_PAYMENT_USD 1 Per-payment spend cap
READFETCH_DEV=1 off Allow local base URL for integration tests

MCP: @readfetch/mcp-x402-proxy@0.1.15. Feedback: docs#feedback.

Metadata

Release files for readfetch-client 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for readfetch-client 0.1.16
File Size Uploaded Provenance Actions
readfetch_client-0.1.16.tar.gz 172.5 kB Without provenance Details for readfetch_client-0.1.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for readfetch-client 0.1.16
File Interpreter ABI Platform Actions
readfetch_client-0.1.16-py3-none-any.whl Python 3 none any Details for readfetch_client-0.1.16-py3-none-any.whl

Total release size: 184.0 kB

Release files / readfetch_client-0.1.16.tar.gz

Download URL readfetch_client-0.1.16.tar.gz
Size 172.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cc48d45757d2c6c8413b8311ec29eefe8d5eb895407f6385f668d2aad9149d7c
BLAKE2b-256 checksum
How to use checksums
c7a16311d5121b1df67dbdc222f4d57b8196e1112cd93ba38063d2ddba790eaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / readfetch_client-0.1.16-py3-none-any.whl

Download URL readfetch_client-0.1.16-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78cfa5ae2b6f5524acf91af84bb2538bdf7d42efc3acadaf2acd65da963bdc0d
BLAKE2b-256 checksum
How to use checksums
1ba7db07a72245ada32e0c588908c8e2bef764b9e003c90794b9f3e7d9dbb463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for readfetch-client 0.1.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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