spectrawl icon indicating copy to clipboard operation
spectrawl copied to clipboard

README: Fix documentation gaps causing agent confusion

Open FayAndXan opened this issue 8 months ago • 0 comments

Problem

Multiple features are undocumented or poorly documented, causing AI agents (and humans) to miss capabilities or use them incorrectly. Xan couldn't find the screenshot command despite it existing — that's a discoverability failure.

Gaps Found (audit of README vs actual codebase)

1. Screenshot — buried, no examples

Current: One-liner { "url": "...", "screenshot": true } and page.screenshot // PNG buffer Missing:

  • No dedicated section
  • No example of what the response looks like (base64 string via HTTP, Buffer via JS)
  • fullPage option exists in code but isn't documented
  • No mention that screenshots bypass cache

Fix: Add a ## Screenshots section with HTTP and JS examples:

POST /browse { "url": "...", "screenshot": true, "fullPage": true }
// Response: { "content": "...", "screenshot": "base64-png-data..." }

2. HTTP API response shapes — completely missing

No single example of what any endpoint returns as JSON. An agent calling /search or /browse has no idea what fields to expect.

Fix: Add response examples for each endpoint:

// POST /search response
{
  "results": [{ "title": "...", "url": "...", "snippet": "...", "content": "..." }],
  "answer": "AI summary (if summarize: true)",
  "cached": false
}

// POST /browse response  
{
  "content": "extracted markdown...",
  "url": "https://...",
  "title": "Page Title",
  "statusCode": 200,
  "screenshot": "base64... (if requested)",
  "cached": false
}

3. Deep Search vs Search — confusing

JS API has both web.search() and web.deepSearch() but the HTTP API only shows POST /search. How does an HTTP user trigger deep search? The mode parameter isn't documented.

Fix: Document both modes in HTTP section, or clarify that /search IS deep search by default.

4. Browse options — only screenshot shown

Code accepts: screenshot, fullPage, html, auth, stealth, camoufox, noCache README shows: only screenshot

Fix: Document all browse options:

POST /browse {
  "url": "https://...",
  "screenshot": true,
  "fullPage": true,
  "html": true,
  "stealth": true,
  "auth": "platform:account"
}

5. Proxy configuration — undocumented

Config supports proxy (browse.proxy: { host, port, username, password }) and CLI has spectrawl proxy, but README doesn't explain either.

6. CAPTCHA solver — exists but not mentioned

captcha-solver.js uses Gemini Vision for image CAPTCHAs. Not mentioned anywhere in README.

7. Events system — undocumented

8 events exist (cookie_expiring, cookie_expired, auth_failed, auth_refreshed, rate_limited, action_failed, action_success, health_check) plus wildcard handler. Not in README.

8. Config defaults — incomplete

README shows a minimal spectrawl.json example. Actual defaults include:

  • browse.humanlike (minDelay, maxDelay, scrollBehavior)
  • browse.proxy
  • cache.screenshotTtl
  • concurrency: 3
  • Rate limit defaults per platform

None of these are documented.

9. Anti-bot detection — undersold

The _isBlocked() detection and automatic escalation from Playwright → Camoufox is a key feature but barely mentioned. The auto-fallback chain should be prominently documented.

10. Error format — undocumented

Errors return { "error": "message" } but this isn't documented. Agents need to know what error responses look like.

11. MCP tools — 5 tools listed but details missing

MCP section just says "5 tools" without listing their schemas or showing what parameters each accepts.

Priority

Items 1-4 are highest priority — these are the ones that will cause real confusion for agents and developers.

Labels

documentation, good first issue

FayAndXan avatar Mar 13 '26 18:03 FayAndXan