Core APIs

Search

Discover relevant web content and return ranked, cited passages, with an optional synthesized answer.

Overview

Search runs the full discover, read, rank, and return pipeline synchronously. You get back ranked results with clean content and scores, plus an optional cited answer.

POST/search

Request

Request
curl https://api.ohsee.tech/search \
  -H "Authorization: Bearer ohsee-<your-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "how does the model context protocol handle auth?",
    "search_depth": "advanced",
    "max_results": 5,
    "include_answer": true
  }'

Parameters

FieldTypeDefaultDescription
queryrequiredstring-The search query (1 to 1000 characters).
search_depthstringbasicOne of ultra-fast, fast, basic, advanced. Trades latency for depth.
topicstringgeneralOne of general, news, finance.
time_rangestringnullFilter by recency: day, week, month, or year.
max_resultsint5Number of results to return (1 to 20).
chunks_per_sourceint3Passages per source (1 to 3), used by advanced.
include_answerbool | stringfalseSet true or "advanced" to include a cited answer. Included in the base search credit.
include_raw_contentbool | stringfalseSet "markdown" or "text" to include full cleaned page content.
include_evidenceboolfalseReturn supporting citations for claims. Adds 1 credit.
include_domainsstring[][]Only return results from these domains.
exclude_domainsstring[][]Never return results from these domains.
source_qualitystringstandardOne of standard, strict, custom. strict favors official, documentation, academic, and news sources.
allowed_source_typesstring[][]Restrict to types like documentation, news, academic, official, forum, commerce, general_web.
excluded_source_typesstring[][]Exclude specific source types.
prefer_domainsstring[][]Boost results from these domains without excluding others.
cachestringautoCache behavior: auto, force, or bypass.
cache_ttlint900Cache lifetime in seconds (60 to 86400).

Response

FieldTypeDescription
querystringThe query you sent.
answerstring | nullSynthesized cited answer, when include_answer is set.
resultsobject[]Ranked results, each with url, title, content, score, published_date, source_type, raw_content, citation_id, is_stale.
citationsobject[]Supporting evidence, when include_evidence or an answer is requested.
response_timefloatServer processing time in seconds.
request_idstringUnique ID for this request.
credits_chargedintCredits deducted for this request.
cache_statusstring | nullhit, miss, or bypassed.
200 OK
{
  "query": "how does the model context protocol handle auth?",
  "answer": "MCP uses OAuth 2.1 for authorization ...",
  "results": [
    {
      "url": "https://modelcontextprotocol.io/docs/concepts/authorization",
      "title": "Authorization - Model Context Protocol",
      "content": "MCP uses OAuth 2.1 for authorization ...",
      "score": 0.97,
      "published_date": null,
      "source_type": "documentation",
      "raw_content": null,
      "citation_id": "c1",
      "is_stale": false
    }
  ],
  "citations": [],
  "response_time": 1.42,
  "request_id": "b3f1a2c4",
  "credits_charged": 3,
  "cache_status": "miss"
}

Credits

Base cost is 1 credit (2 for advanced). include_answer is free; include_evidence adds 1 credit. Cache hits cost less.

Preview the exact cost with /estimate before running large batches.