Skip to main content

Extract structured data from permitted public pages with one API call. Haunt API Python SDK.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hauntapi-1.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hauntapi-1.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file hauntapi-1.1.0.tar.gz.

File metadata

  • Download URL: hauntapi-1.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hauntapi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8667fd2922162c936ebd1c2ff97a2656e3cbc3e576b7010a7d0c8e5123988b48
MD5 16da66aec6dbb37e555a5982c0563f74
BLAKE2b-256 b5049336df405384ec6e4174bcb0ccd5b36aefc24a245f1ee44d6a7b4ec179ef

See more details on using hashes here.

File details

Details for the file hauntapi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: hauntapi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hauntapi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c61a76772203ff7bc7c8a000c1681e6df565d83573bba2881204cc49ca0c13a
MD5 b5657539b5f1a60f560a0aee824d11a5
BLAKE2b-256 59458063dc947da0bfbc01ee333fd0b528093b3813a09487c2ef6ab45cdf5a5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page