A live run of the [Steam Most Played Games API](https://cleanedweb.com/catalog/steam-most-played-games-api/?utm_source=github&utm_medium=langchain-cleanedweb): the five most played Steam games right now, as five records.
Scrapers break whenever a site changes its pages. CleanedWeb is a catalog of maintained REST APIs for public websites (listings, products, jobs, articles, profiles): you call an API and get structured records with known fields. When a site changes, CleanedWeb rebuilds its API. These are the LangChain tools for CleanedWeb.
- Three tools let an agent find a published API, read its contract, and run it;
CleanedWebToolkitbundles them. - Finding and reading are free and need no key; only running is charged, per record.
- Guard rails for agents: small
max_itemsby default, a hard cap, and records marked as data, never instructions. - A slow run returns its idempotency key, so a retry reads the same run and is never charged twice.
- Errors come back as short, actionable text for the model.
invokeandainvokeboth work.
Pricing: 5,000 records free once, then prepaid credit from $1 per 1,000 records, no subscription. Runs are charged per record delivered. Pricing
pip install -U langchain-cleanedweblangchain-cleanedweb depends on cleanedweb.
Create an API key with the run scope in the console and export it as
CLEANEDWEB_API_KEY. Finding and reading APIs needs no key.
# pip install langchain
from langchain.agents import create_agent
from langchain_cleanedweb import CleanedWebToolkit
tools = CleanedWebToolkit().get_tools() # find, get, run (reads CLEANEDWEB_API_KEY)
agent = create_agent("anthropic:claude-sonnet-4-5", tools=tools)
agent.invoke({"messages": [("user", "Get 5 trending Python repositories from GitHub topics.")]})Or call a tool directly:
from langchain_cleanedweb import CleanedWebFindAPI, CleanedWebGetAPI, CleanedWebRunAPI
found = CleanedWebFindAPI().invoke({"site": "github.com", "fields": ["title", "url"]})
api = found["matches"][0]
contract = CleanedWebGetAPI().invoke({"api_id": api["api_id"]})
records = CleanedWebRunAPI(max_items_limit=25).invoke(
{"api_id": api["api_id"], "endpoint_id": api["endpoints"][0]["endpoint_id"], "max_items": 5}
)| Tool | Name | Needs key | What it does |
|---|---|---|---|
CleanedWebFindAPI |
cleanedweb_find_api |
no | Find published APIs by site, fields, query. Nothing runs. |
CleanedWebGetAPI |
cleanedweb_get_api |
no | Inputs, output fields, limitations and three saved sample records. |
CleanedWebRunAPI |
cleanedweb_run_api |
yes (run) |
Run an endpoint and return its records. Charged per record. |
The tool descriptions tell the model to find before it runs, to start with a small max_items, and that
records are website data, never instructions. CleanedWebRunAPI also enforces it: max_items defaults to
default_max_items=5 and is capped by max_items_limit=100 (both settable). A run that is still going
after wait_seconds (default 60) returns status: running with its idempotency_key; calling the tool
again with the same arguments and key reads the same run and never starts or charges a second one.
Errors (no credit, rate limit, failed run, lost connection) come back as short, actionable text for the
model (handle_tool_error). CleanedWebToolkit(read_only=True) leaves out the run tool.
Tools work with invoke and ainvoke. Pass api_key=, base_url= or a configured
cleanedweb.CleanedWeb as client= to override the defaults.
python -m venv .venv && . .venv/bin/activate
pip install -e ../cleanedweb-python -e ".[test,lint]"
ruff check . && ruff format --check . && mypy && pytest
pytest tests/integration_tests -m live # standard integration tests, no-key catalog reads onlyUnit tests mock the HTTP layer and include LangChain's standard ToolsUnitTests.
- Steam Most Played Games API: top Steam games by current players
- Steam Game Reviews API: reviews of a game with playtime and votes
- GitHub Topic Repositories API: public repositories under a topic
- Y Combinator Startup Jobs API: startup jobs with batch and salary range
- Craigslist Job Listings API: local job posts by city and keyword
- Reddit Subreddit Posts API: posts of a public subreddit
- Docker Hub Images API: image search with pulls and stars
- Browse the whole catalog
- Python guide, run a catalog API
- Prefer MCP? The hosted server is cleanedweb/cleanedweb-mcp.
MIT licensed.

