skim-haystack
Give your Haystack pipelines the ability to read any URL — clean Markdown, ~4x smaller than raw HTML. No ads, no nav, no boilerplate.
skim-haystack is the official Haystack integration for Skim — the clean reader API for AI agents. It provides one component, SkimReader, that fetches any web page and returns it as a Haystack Document (clean Markdown in content, structured metadata in meta). Output is ~4x smaller than raw HTML — your pipeline processes more pages with fewer tokens.
Two ways to pay: card plan with API key (free tier: 1,000 reads/month — skim402.com/pricing) or x402 wallet pay-per-call ($0.002 USDC on Base, no account needed).
See it before you wire it: try Skim free in your browser — 10 free skims a day, no wallet, no signup. Paste a URL, see exactly what your agent gets back.
Install
pip install skim-haystack
Quickstart (60 seconds)
1. Get a free API key
Go to skim402.com/pricing, sign up for the free plan (1,000 reads/month), and copy your sk402_... key.
2. Set the env var
export SKIM_API_KEY=sk402_your_key_here
3. Use it
from skim_haystack import SkimReader
reader = SkimReader() # reads SKIM_API_KEY from the environment
result = reader.run(urls="https://en.wikipedia.org/wiki/HTTP_402")
print(result["documents"][0].content)
Alternative: pay per call with a crypto wallet
If you prefer x402 wallet pay-per-call instead of a card plan:
export SKIM_WALLET_PRIVATE_KEY=0xYOUR_BASE_WALLET_PRIVATE_KEY
Fund a dedicated Base wallet with a small USDC balance. Each read costs $0.002 on Base. Full setup guide: https://skim402.com/wallet.
Use a fresh wallet, not your personal one. This wallet's private key signs payment authorizations on your machine — treat it like a hot wallet for paying $0.002 tolls, not a savings account.
Or configure explicitly with Haystack Secrets:
from haystack.utils import Secret
from skim_haystack import SkimReader
reader = SkimReader(
private_key=Secret.from_token("0x..."),
max_price_usd=0.005,
include_metadata=True,
)
Use it in a pipeline
SkimReader is a standard Haystack component, so it drops straight into a Pipeline. Here it fetches a page and feeds the cleaned Markdown into a prompt:
from haystack import Pipeline
from haystack.components.builders import PromptBuilder
from haystack.components.generators import OpenAIGenerator
from skim_haystack import SkimReader
pipe = Pipeline()
pipe.add_component("reader", SkimReader())
pipe.add_component("prompt", PromptBuilder(
template="Summarize this article in 5 bullets:\n\n{{ documents[0].content }}"
))
pipe.add_component("llm", OpenAIGenerator(model="gpt-4o-mini"))
pipe.connect("reader.documents", "prompt.documents")
pipe.connect("prompt.prompt", "llm.prompt")
result = pipe.run({"reader": {"urls": "https://en.wikipedia.org/wiki/HTTP_402"}})
print(result["llm"]["replies"][0])
Output shape
SkimReader.run(...) returns {"documents": [Document, ...]} — one Document per URL:
Document.content— the cleaned article body in Markdown.Document.meta— always includessource(the URL), plus page metadata (title,byline,publishedAt,lang,excerpt, ...) unlessinclude_metadata=False.
Configuration
SkimReader takes the following parameters:
| Parameter | Default | Notes |
|---|---|---|
api_key |
Secret.from_env_var("SKIM_API_KEY", strict=False) |
Card-plan API key. Get one free at skim402.com/pricing. Takes priority over private_key. |
private_key |
Secret.from_env_var("SKIM_WALLET_PRIVATE_KEY", strict=False) |
Wallet lane only. Hex Base wallet private key. Ignored when api_key resolves. |
base_url |
https://skim402.com |
Override the API base URL. For self-hosting or local development. |
max_price_usd |
0.01 |
Wallet lane only. Hard cap on per-call price in USD. Skim is $0.002/call. |
include_metadata |
True |
Populate each Document's meta with page metadata. |
timeout |
60 |
Per-request timeout in seconds. |
The component supports pipeline serialization (to_dict/from_dict). When the key comes from an environment variable (the default), it is stored as a reference to that variable name — never the raw value. An inline Secret.from_token("...") is runtime-only and will not serialize.
Security
- No outbound telemetry from this package.
skim-haystackonly talks toskim402.com(or whatever you set asbase_url). No analytics, no error reporting, no phone-home. - Wallet lane: the private key only signs payment authorizations locally — it never leaves your machine.
Links
- Skim website — https://skim402.com
- Pricing & free key — https://skim402.com/pricing
- Wallet setup guide — https://skim402.com/wallet
- API docs — https://skim402.com/docs
- GitHub — https://github.com/JessieJanie/skim402
License
MIT
Metadata
Release files for skim-haystack 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| skim_haystack-0.1.4.tar.gz | 10.1 kB | Without provenance | Details for skim_haystack-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| skim_haystack-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for skim_haystack-0.1.4-py3-none-any.whl |
Total release size: 18.3 kB
Release files / skim_haystack-0.1.4.tar.gz
| Download URL | skim_haystack-0.1.4.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d143962156f2c557bf77a0f656bce74387167d91e867bf447b7234f3244e04b
|
|
BLAKE2b-256 checksum How to use checksums |
437c932e0d8e12ec243c712729d79afb9a343a5dfde69fd32b0c986eb5198057
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / skim_haystack-0.1.4-py3-none-any.whl
| Download URL | skim_haystack-0.1.4-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fc3f09b25fa20dc72b74ff19a1a9542404b01b1a88db62c5029be77188da9d7
|
|
BLAKE2b-256 checksum How to use checksums |
8df58d4e03afc6156443c516c744955b7a3f8e09dcd870bedace1be904ceedd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for skim-haystack 0.1.4
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.