Data Access Path · 3/7

Recommended reading order, not completion status. Optional steps can be skipped.

View all steps

Before you start: Complete your first query and decide between keyword/semantic matching and exact author or label filters.

Keyword & Semantic Search

Complete reference for the POST /v1/search family. All endpoints require:

HTTP
Authorization: Bearer whale_consumer_xxx
Content-Type: application/json

Production base URL: https://www.marsyoo.com.

Which endpoint

EndpointPurpose
POST /v1/searchDefault: historical index, optional live top-up
POST /v1/search/historyHistorical index only, never triggers collection
POST /v1/live-queriesCreate an on-demand collection task, see Live Queries
POST /v1/contents/searchLegacy alias of /v1/search; not recommended for new integrations
POST /v1/search/keyword, /vector, /hybridExternal dedicated search endpoints; prefer the unified endpoint’s mode for most integrations

For exact author/topic/tag/category filters, use Users, Topics, Tags & Categories. These catalog conditions cannot currently be combined with vector/hybrid search.

Request fields

POST /v1/search and POST /v1/search/history share the same body. The only difference is that /v1/search accepts the live option.

FieldTypeRequiredDefaultNotes
modestringnosee noteskeyword / vector / hybrid. If omitted: hybrid when query_vector is set, otherwise keyword
querystringconditional—Query text for keyword/hybrid; vector mode may use query_vector alone
query_vectornumber[]no—Supply your own embedding
platformsstring[]nofull subscriptionPlatform filter; see Platforms
languagesstring[]noallISO 639-1, e.g. ["zh","en"]
published_from / published_tostring(RFC3339)nolast 30 daysPlatform publish-time window. With neither given, keyword and hybrid search cover content published in the last 30 days; pass a range to search older content
limitintno20Page size, max 100
cursorstringno—Keyword mode only; from the previous response
fieldsstring[]noauthorized setResponse field allowlist; can only narrow, never expand
include_highlightsboolnofalseReturn highlight snippets
include_chunksboolnofalseReturn matched chunk details in matched_chunks
include_non_currentboolnofalseInclude non-current versions
sentimentsstring[]noallFilter by sentiment: positive / negative / neutral; see Filtering on analysis
emotionsstring[]noallFilter by emotion; any one matches
entitiesstring[]noallFilter by entities, e.g. ["brand:Xiaomi", "Hangzhou"]; all must be mentioned, up to 10
quality_statusesstring[]noallFilter by content quality, e.g. ["normal"]
intentsstring[]noallFilter by intent, e.g. ["complaint", "churn"]; any one matches
liveobjectno—/v1/search only; see below

live options

FieldTypeRequiredDefaultNotes
live.enabledboolyes—Enable live top-up
live.resource_kindstringyes—content / account / user / channel / video
live.max_items_per_platformintno20Per-platform cap, bounded by subscription quota
live.deadline_secondsintno300Collection deadline, 10–900

When live.enabled is true the request must carry an Idempotency-Key header, and needs 1–5 platforms.

Response fields

JSON
{
  "mode": "hybrid",
  "results": [
    {
      "document_id": "doc_01J...",
      "version_id": "ver_01J...",
      "best_chunk_id": "chunk_01J...",
      "dataset_id": "social_media_raw",
      "source_platform": "weibo",
      "title": "...",
      "body": "Best-matching chunk summary (not the full body)",
      "content_type": "post",
      "language": "zh",
      "published_at": "2026-09-01T08:00:00Z",
      "origin": "indexed",
      "score": 0.83,
      "keyword_score": 0.91,
      "vector_score": 0.74,
      "rerank_score": 0.83,
      "highlights": ["...<em>...</em>..."],
      "matched_chunks": [
        {"chunk_id": "chunk_01J...", "chunk_index": 3, "body": "...", "score": 0.91}
      ]
    }
  ],
  "total": 1,
  "total_documents": 1,
  "total_chunks": 1432,
  "top_k": 20,
  "degraded": false,
  "warnings": [],
  "live_query": null
}
FieldNotes
results[].document_idDocument ID; use it to fetch details
results[].bodyBest-chunk summary; full body via Read Content & History
results[].originindexed (historical) / live (collected on demand)
results[].scoreFinal ranking score; rerank output for hybrid
total / total_documentsDeduplicated document count on this page, not a global document total
total_chunksBackend chunk-hit count; vector/hybrid may report only candidate counts, not an exact global total
cursorPresent when more pages exist; pass it back verbatim as cursor
degradedtrue when a backend was unavailable and results were downgraded
warnings[]Downgrade/partial-failure reasons; see Errors and degradation
live_queryLive top-up handle with id, status, runs[]

