Skip to main content

Search API

Full-text search across all articles.

Search Articles

GET /api/search

Query Parameters:

ParameterTypeDescription
qstringSearch query (required)
domainstringFilter by domain
fromstringStart date
tostringEnd date
limitnumberMax results (default: 20)

Example:

curl "http://localhost:3000/api/search?q=trade+agreement&domain=economics"

Response:

{
"data": [
{
"id": 1234,
"title": "Major Trade Agreement Announced",
"snippet": "...the new <mark>trade agreement</mark> will reduce tariffs...",
"url": "https://example.com/article",
"source": "Reuters",
"domain": "economics",
"confidence": 0.94,
"publishedAt": "2026-02-07T08:00:00Z",
"relevance": 0.95
}
],
"meta": {
"query": "trade agreement",
"total": 23,
"took": 45
}
}

Search Syntax

trade agreement

Matches articles containing both "trade" and "agreement".

"trade agreement"

Matches the exact phrase.

trade | tariff

Matches articles containing either term.

Exclude Terms

trade -china

Matches "trade" but excludes articles mentioning "china".

title:trade
source:reuters
domain:economics

Search within specific fields.

Search Tips

  1. Use quotes for exact phrases
  2. Combine filters for precision: ?q=AI&domain=technology&from=2026-02-01
  3. Check relevance scores - higher = better match
  4. Narrow by date if results are too broad

Under the hood, Argus uses PostgreSQL's built-in full-text search:

  • tsvector for document indexing
  • tsquery for search parsing
  • ts_rank for relevance scoring

This provides fast, accurate search without external dependencies.