Search in depth
POST /v1/search answers a query with merged, deduplicated results from
several search engines, falling back to a search API only when it has to.
Request#
{
"query": "Nestlé sustainability report 2025",
"language": "en",
"country": "CH",
"max_results": 20,
"freshness": "month",
"cache_ttl_s": 86400,
"project_ref": "company:4711",
"safesearch": "moderate",
"entity": "cmp_01JA2B3C4D5E6F7G8H9J0KMNPQ",
"entity_filter": false
}
Only query is required. language is a BCP 47 tag (en, de-CH,
zh-Hans, zh-Hant-TW) or a name such as taiwanese, country ISO 3166-1
alpha-2, max_results 1–50 (default 20), freshness one of day, week,
month, year. limit and search_lang are accepted for max_results
and language.
Without language, country sets it to the country's main language
(US, GB, AU: English, DE, AT: German, JP: Japanese, and so on;
countries with several, such as CH, BE, CA and IN, search in any
language). Before 5 Nov 2026 country alone reached the engines without a
language, and they answered in the language of our servers' location.
Precision#
- Safe search is
moderateby default (off,moderate,strict). Unless it isoff, results on well-known adult sites are removed as well (filtered.adult). - OR alternatives are put in parentheses before searching, so that
"W.W. Grainger" animal testing OR "animal welfare"is searched as"W.W. Grainger" (animal testing OR "animal welfare")and the company name stays required on every engine.engine_queryshows what was searched;"group_or": falsesends your query as is. The exact rules are in the API contract. - Entity hint:
entity(a registercmp_id, a domain, or{"id", "domains", "names"}) puts results on the company's own domains or naming it first and marks each result'sentity_match(domain,name,none);entity_filter: truedrops thenoneresults. - Operators are checked, not trusted to the engines (
operatorsshows what was read from the query):site:hostkeeps only results on that host and its subdomains (filtered.site); severalsite:terms are alternatives,-site:excludes. With nothing on the site the answer is empty withempty_reason: "nothing_on_site"(or"all_filtered"when results elsewhere were removed), never results from other hosts.- A quoted phrase must appear as a phrase in a result's title, snippets or
URL (case, punctuation,
&/andand a trailing legal form such asInc.are ignored); results without it are dropped (filtered.phrase)."strict_operators": falsekeeps them. - When the engines' answer ignores a phrase or
site:, or most results match at most one term of a longer query (the engine searched one generic word), the search goes to the fallback (fallback_reason: "operators_ignored") and the ignored answer is not merged in. Operators that no provider honoured are listed inoperators_ignored. ORgroups are passed on with their parentheses (seegroup_or).
- Empty answers say why:
filtered_outcounts every result removed by a filter,filter_reasonnames the filter that removed most (not_on_site,phrase_missing,entity_unmatched,adult_site), andempty_reasontells "nothing found" (nothing_found,nothing_on_site) from "everything found was unrelated" (all_filtered).
Several languages#
Sources in other languages rarely show up for an English query. With
languages, one request searches each language in its own market and
merges the results:
{
"query": "Tencent annual report",
"query_language": "en",
"languages": ["en", "zh-Hans", "zh-Hant-TW"],
"entity": "cmp_01JA2B3C4D5E6F7G8H9J0KMNPQ",
"translate_to": "en"
}
- The query for each language is your
querywhere it already is in that language, the company's own name from the register where the query only names theentity, or a machine translation (operators such assite:, domains and identifiers are kept as written).queries_usedshows what was searched;queriessets it yourself ({"zh-Hans": "腾讯 年报"}). Simplified and Traditional Chinese are converted into each other without machine translation. - Each language is searched in its market: the tag's region
(
zh-Hant-TWin Taiwan),regions, or the language's main market (jain Japan,koin Korea);en,fr,esandpthave none by default. - A page found in several languages counts once (
found_in), and the languages take turns in the list, so one cannot crowd out the others.per_language_limitcaps each language's share. translate_toaddstranslation(title and snippets) to results in other languages, billed as machine translation (fast tier).- Each language counts as one search;
languages[]shows each one's provider, results andrequest_id.
Providers and fallback#
-
Shared cache — keyed by the normalised query as searched (
engine_query, whitespace collapsed, lower case) and its operators pluslanguage,country,freshnessandsafesearch. An entry keeps the engines' whole answer (up to 50 results, before any filter) and serves anymax_results,entityand filter: those are applied per request. Entries live 7 days; less withfreshness(day2 hours,week12 hours,month2 days), when nothing was found (24 hours) or when some engines did not answer (12 hours).cache_ttl_scaps the age you accept;0bypasses the cache. Identical searches that arrive together are searched once. -
SearXNG — Cormorant's own metasearch instances (Bing, Yahoo, Wikipedia, Bing News; Baidu and Sogou as well for Simplified Chinese). A standard route. Wikipedia does not count towards the two answering engines below.
-
Fallback search services, used in turn when SearXNG
- fails or times out (
fallback_reason:searxng_error,searxng_timeout,no_searxng_instance), - reports unresponsive engines and fewer than two engines answered
(
unresponsive_engines, orcaptcha_engineswhen an engine was CAPTCHA-blocked), also after a second SearXNG instance was asked (engines limit each instance separately; both answers are combined), or - returns fewer than 3 usable results (
too_few_results), or - ignores the query's phrase,
site:or most of its terms (operators_ignored, see Precision).
The first is a partner search index with its own web index (where activated; queries are processed outside Switzerland and the EU). When its answer has fewer than 3 usable results or ignores the operators too, the Brave Search API is asked. Leave the partner index out of a search with
"exclude_providers": ["partner_index"](the fallback then goes straight to Brave), or ask support to leave it out of every search of a project. - fails or times out (
provider says who answered (searxng, partner_index or brave),
answered_by which engines the served results came from (bing, yahoo,
partner_index, brave_api),
fallback_reason why the fallback was considered, degraded: true that
Cormorant's own engines did not answer well (a fallback was needed or
engines failed), and unresponsive_engines which SearXNG engines failed for
this query. When a fallback is used, its results come first (Brave's before
the partner index's when both were asked), followed by results only SearXNG
found (none when SearXNG ignored the operators).
If the fallbacks are unavailable or your project's budget is exhausted, whatever
SearXNG returned is served (and not cached) with fallback_reason set. A
search that the engines answered but that found nothing returns
results: [] with error: null. Only when the providers could not answer is
error set — for example budget_exhausted, brave_http_429 or
searxng_timeout.
Results: nothing is lost#
Results are deduplicated by normalised URL (scheme, www., trailing slash and
tracking parameters ignored). For each URL, every distinct snippet and every
engine that returned it is kept, in order of first appearance:
{
"url": "https://www.nestle.com/sustainability/reporting",
"title": "Creating Shared Value and Sustainability Report 2025",
"snippets": ["Our 2025 report covers ...", "Download the full report ..."],
"engines": ["bing", "yahoo", "brave_api"],
"published_at": "2026-03-02T00:00:00",
"rank": 1
}
More engines agreeing on a URL is a useful relevance signal; more snippets give an LLM more context before it decides to fetch the page.
Costs#
SearXNG answers and cache hits are standard routes with no provider cost
(billed as search and search_cached). A fallback call (search_fallback)
costs a small fixed amount per request (operator-configured: under a tenth of
a cent for the partner index, on the order of half a cent for Brave), shown
in cost_usd and charged to your project's budget. A partner index call that
finds nothing costs nothing. Rate limits are retried by Cormorant and never
billed.
Examples#
curl -sS https://api.cormorant.ch/v1/search \
-H "Authorization: Bearer $CORMORANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Holcim annual report 2025", "language": "en", "freshness": "year", "max_results": 10}'
answer = client.post(
"/v1/search",
json={
"query": "Holcim annual report 2025",
"language": "en",
"freshness": "year",
"max_results": 10,
},
).json()
if answer["error"]:
print("search failed:", answer["error"])
for hit in answer["results"]:
print(f"{hit['rank']:>2} {hit['title']} ({', '.join(hit['engines'])})\n {hit['url']}")
const answer = await (
await fetch(`${BASE}/v1/search`, {
method: "POST",
headers,
body: JSON.stringify({ query: "Holcim annual report 2025", language: "en", freshness: "year", max_results: 10 }),
})
).json();
for (const hit of answer.results) console.log(hit.rank, hit.title, hit.url, hit.engines.join(","));
Tips#
- Searching is cheap; fetching is where the time goes. Use the snippets to decide which results deserve a fetch.
- Keep
max_resultsas small as you need: it is part of the cache key, so consistent values also mean more cache hits. Keep volatile parts (dates, run ids) out of the query; see Caching and reuse across runs. - For many queries use
POST /v1/batch/search— see Sync vs batch.