Caching and max_age

The shared result cache, its default window per data type, how max_age overrides it, and how to tell a cached result from a fresh one.
Open as Markdown
On this page

When a request matches one we fetched recently, we can answer from a shared cache instead of fetching again. Every response says when its data was fetched, so a cached answer is never presented as a fresh one.

Default windows

DataDefault windowWhy
Google and Bing organic SERP, standard queue6 hoursDaily rank tracking at scattered hours still gets a same-day ranking.
Google and Bing organic SERP, priority queue1 hourPriority pays for freshness.
Google and Bing organic SERP, livenoneLive means fresh.
Google Maps SERPSame as organic for each mode: 6 hours, 1 hour, none
my_business_info, products, photos24 hours, in every modeProfiles change rarely.
Meta ads, Yelp ads6 hoursAd sets change slowly within a day.
instant_pages, content_parsing, Crawl API pagesnoneYou usually check a page right after changing it.
llm_responsesnoneEach answer is a sample; tracking needs fresh draws.

What counts as the same request

The cache key is built from the normalized query only, and holds no customer data, so it's shared across customers:

  • SERP: engine, search type, keyword, location, language, device, OS and depth (rounded to a whole results page).
  • Business profile: the place identifier or keyword, language, country and location_name.
  • Products: the place CID and hl.
  • Photos: each query, tag, language and region.
  • Ads: the search terms, page ids, countries, ad type, active status and how many results you asked for.

max_age

Send max_age (whole seconds, 0 to 86,400) on any task to replace the default window for that task:

[{ "keyword": "trail running shoes", "location_code": 2840, "language_code": "en", "max_age": 0 }]
  • max_age: 0 always fetches fresh.
  • max_age: 3600 accepts a result up to 1 hour old, even on a live request.
  • Values outside 0 to 86,400, or not a whole number, fail the task with 40501.

max_age doesn't apply to endpoints that don't cache (Pages, Crawl API, llm_responses).

Telling cached from fresh

FieldWhereMeaning
cache_hitEvery task, and request_info / the envelope on other shapestrue when the result came from the cache.
fetched_atIn result, ISO 8601When the data was actually fetched. On a cache hit, that's the original fetch time.
datetimeIn result, DataForSEO formatAlso the original fetch time on SERP results.

Billing

A cached result is billed at the endpoint's normal list price for the mode you called, the same as a fresh one. A cached result that holds no data (for example a place with no products) costs $0.

Tip:

For scheduled rank tracking, the standard queue with its 6-hour window is usually what you want. Use max_age: 0 only where same-hour freshness changes a decision.