Google Search Query Parameters Explained: A Practical Guide for Developers

Learn how Google Search query parameters work in SERP API workflows, including q, location, gl, hl, device, num, start, safe, search type, date filters, and JSON output for SEO and AI use cases.

Google Search Query Parameters Explained: A Practical Guide for Developers
Marcus Bennett
Last updated on
6 min read

Google Search results are not determined by the keyword alone.

The same query can return different results when you change the country, language, device, page depth, safe search setting, or search type. For developers building SEO tools, AI agents, RAG pipelines, rank trackers, or market research systems, these controls matter as much as the keyword itself.

That is why Google Search query parameters are important. They define the context of the search request and make SERP data more repeatable, comparable, and useful.

What Are Google Search Query Parameters?

Google Search query parameters are values sent with a search request to control what should be searched, where the search should be localized, how many results should be returned, and what type of results should be included.

In Google’s Custom Search JSON API reference, q is the query parameter, gl represents the end user’s geolocation as a two-letter country code, hl sets the interface language, num controls the number of results, and start controls the first result index for pagination. Google’s documentation also describes parameters such as safe, searchType, dateRestrict, exactTerms, excludeTerms, and siteSearch.

In a SERP API workflow, providers may use slightly different names, such as query instead of q, or location instead of a raw geographic parameter. The concept is the same: parameters tell the API how to shape the search.

Core Parameter: q

The most important parameter is the search query.

{
  "q": "best project management software"
}

In many SERP APIs, this may appear as:

{
  "query": "best project management software"
}

A good query should be specific enough to match user intent. For example, best CRM software is broad, while best CRM software for small business is more useful for SaaS comparison pages, SEO tracking, and AI source discovery.

For AI agents, the query often comes from a user prompt. The agent may rewrite the prompt into one or two precise search queries, then send them to a Search API.

Location Parameters: Country, City, and Market

Location is one of the biggest reasons search results change.

A query like best payroll software may return different pages in the United States, the United Kingdom, Singapore, or Australia. Local queries such as dentist near me or coffee shop in Seattle are even more sensitive to location.

Google’s gl parameter is documented as a two-letter country code that boosts search results whose country of origin matches the parameter value. Google also notes that setting gl can improve relevance, especially for international users.

In SERP APIs, location may be expressed as:

{
  "location": "United States"
}

or:

{
  "location": "Austin, Texas, United States"
}

For SEO rank tracking, always store the location with the result. A ranking position without location is hard to compare.

Language Parameters: hl and Result Language

Language affects both the interface and the returned search experience.

Google’s hl parameter sets the interface language. Google’s documentation says explicitly setting this parameter improves the performance and quality of search results.

Example:

{
  "language": "en"
}

For multilingual SEO and AI workflows, language should not be treated as a minor setting. The same keyword may surface different sources in English, Spanish, Japanese, or Traditional Chinese.

Device Parameter: Desktop vs Mobile

Google results can differ between desktop and mobile.

Mobile results may emphasize local packs, app-like layouts, visual modules, or different SERP features. Desktop results may show more horizontal layouts, broader snippets, or different ad placements.

A SERP API may expose this as:

{
  "device": "mobile"
}

or:

{
  "device": "desktop"
}

For SEO monitoring, track both devices only when you actually need both. Doubling device coverage also doubles many data collection workloads.

Pagination Parameters: num, start, and page

Pagination controls how many results you request and where the result set begins.

In Google’s Custom Search JSON API, num controls the number of search results to return and accepts values from 1 to 10. The start parameter controls the index of the first result; Google’s documentation notes that start=11 begins at the second page when the default page size is 10, and that the JSON API will not return more than 100 results.

In a SERP API, you may see:

{
  "num": 10,
  "page": 1
}

or:

{
  "start": 0,
  "num": 10
}

For most SEO workflows, top 10 or top 20 results are enough. For AI agents, top 3–5 high-quality sources may be enough. Deep pagination adds cost and noise.

Safe Search and Filtering

Safe search controls whether explicit content should be filtered.

