The news endpoint retrieves current headlines from DuckDuckGo’s news backend, organised by category. It uses theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JasonHonKL/spy-search/llms.txt
Use this file to discover all available pages before exploring further.
DuckDuckGoSearchResults LangChain tool with backend="news" and returns up to 8 articles per request, including titles, snippets, links, dates, and source names.
News Endpoint
GET /news/{category}
Returns a JSON object containing an array of news articles for the requested category.
Example request
Example response
date field is an ISO 8601 timestamp string.
Supported Categories
Each category maps to a pre-defined DuckDuckGo search query. The mapping is defined inDuckSearch.today_new():
| Category slug | DuckDuckGo query string |
|---|---|
technology | latest tech AI news |
finance | latest finance market news |
entertainment | latest entertainment news |
sports | latest sports news |
world | latest world news |
health | latest health news |
"latest news".
Fetch a specific category
Frontend Integration
The Discover page in the React frontend (frontend/src/pages/News.tsx) consumes this endpoint directly. It renders a responsive card grid with article titles, snippets, publication dates, and source badges. Clicking a card opens the original article in a new tab.
Category navigation is rendered as a pill-button row using the same six slugs listed in the table above. The icons used per category are:
| Category | Icon |
|---|---|
| Technology | TrendingUp |
| Finance | DollarSign |
| Entertainment | Gamepad2 |
| Sports | Trophy |
| World | Globe |
| Health | Heart |
lastFetchTime. Switching to a category that was fetched within the last 10 minutes reuses the stored results without making a new network request. Passing forceRefresh = true to the internal fetchNews function bypasses this check.
Rate Limits
DuckDuckGo does not publish an official rate limit for its search backend. However, sending requests too frequently can trigger temporary throttling or empty responses. Guidelines:- The frontend’s built-in 10-minute cache is a reasonable minimum interval for casual browsing.
- For production deployments or automated pipelines, a 60-second minimum interval between requests per category is recommended.
- If the news request fails, the
DuckSearch.today_new()method catches the exception, logs the error, and returns an empty list — the API response will contain{"news": []}.