Query with Time Filtering

This documentation explains how to use the tbs parameter with the SERP API to filter Google search results based on a desired timeframe.

The tbs parameter enables you to narrow search results to recent content (e.g., the past hour, day, week, month, or year) or define a custom date range. This is useful for users looking for fresh or time-specific search results.


Parameters for Time Filtering

The SERP API supports the tbs parameter with the following values:

Time Filter

Raw tbs Value

Past hour

qdr:h

Past 24 hours

qdr:d

Past week

qdr:w

Past month

qdr:m

Past year

qdr:y

Custom range (e.g., Jul 1–15, 2025)

cdr:1,cd_min:7/1/2025,cd_max:7/15/2025

You can append a number after qdr:{letter} to specify the quantity of the selected time unit. For example, qdr:d2 retrieves results from the past 2 days, and qdr:w3 retrieves results from the past 3 weeks.


Using the tbs Parameter

To customize your SERP API request with a time filter, include the tbs parameter in your GET request. For example:

curl --location 'https://serp-api.netnut.io/search?q=netnut&tbs=qdr:d' \
--header 'Authorization: Basic base64(username:password)'

API Response

When the tbs parameter is used, the API response will return search results filtered by the specified timeframe.

In addition, each result will include a timeSince field. This shows when the page was last published or updated, expressed as “time since” (e.g., 2 hours ago, 3 days ago).

Example Response:

Notes

  • The tbs parameter is optional.

  • If omitted, search results will not be time-filtered.

Last updated