Google’s Custom Search JSON API documents safe as the search safety level, with values such as active to enable SafeSearch filtering and off to disable it.

A request may look like:

{
  "safe": "active"
}

For business, education, or consumer-facing applications, this setting may matter. For SEO monitoring, keep it consistent across runs so ranking comparisons remain meaningful.

Search Type Parameters

Not every search workflow needs standard web results.

Google’s Custom Search JSON API uses searchType=image for image search, while unspecified requests are limited to webpages. In broader SERP API workflows, search types may include organic search, images, news, shopping, local, maps, videos, jobs, flights, hotels, and more.

Example:

{
  "engine": "google",
  "type": "news",
  "query": "AI search market trends"
}

For SEO, search type helps separate organic ranking data from news, local, shopping, or image visibility. For AI agents, it helps route the task to the right source type.

Date and Freshness Parameters

Freshness matters when the query depends on recent information.

Google’s Custom Search JSON API documents dateRestrict, which can restrict results to URLs based on days, weeks, months, or years, using values such as d[number], w[number], m[number], and y[number].

Example:

{
  "dateRestrict": "m1"
}

For AI agents and RAG systems, date controls help avoid stale sources when answering questions about recent products, news, regulations, or market changes.

Example SERP API Request

A practical Google Search request may look like this:

{
  "engine": "google",
  "query": "best SERP API for AI agents",
  "location": "United States",
  "language": "en",
  "device": "desktop",
  "num": 10,
  "page": 1,
  "output": "json"
}

The response may include:

{
  "search_parameters": {
    "engine": "google",
    "query": "best SERP API for AI agents",
    "location": "United States",
    "language": "en",
    "device": "desktop"
  },
  "organic_results": [
    {
      "position": 1,
      "title": "Best SERP APIs for AI Agents",
      "url": "https://example.com/best-serp-api-ai",
      "domain": "example.com",
      "snippet": "Compare SERP APIs for AI agents, RAG workflows, and search grounding.",
      "result_type": "organic"
    }
  ]
}

You can test this workflow with tools like SerpApi, SearchAPI, Bright Data, or Talordata. The important part is whether the response is clean enough for your SEO tool, AI agent, or RAG pipeline to use directly. Start free testing of 1000 API responses

Common Mistakes

The first mistake is tracking keywords without location. Search results are market-specific.

The second mistake is mixing desktop and mobile data without labeling device context.

The third mistake is collecting too many pages. If your workflow only uses the top 10 results, page 3 data may not be worth the cost.

The fourth mistake is ignoring language. For international SEO, hl, language, and market context should be stored with every result.

The fifth mistake is not storing request parameters with the response. Without query, location, language, device, page, and timestamp, SERP data loses context.

Final Thoughts

Google Search query parameters are not just technical details. They define the search context.

For developers, the goal is not only to send a query. The goal is to collect reliable, comparable, structured search data.

For SEO, that means stable ranking data by keyword, market, language, and device.

For AI agents, it means clean source discovery with URLs, snippets, domains, and freshness context.

For RAG, it means preserving metadata so retrieved sources can be traced later.

FAQ

1. What are Google Search query parameters?

Google Search query parameters are values used to control a search request, such as the keyword, country, language, device, result count, pagination, search type, and filters. In SERP API workflows, these parameters help developers collect more consistent and structured search results.

2. Why do Google Search results change by location and language?

Google results can change because search intent, available sources, local businesses, news, and ranking signals differ by market. Parameters such as gl, hl, location, and language help define the country, city, or language context of the search.

3. What parameters matter most for SEO rank tracking?

For SEO rank tracking, the most important parameters are query, location, language, device, pagination, and timestamp. Without these fields, it is hard to compare ranking changes across markets or over time.

4. How do query parameters help AI agents and RAG workflows?

Query parameters help AI agents and RAG systems collect more relevant search results. By controlling location, language, search type, and freshness, developers can reduce noisy sources and give the model cleaner URLs, snippets, domains, and metadata.

Scale Your Data
Operations Today.

Join the world's most robust proxy network.

Start Free Trial