Web extraction for AI agents. Turn any permitted public web page into clean JSON or Markdown with one call, as a plain client or a LangChain, LlamaIndex, or CrewAI tool.
Website · Docs · Get a free key · MCP server
Haunt reads a public page and hands your agent structured data back. When a page is blocked, login-walled, CAPTCHA-gated, or too thin to trust, it returns an honest machine-readable error instead of fabricated data, so your agent can retry, switch source, skip, or ask a human.
Free tier: 1,000 credits a month, no card.
pip install hauntapifrom hauntapi import Haunt
haunt = Haunt("your_api_key") # or set HAUNT_API_KEY
result = haunt.extract("https://news.ycombinator.com/", "the top five story titles")
if result.success:
print(result.data) # {"name": "...", "price": "..."}
else:
print(result.error_code) # access_denied, login_required, not_found, ...Markdown for RAG, notes, or .md files:
result = haunt.extract("https://fastapi.tiangolo.com/tutorial/", "the page content",
response_format="markdown")Map and crawl a bounded site on any paid plan:
site = haunt.map_site(
"https://fastapi.tiangolo.com/",
include_paths=["/tutorial/*"],
limit=100,
)
crawl = haunt.crawl_site(
"https://fastapi.tiangolo.com/tutorial/",
"the page title and main summary",
limit=10,
)
print(crawl.complete, crawl.partial, crawl.failed)
print(crawl.credits_used)Mapping costs no credits. Complete crawl pages use the normal extraction price; partial and failed pages cost nothing. Discovery respects robots rules, stays on the requested site, and Haunt does not store fetched crawl content.
The same client, wired into the framework you already use. Lazy imports, so you only need the one you install.
LangChain
from hauntapi import langchain_tool
tools = [langchain_tool()]LlamaIndex
from hauntapi import llamaindex_tool
tools = [llamaindex_tool()]CrewAI
from crewai import Agent
from hauntapi import crewai_tool
researcher = Agent(role="Researcher", tools=[crewai_tool()])Need the framework installed too? pip install "hauntapi[langchain]" (or llamaindex, crewai).
An agent that receives fabricated data from a blocked page acts on garbage and cannot tell. Haunt returns error codes like access_denied, login_required, captcha_required, and not_found, so your agent branches on reality instead of a hallucination.
haunt.extract_batch([...])for many URLs in one callhaunt.map_site(...)for up to 500 same-site URLs at zero credits on a paid planhaunt.crawl_site(...)for structured extraction across up to 20 mapped pageshaunt.extract_auth(...)for pages you are allowed to access with your own headershaunt.usage()for remaining credits- Full REST and MCP docs: https://hauntapi.com/docs
MIT licensed.