docs

First extraction, then details.

Do not read a manual before you see JSON. Try the fixed no-key demo, get a free key, then run one safe request.

activation_funnel_v1: demo response, free key, first-call copy.

Use the shortest path.

  1. Try demoNo key, fixed sample JSON.
  2. Get free key1,000 credits/month.
  3. Copy first callUse example.com before your real target.
  4. Choose MCP or RESTPick the integration after proof.
first call

First extraction in 60 seconds.

Copy your API key. Run one safe test against https://example.com. Check success before using data.

  1. Paste your key into HAUNT_API_KEY.
  2. Run this exact request against https://example.com.
  3. Only read data after success is true.
AI agent path
first-call curl
curl https://hauntapi.com/v1/extract \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $HAUNT_API_KEY" \
  -d '{"url":"https://example.com","prompt":"Extract the page title"}'
mcp

Connect your AI tool.

Use @hauntapi/mcp-server locally or call the hosted MCP endpoint at https://hauntapi.com/mcp/server. The no-key tool try_demo_extract gives agents a safe first success.

claude_desktop_config.json
{
  "mcpServers": {
    "haunt": {
      "command": "npx",
      "args": ["-y", "@hauntapi/mcp-server"],
      "env": { "HAUNT_API_KEY": "PASTE" }
    }
  }
}
rest

POST a URL. Get clean JSON.

Use X-API-Key or Authorization: Bearer ${HAUNT_API_KEY}. Start with public pages. Bring-your-own headers or cookies for authorized pages only; Haunt does not log in for you or bypass verification.

Python
import requests

resp = requests.post(
  "https://hauntapi.com/v1/extract",
  headers={"X-API-Key": "PASTE"},
  json={"url": "https://example.com", "prompt": "Extract the page title"}
)
payload = resp.json()
if not payload.get("success"):
  raise SystemExit(payload.get("error"))
print(payload["data"])
response modes

JSON, raw HTML, Markdown, or screenshot.

Default mode returns structured JSON. Set response_format to raw_html, markdown, or screenshot when you need browser/API parity instead of LLM extraction.

Screenshot mode returns a base64 image payload. Full-page screenshots have width, height, area, and byte caps and return screenshot_too_large instead of oversized images. Raw modes still use Haunt network guards and honest failure checks.

raw modes
curl https://hauntapi.com/v1/extract \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $HAUNT_API_KEY" \
  -d '{"url":"https://example.com","prompt":"Return Markdown","response_format":"markdown"}'

curl https://hauntapi.com/v1/extract \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $HAUNT_API_KEY" \
  -d '{"url":"https://example.com","prompt":"Take a screenshot","response_format":"screenshot","screenshot_full_page":true}'
trace

Trace beats blind JSON.

Every response includes one canonical trace object with "trace", "fetch", "extraction", and "confidence".

response shape
{
  "success": true,
  "data": { "title": "Example Domain" },
  "trace": { "fetch": { "source": "direct" }, "extraction": { "mode": "llm" }, "confidence": 0.96 }
}
honest failure

CAPTCHA and verification detection.

Haunt detects many CAPTCHA and human-verification blocks and returns clear failures. It does not solve CAPTCHAs, bypass login walls, or auto-handle CAPTCHA challenges. It returns captcha_required, login_required, access_denied, thin_public_content, or not_found when the page cannot support the requested extraction.

No matching data was visible. Try a narrower prompt. Check trace and evidence.

Bad first request

missing_api_key, invalid_api_key, invalid_request, monthly_quota_exceeded, and rate_limit_exceeded include next-action links.

not_found
{
  "error_code": "not_found",
  "mode": "not_found",
  "message": "Could not find requested data in the page content"
}
credits

Credit costs.

Credits are not one-to-one requests. Failed, blocked, login/CAPTCHA, provider, and server failures do not burn credits.

Extraction typeCredits
Simple public fetch or non-LLM output1
Normal structured extraction2
JavaScript-rendered or waited extraction4
Authenticated structured extraction4
Large, screenshot, or heavy browser extraction8
limits

Rate limits.

Respect Retry-After, add exponential backoff, and upgrade at pricing when monthly usage is the blocker.

PlanMonthly creditsRateScope
Free1,00010 req/minPublic pages only
Starter10,00030 req/minPublic pages only
Pro30,00060 req/minBring-your-own headers/cookies beta
Scale80,000120 req/minBYO headers/cookies beta and batch

Haunt does not bill automatic overages.