SerpBase
Back to Blog

Google Search API Date Filter: Get Results From the Past Day, Week or a Custom Range

Add tbs to a Google search request to limit results to the past hour, day, week, month or a custom date range. Values, a tested example with result dates, and the details that trip people up.

November 20, 2026
By SerpBase Team3 min readguide

Short answer: add tbs to the request. "tbs": "qdr:w" limits a Google search to the past week, and "tbs": "cdr:1,cd_min:1/1/2026,cd_max:3/31/2026" limits it to a date range. The value is the same one Google puts in its own URL when you pick a time under Tools, so anything you can set there you can send through the API. It costs the same credits as a search without it.

Why a time filter matters

A plain search returns whatever Google ranks best, regardless of age. That is the wrong page for several common jobs:

  • News and brand monitoring. You want what was published since the last check, not the evergreen pages that always rank.
  • Fresh context for AI agents. A model answering "what changed this week" needs pages from this week.
  • Research on a past period. What ranked for a product name during its launch quarter, before later coverage buried it.
  • Finding new pages on a site. site:example.com with a one-day filter shows what Google picked up recently.

The request

curl -X POST 'https://api.serpbase.dev/google/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"openai news","gl":"us","hl":"en","tbs":"qdr:d"}'

Values you will use most

tbs valueMeaning
qdr:hPast hour
qdr:dPast 24 hours
qdr:wPast week
qdr:mPast month
qdr:yPast year
qdr:m6Past six months (a number may follow the letter)
cdr:1,cd_min:1/1/2026,cd_max:3/31/2026Custom range, dates written M/D/YYYY
sbd:1Sort by date instead of relevance
li:1Verbatim: match the words exactly as typed

Join several with commas, for example qdr:w,sbd:1 for the past week, newest first.

What comes back

We ran the same query three ways on 20 November 2026 (United States, English):

RequestOrganic resultsdate on the results
no tbs71 of 7 had a date; the rest were evergreen pages such as the company's own site
tbs: "qdr:d"76 of 7, all between 2 and 14 hours old
tbs: "cdr:1,cd_min:1/1/2026,cd_max:3/31/2026"2both inside the range: Jan 26, 2026 and Mar 17, 2026

Two things to notice. First, each organic result carries a date field when Google shows one, so you can check the filter yourself. Second, a filtered page is often shorter, and modules such as People Also Ask and related searches are frequently missing, because Google leaves them out of time-filtered pages. A narrow range can also legitimately return few results or none.

A small Python example

import requests

def search_recent(query, window="qdr:w"):
    r = requests.post(
        "https://api.serpbase.dev/google/search",
        headers={"X-API-Key": "YOUR_API_KEY"},
        json={"q": query, "gl": "us", "hl": "en", "tbs": window},
        timeout=60,
    )
    data = r.json()
    if data.get("status") != 0:
        raise RuntimeError(data.get("error"))
    return [(o.get("date"), o["title"], o["link"]) for o in data.get("organic", [])]

for date, title, link in search_recent('"your brand"', "qdr:d"):
    print(date, title, link)

Check status in the body, not only the HTTP code: the search endpoints answer HTTP 200 and report success or failure in status.

Details worth knowing

  • Malformed values are refused, not ignored. tbs must be name:value pairs joined by commas. Sending "tbs": "past week" returns status: 1000 with a message naming the parameter, and no credits are charged. You never get unfiltered results silently.
  • You can paste a Google URL. Send "url": "https://www.google.com/search?q=...&tbs=qdr:w" instead of q, and the tbs in the URL is used. Handy when a teammate set the filter in a browser.
  • It works with pagination. page, gl and hl combine with tbs as usual.
  • Dates are Google's. Google decides a page's date from the page itself, so a republished article can show up in a recent window. Treat the filter as Google's view of recency.
  • The SerpApi-compatible route accepts it too, with the same tbs values, if you are migrating existing code.

Try it

New accounts get 500 free credits. The search endpoint reference lists every parameter and has a Playground button. For a monitoring use of the same idea, see SERP feature monitoring; for feeding recent pages to a model, see grounding AI answers with live Google results.