How Google ranks results
Google’s ranking algorithm evaluates hundreds of signals for every candidate page in the index. From a practical developer perspective, four signals matter most:Relevance
How well does the page match the query? Google looks at keyword frequency, prominence (title vs. body vs. URL), semantic similarity, and the overall topic of the page relative to the query intent.
Authority (PageRank)
How many other credible pages link to this page? The PageRank algorithm — the foundation of Google Search — treats inbound links as votes of confidence. Pages linked by many authoritative sources rank higher than obscure, isolated pages.
Freshness
For time-sensitive topics (news, product releases, events), Google boosts recently published or recently updated pages. A well-ranked older page can be outpaced by a fresh one if the query has recency intent.
Location
Google adjusts rankings based on the geographic context of the search. A query for “restaurants” in France should surface French results ahead of global ones. The
gl (geolocation) and cr (country restrict) parameters give you control over this signal.Within the scope defined by your Search Engine ID (
cx), Google applies exactly the same ranking signals it uses for google.com. You are querying the same index — just potentially with a different scope and additional API-layer filters applied on top.Parameters that influence ranking and results
Sort by date — sort
By default, Google ranks results by relevance. Setting sort=date switches the primary sort key to the estimated publication date of the page, surfacing the most recently published content first.
string
Specifies the sort order. Use
date to sort by estimated page publication date (most recent first). Omit the parameter for the default relevance ranking.sort=metatags-pubdate for a custom pubdate meta tag, or sort=recipe-ratingstars for pages with Recipe microdata). See the Filtering and sorting structured results guide for details.
Restrict by date — dateRestrict
While sort=date reorders results, dateRestrict filters them — removing any document that falls outside the specified time window entirely. The two parameters are independent and can be combined.
string
Restricts results to pages indexed or published within a relative time window. Format:
d[n] (days), w[n] (weeks), m[n] (months), y[n] (years).sort and dateRestrict for news-style feeds:
Restrict to specific sites — siteSearch
The siteSearch parameter limits results to a particular domain (include mode) or removes results from a domain (exclude mode) for a single request — without changing your engine’s permanent configuration.
string
A domain name to include or exclude from results. Works in conjunction with
siteSearchFilter.string
Controls whether
siteSearch includes or excludes the domain. Values: i (include only), e (exclude).Require a phrase in every result — exactTerms
exactTerms acts as a hard relevance gate: every result returned must contain the specified phrase verbatim. This is the single most powerful lever for improving result precision when you know exactly what a relevant document must say.
string
A phrase that all returned documents must contain. Applies an additional mandatory constraint on top of
q.Language and geography signals — lr and gl
Two parameters directly influence which language and country variants of content rank highest:
string
Restricts results to documents written in a specific language. Format:
lang_XX (e.g., lang_en for English, lang_fr for French, lang_de for German).string
Boosts results whose country of origin matches the specified two-letter country code (ISO 3166-1 alpha-2). Does not exclude other countries — it applies a relevance boost. Example:
us, gb, de, fr, jp.lr is a hard filter — it removes documents not in the specified language entirely. gl is a soft boost — it promotes results from the specified country but does not exclude others. Use lr when language purity is critical; use gl when you want geographically relevant results without eliminating international content.Combining ranking controls
The parameters above stack independently — each narrows or reorders the result set on a different dimension. Here are practical patterns for common use cases:News monitoring feed (recent, date-sorted, specific source)
News monitoring feed (recent, date-sorted, specific source)
Precise technical documentation search
Precise technical documentation search
International content discovery
International content discovery
What you cannot control
It is equally important to understand the limits of your influence:If you need to surface specific pages regardless of Google’s ranking — for example, featured articles, pinned announcements, or sponsored results — use the Promotions feature in the Programmable Search Engine Control Panel. Promotions appear in the
promotions array of the API response, separate from the organic items array, and are always shown regardless of ranking.