Skip to content

Darko893/hauntapi-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haunt

hauntapi

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.

PyPI Python License: MIT

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.

Install

pip install hauntapi

Quick start

from hauntapi import Haunt

haunt = Haunt("your_api_key")          # or set HAUNT_API_KEY
result = haunt.extract("https://example.com/product", "product name and price")

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://example.com/docs", "the page content",
                       response_format="markdown")

Use it as an agent tool

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).

Why honest failure matters for agents

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.

Also in the box

  • haunt.extract_batch([...]) for many URLs in one call
  • haunt.extract_auth(...) for pages you are allowed to access with your own headers
  • haunt.usage() for remaining credits
  • Full REST and MCP docs: https://hauntapi.com/docs

MIT licensed.

About

Python SDK for Haunt API — extract clean data from any website with one API call.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages