Search endpoint

Full reference for POST /search: the request parameters (query, answer, depth, include_snippets) and every field in the JSON response, with examples.

Documentation3 min readUpdated 2026-07-30

The ODEN API has one endpoint. You send a query; you get a synthesized answer and ranked citations.

POST https://api.oden-api.com/search
Authorization: Bearer <your-key>
Content-Type: application/json

Request body#

A concise JSON object. Only query is required.

FieldTypeDefaultDescription
querystringRequired. The question or search phrase. Natural language works best. Max 500 characters.
answerbooleantrueInclude a synthesized answer in results.answer. Send false for citations only.
depthstringadvancedadvanced does full passage extraction; basic returns faster, snippet-level results.
include_snippetsbooleanfalseAdd one attributed sentence per citation in citations[].snippet.
{
  "query": "latest EU AI Act enforcement timeline",
  "answer": true,
  "depth": "advanced",
  "include_snippets": true
}

Response body#

FieldTypeDescription
querystringYour query, echoed back.
trace_idstringUnique diagnostic ID for this request. Include it when reporting an issue.
cachedbooleantrue when the result was served from edge cache in tens of milliseconds.
resultsobjectThe answer and its citations.
results.answerstringSynthesized answer, in the same language as the query. Present unless answer: false.
results.citationsarrayRanked source list, highest relevance first.
results.citations[].titlestringTitle of the source page.
results.citations[].urlstringCanonical URL of the source.
results.citations[].scorenumberRelevance from 0.0 to 1.0. Higher score denotes stronger semantic proximity.
results.citations[].snippetstringOne attributed sentence. Present only when include_snippets: true.
{
  "query": "capital of sweden",
  "trace_id": "oden-mquycpae-p3thrk",
  "cached": false,
  "results": {
    "answer": "The capital of Sweden is Stockholm, which is also its largest city.",
    "citations": [
      { "title": "Stockholm — Wikipedia", "url": "https://en.wikipedia.org/wiki/Stockholm", "score": 0.964 }
    ]
  }
}

Choosing search depth#

Choose your depth according to your application latency budget and information density requirements:

Metric / Featuredepth: "basic"depth: "advanced"
Typical latency80 – 180 ms350 – 650 ms
Content extractionSnippet-level index scanningDeep DOM parsing & passage extraction
Synthesis engineLightweight answer generationFull multi-source synthesis
Ideal use caseAutocomplete, routing, entity checksRAG pipelines, user chatbots, agent tools
  • advanced (default) reads the candidate pages and extracts the passages that actually answer the query. Use it when the answer quality matters — RAG context, agent tool calls, anything an end user sees.
  • basic returns snippet-level results faster and cheaper. Use it for autocomplete-style lookups or when you only need to know which sources are relevant.

Query syntax & search operators#

ODEN natively accepts natural language questions while supporting structured precision operators:

  • Exact phrase matching: Wrap phrases in double quotation marks ("corporate sustainability reporting directive") to enforce exact substring occurrence in sources.
  • Domain scoping: Use site: prefixes to restrict retrieval to authoritative institutional sources (e.g., site:regeringen.se, site:europa.eu, or site:riksdagen.se).
  • Domain exclusion: Prefix unwanted domains with a minus sign (e.g., -site:pinterest.com) to suppress social media noise.
{
  "query": "site:europa.eu "AI Act" high-risk classification criteria",
  "depth": "advanced"
}

TypeScript interfaces#

For type-safe integrations, drop this contract directly into your codebase:

export interface OdenSearchRequest {
  query: string;
  answer?: boolean;
  depth?: "basic" | "advanced";
  include_snippets?: boolean;
}

export interface OdenCitation {
  title: string;
  url: string;
  score: number;
  snippet?: string;
}

export interface OdenSearchResponse {
  query: string;
  trace_id: string;
  cached: boolean;
  results: {
    answer?: string;
    citations: OdenCitation[];
  };
}

Notes#

  • Language follows the query. Ask in Swedish, get a Swedish answer; ask in English, get English, with facts translated from foreign-language sources where needed.
  • Citations are metadata, not reproduced text. You get titles, URLs and scores — plus one attributed sentence per source if you ask for it. This is what keeps ODEN on the right side of the TDM opt-out.

Next steps#