The
search_after_date_filter
and search_before_date_filter
parameters allow you to restrict search results to a specific publication date range. Only results with publication dates falling between these dates will be returned.The last_updated_after_filter
and last_updated_before_filter
parameters allow you to filter by when content was last modified or updated, rather than when it was originally published.The search_recency_filter
parameter provides a convenient way to filter results by predefined time periods (e.g., “day”, “week”, “month”, “year”) relative to the current date.Specific date filters must be provided in the “%m/%d/%Y” format (e.g., “3/1/2025”). Recency filters use predefined values like “day”, “week”, “month”, or “year”. All filters are optional—you may supply either specific dates or recency filters as needed.
Overview
Date and time filters allow you to control which search results are returned by limiting them to specific time periods. There are three types of date and time filters available:Publication Date Filters
Thesearch_after_date_filter
and search_before_date_filter
parameters filter results based on when content was originally created or published. This is useful when you need to:
- Find content published within a specific timeframe
- Exclude outdated or overly recent publications
- Focus on content from a particular publication period
Last Updated Date Filters
Thelast_updated_after_filter
and last_updated_before_filter
parameters filter results based on when content was last modified or updated. This is useful when you need to:
- Find recently updated or maintained content
- Exclude stale content that hasn’t been updated recently
- Focus on content that has been refreshed within a specific period
Search Recency Filter
Thesearch_recency_filter
parameter provides a simple way to filter results by predefined time periods relative to the current date. This is useful when you need to:
- Find content from the past day, week, month, or year
- Get recent results without specifying exact dates
- Quickly filter for timely information
"day"
- Content from the past 24 hours"week"
- Content from the past 7 days"month"
- Content from the past 30 days"year"
- Content from the past 365 days
Examples
1. Limiting Results by Publication Date Range This example limits search results to content published between March 1, 2025, and March 5, 2025. Request Examplesearch_after_date_filter
:
search_recency_filter
provides a convenient way to filter results by predefined time periods without specifying exact dates:
Best Practices
Date Format- Strict Format: Dates must match the “%m/%d/%Y” format exactly. For example, the date “3/1/2025” or “03/01/2025” is acceptable.
- Consistency: Use one or both filters consistently based on your search needs. Combining both provides a clear range.
- Choose the Right Filter Type: Use publication date filters (
search_after_date_filter
/search_before_date_filter
) when you care about when content was originally created. Use last updated filters (last_updated_after_filter
/last_updated_before_filter
) when you need recently maintained content. Use recency filters (search_recency_filter
) for quick, relative time filtering. - Recency vs. Exact Dates: Use
search_recency_filter
for convenience when you want recent content (e.g., “past week”). Use specific date filters when you need precise control over the time range. - Combining Filters: You can use both publication and last updated filters together to find content that meets both criteria (e.g., published in 2024 but updated recently). Note that
search_recency_filter
cannot be combined with other date filters.
- Regex Check: Validate date strings on the client side (or via the API) using a regex such as:
- Narrowing the Search: Applying date range filters typically reduces the number of results, which may improve response times and result relevance.
- Avoid Over-Restriction: Ensure that the date range is neither too narrow (limiting useful results) nor too broad (defeating the purpose of the filter).
Last Updated Date Filters
Thelast_updated_after_filter
and last_updated_before_filter
parameters provide powerful filtering capabilities based on when content was last modified or updated, rather than when it was originally published. This is particularly useful for finding recently maintained, refreshed, or updated content.
Parameters
last_updated_after_filter
- Filters search results to only include content last updated after this date
- Format should be %m/%d/%Y (e.g. 3/1/2025)
- Optional parameter
last_updated_before_filter
- Filters search results to only include content last updated before this date
- Format should be %m/%d/%Y (e.g. 3/1/2025)
- Optional parameter
Use Cases
Content Freshness: Find articles, documentation, or resources that have been recently updated to ensure you’re getting the most current information. Maintenance Tracking: Identify which content has been actively maintained within a specific timeframe. Quality Assurance: Focus on content that has been refreshed recently, which often indicates higher quality and relevance.Code Examples
1. Find Recently Updated Content (After a Specific Date)Advanced Usage Patterns
Combining with Domain FiltersTips for Last Updated Filters
-
Content Freshness Strategy: Use
last_updated_after_filter
when you need the most current information on rapidly evolving topics. - Quality Indicator: Recently updated content often indicates active maintenance and higher reliability.
- Research Applications: Combine with publication date filters to find content published years ago but updated recently, indicating ongoing relevance.
- Performance: These filters can significantly improve response relevance by focusing on maintained content.
- Date Selection: Choose update date ranges based on your content type - technical documentation might need monthly updates, while academic papers might be updated annually.