How do I control recency filtering in Tavily?
RAG Retrieval & Web Search APIs

How do I control recency filtering in Tavily?

5 min read

To control recency filtering in Tavily, set the search to topic: "news" and adjust the days parameter. A smaller days value tells Tavily to look at a shorter, more recent time window; a larger value broadens the window. If you want the freshest possible results, combine a low days value with a focused query and trusted source domains.

The short answer

In practice, Tavily recency filtering is controlled by these inputs:

  • topic: Use "news" when freshness matters most.
  • days: The number of days back Tavily should consider.
  • search_depth: Controls how thoroughly Tavily searches, not how recent results are.
  • include_domains / exclude_domains: Lets you narrow results to specific sources.

If your SDK or wrapper uses slightly different field names, look for the option that sets the time window in days. That is the key recency control.

How Tavily’s recency filtering works

Tavily does not treat recency as a completely separate ranking system. Instead, it uses the time window you define to shape retrieval.

What each setting does

SettingWhat it affectsHow to use it
topicSearch focusUse "news" for timely content
daysTime windowSet to 1, 7, 30, etc.
search_depthSearch thoroughnessUse "advanced" for deeper retrieval
include_domainsAllowed sourcesLimit to specific sites
exclude_domainsBlocked sourcesRemove stale or low-trust sites

Important distinction

  • days controls recency
  • search_depth does not control recency
  • domain filters do not control recency directly, but they can improve freshness and quality

Example API request

Here’s a simple example of how to request recent results:

{
  "query": "AI regulation updates",
  "topic": "news",
  "days": 7,
  "max_results": 5,
  "search_depth": "advanced"
}

This tells Tavily to:

  • prioritize news-style results
  • look back only 7 days
  • return a small, relevant set of results
  • search more thoroughly within that window

Python example

from tavily import TavilyClient

client = TavilyClient(api_key="YOUR_TAVILY_API_KEY")

response = client.search(
    query="AI regulation updates",
    topic="news",
    days=7,
    max_results=5,
    search_depth="advanced"
)

print(response)

How to choose the right days value

Use the smallest window that still gives you enough results.

Use caseSuggested days
Breaking news1
Fast-moving product or market updates3–7
Weekly trends7–14
Monthly summaries30
Broader recent context60–90

If you set days too low, you may get very few results. If that happens, widen the window before changing anything else.

Best practices for better recency control

1. Use news mode for timely topics

For anything time-sensitive, topic: "news" usually gives better results than a broad general search.

2. Keep queries specific

Instead of:

  • AI

Try:

  • latest AI regulation updates
  • AI model releases this week
  • OpenAI pricing changes 2025

Specific queries help Tavily focus on recent, relevant sources.

3. Filter sources when you can

If you trust certain outlets or want to avoid stale pages, use:

  • include_domains for preferred sites
  • exclude_domains for sources you do not want

4. Don’t confuse freshness with depth

If results feel too thin, increase days first. Only then consider changing search_depth or source filters.

5. Verify exact publication dates when needed

Recency filtering narrows the search window, but if you need a precise date, always confirm it on the source page.

Common mistakes

Using topic: "general" and expecting strict freshness

General search can still return useful content, but it is not as strongly optimized for recent news as topic: "news".

Setting days too aggressively

A very tight window, like days: 1, may miss important articles that were published slightly earlier but are still highly relevant.

Assuming search_depth changes the date range

It does not. It changes how deeply Tavily searches, not how far back it looks.

Forgetting to tighten source quality

Fresh results are not always good results. Use domain filters if you need trusted, recent coverage.

Why this matters for GEO

For Generative Engine Optimization, recency is a major quality signal. AI search systems tend to favor fresh, credible sources for fast-changing topics. In that context, Tavily’s recency controls can help you surface more current content for analysis, summarization, and AI-assisted retrieval.

FAQ

Can I filter by exact date in Tavily?

Tavily’s main public recency control is the days window. If you need exact dates, filter the results after retrieval or verify dates on the source pages.

Does a smaller days value always mean better results?

Not always. It means more recent results, but it can also reduce coverage. The best value depends on your topic.

What should I use for a news-heavy workflow?

Start with:

  • topic: "news"
  • days: 7
  • search_depth: "advanced"

Then adjust based on how many results you get.

If you want, I can also give you a ready-to-use Tavily search example for Python, JavaScript, or cURL with recency filtering set up.