A document_id appears at most once per page.

Filtering on analysis

Searches can add sentiment, emotion, entity, intent and content quality filters, in all three modes, or filter without a query (keyword mode).

JSON
{
  "query": "battery",
  "platforms": ["xianyu"],
  "sentiments": ["negative"],
  "entities": ["brand:Xiaomi"]
}
  • sentiments: a sentiment score over 0.3 is positive, under -0.3 negative, otherwise neutral; judgments under 0.4 confidence belong to none.
  • emotions: anger, disgust, fear, joy, sadness, surprise, neutral; any one matches.
  • entities: type:name (types in Read Named Entities) or a bare name of any type, normalized like stored entities (case, width, @#, quotes). Every listed entity must be mentioned.
  • quality_statuses: content quality statuses: normal, low, spam, duplicate, empty.
  • intents: values in Read Intents; any one matches.
  • Sentiment and emotion filters need the affect field in the application grant, entity filters the entities field, intent filters the intents field; otherwise 403.
  • Only analyzed content can match: content enters search with the analysis results it has by then, usually seconds to minutes after ingest. Content whose analysis is not done within 3 minutes still becomes searchable but does not match these filters. Entity re-checks are added later. Older history is not covered yet.
  • Vector mode and the vector part of hybrid take about three times the candidates and then filter, so results can be fewer than limit; vector mode with analysis filters does not page with cursor.

Pagination

limit defaults to 20, max 100. Only keyword mode supports cursor pagination. Vector/hybrid return Top-K candidates and do not enumerate all data; supplying cursor returns 400 invalid_query. Keep keyword filters unchanged when passing back a returned cursor. No fixed cursor lifetime is promised. For complete synchronization, use catalog time windows or Change Feed, not semantic search as an export API.

include_non_current=true permits historical versions to participate, but results are still deduplicated by document ID per page. See Read Content Version History for a document’s version history.

Live top-up

With live.enabled=true the response returns origin=indexed historical results plus:

JSON
"live_query": {
  "id": "lq_01J...",
  "status": "pending",
  "resource_kind": "video",
  "runs": [
    {"id": "lqr_01J...", "platform": "youtube", "status": "pending", "collection_task_id": "ctask_01J..."}
  ]
}

Poll GET /v1/live-queries/{id} for status and GET /v1/live-queries/{id}/results for collected documents, see Live Queries. If the live pipeline is unavailable the response still contains historical results with an explanatory warnings[] entry.

Choosing a mode

modeUse forBehavior
keywordTerms, brands, names, topic words in textTitle/body search, not exact topics/tags membership
vectorSemantic similarity, cross-language, paraphrasesCan use query alone; the server generates the embedding
hybridDefaultFuses lexical, vector, quality and recency signals; the vector branch waits at most 5s, then degrades to keyword results with degraded=true and warnings[].code=vector_search_unavailable

Authorization and quota

  • platforms / fields can only narrow the subscription scope; out-of-scope requests return 403 entitlement_denied or are trimmed.
  • Daily quota is counted per UTC day, per application, per operation, and reserved atomically before hitting the search backend; requests rejected with 429 are not counted.
  • Live concurrency/RPS is controlled by the subscription policy; violations return 429 rate_limit_exceeded with Retry-After.

Errors and degradation

HTTPcodeMeaningAction
400invalid_queryMalformed params or unknown modeFix per this reference
401unauthorizedMissing/invalid keyCheck the Authorization header
403entitlement_deniedOutside subscribed platforms or fieldsNarrow scope or request access
429quota_exceededDaily quota exhaustedWait for the UTC reset or request a raise
429rate_limit_exceededLive rate limitRetry per Retry-After
409live_query_results_not_readyLive results not readyKeep polling status
503search_backend_unavailableSearch backend downExponential backoff
503vector_search_disabledVector retrieval not open yet (/v1/search/vector, creating analysis runs)Do not retry; use keyword or hybrid until it is announced as open

Degradation (HTTP still 200, degraded=true):

warnings[].codeMeaning
vector_search_unavailableVector branch timed out/unavailable; keyword results only
vector_search_disabledVector retrieval not open yet; keyword retrieval only
keyword_search_timed_outKeyword branch timed out; results empty for this mode, retry with narrower scope
keyword_search_partialKeyword search timed out before covering all data; results are incomplete and may miss recent content. Narrow the platforms, time range or query and retry
live_query_unavailableLive top-up creation failed; historical results only

Completion check: Choose a search mode, apply platform/time filters, and understand snippets and pagination limits; use the next page for exact filters.

Not needed? Skip optional steps: Read Content & History