Agent Web Search, Clean Markdown & Token FinOps API
Grounded multi-engine web search with Reciprocal Rank Fusion (RRF), SSRF-hardened HTML-to-Markdown extraction cutting LLM prompt tokens by 65%–85%, deterministic token budgets, and schema-grounded entity extraction with SHA-256 provenance.
Core REST Endpoints
Base path: https://api.contextapi.dev/search (or /api/search via local portal proxy).
| Method | Path | Cost | Capabilities |
|---|---|---|---|
| POST | /v1/search | 1 credit | Concurrent fan-out across Google News RSS, DuckDuckGo, Tavily, Serper, Brave & RRF fusion with source authority tiers. |
| POST/GET | /v1/extract | 1 credit | Strips DOM noise, scripts & navbars into dense Markdown with YAML frontmatter and exact tiktoken savings metrics. |
| POST | /v1/extract/batch | Pay-Per-Success | Batch extract multiple public URLs; upstream 502 errors cost 0 credits (1-credit minimum floor). |
| POST | /v1/agent-extract | 5 credits | Zero-hallucination schema extraction of dates, monetary thresholds & contacts with SHA-256 DOM snapshot hash. |
| GET | /v1/archive / /v1/archive/{doc_id} | 1 credit | Retrieve tenant-isolated archived extractions scoped strictly to your API key's key_id. |
Quickstart & Hosted MCP Integration
Connect directly via REST or register https://api.contextapi.dev/search/mcp in your AI agent.
Quickstart — Clean Markdown & Token Budget
curl -X POST "https://api.contextapi.dev/search/v1/extract" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"max_tokens": 4000,
"include_frontmatter": true
}'→ {"title": "Example Domain", "markdown": "---
...", "stats": {"token_reduction_pct": 78.4}}Hosted Streamable HTTP MCP (3 Tools + Archive Resource)
Register in .cursor/mcp.json (or use npx -y mcp-remote for Claude Desktop):
{
"mcpServers": {
"contextapi-search": {
"url": "https://api.contextapi.dev/search/mcp",
"headers": { "X-API-Key": "${CONTEXTAPI_API_KEY}" }
}
}
}- context_web_searchTool
Grounds AI agents in live web results with clean snippets and URLs to prevent stale or hallucinated answers.
- context_extract_markdownTool
Converts any public webpage into LLM-ready Markdown so agents can read full articles without HTML noise.
- context_structured_extractTool
Extracts typed JSON directly from webpages against your schema for reliable downstream automation.
- SSRF Firewall ActiveGuardrail
Blocks private IPs, metadata endpoints, and unsafe redirects so agent-driven fetches stay isolated and safe.