langchain-skim
Give your LangChain agent the ability to read any URL — clean Markdown, ~4x smaller than raw HTML. No ads, no nav, no boilerplate.
langchain-skim is the official LangChain tool for Skim — the clean reader API for AI agents. It exposes one tool, SkimReader, that your agent can call to fetch any web page as agent-ready Markdown plus structured metadata (title, byline, published date, language, excerpt). Output is ~4x smaller than raw HTML — your agent spends fewer tokens and processes pages faster.
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 langchain-skim
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 langchain_skim import SkimReader
reader = SkimReader() # reads SKIM_API_KEY from the environment
markdown = reader.invoke({"url": "https://en.wikipedia.org/wiki/HTTP_402"})
print(markdown)
The tool returns clean Markdown with a YAML frontmatter block of metadata. ~4x smaller than the raw HTML, so your model processes it faster and with fewer tokens.
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.
Use it in an agent
SkimReader is a standard LangChain BaseTool, so it drops straight into any agent's tool list:
from langchain_skim import SkimReader
from langchain.agents import create_react_agent # or any agent constructor
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini")
tools = [SkimReader()]
agent = create_react_agent(llm, tools)
agent.invoke({"messages": [("user", "Read https://example.com/article and summarize it.")]})
The agent decides when to call skim_read, Skim returns clean Markdown, and the model gets ~4x less tokens to process.
Output shape
SkimReader returns Markdown with a YAML frontmatter block of the page metadata:
---
title: Example article
byline: Jane Doe
publishedAt: 2025-01-15
lang: en
excerpt: A short summary...
---
# Example article
The cleaned article body in Markdown...
Set include_metadata=False to get just the Markdown body.
Configuration
SkimReader takes the following parameters:
| Parameter | Default | Notes |
|---|---|---|
api_key |
$SKIM_API_KEY |
Card-plan API key (sk402_...). Get one free at skim402.com/pricing. Takes priority over private_key. |
private_key |
$SKIM_WALLET_PRIVATE_KEY |
Wallet lane only. Hex private key for the Base wallet. Ignored when api_key is set. |
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 |
Prepend a YAML frontmatter block of page metadata to the returned Markdown. |
timeout |
60 |
Per-request timeout in seconds. |
# Card key (recommended)
reader = SkimReader(api_key="sk402_...")
# Or wallet
reader = SkimReader(
private_key="0x...",
max_price_usd=0.005,
include_metadata=False,
)
Security
- No outbound telemetry from this package.
langchain-skimonly 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 langchain-skim 0.1.5
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 |
|---|---|---|---|---|
| langchain_skim-0.1.5.tar.gz | 198.6 kB | Without provenance | Details for langchain_skim-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_skim-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for langchain_skim-0.1.5-py3-none-any.whl |
Total release size: 206.9 kB
Release files / langchain_skim-0.1.5.tar.gz
| Download URL | langchain_skim-0.1.5.tar.gz |
|---|---|
| Size | 198.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd5efaee4e2d89794638762a3c9b45c0505faca6272be82dfabd0d4639de2079
|
|
BLAKE2b-256 checksum How to use checksums |
689d7a5c07b832142fbed12ed84f165ed8e79b17e8b341cd386d77c6063479f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / langchain_skim-0.1.5-py3-none-any.whl
| Download URL | langchain_skim-0.1.5-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c53a5b72390f33057161513d0287e53bd160156f89189bf064458327300b2643
|
|
BLAKE2b-256 checksum How to use checksums |
5e33d14a91de9ed2e7badb1283d5983175cba209734be2c634186620cbaa8834
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for langchain-skim 0.1.5
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.