Google AI Mode API
The Google AI Mode API provides access to Google's AI-powered search results, allowing you to retrieve AI-generated responses and structured data from Google's experimental AI search interface. This API returns AI-generated content including text blocks, generated markdown, reference links, local results, web references, and shopping suggestions.
API Parameters
Search Query
-
- Name
-
q
- Required
- Required
- Description
-
This parameter is used for the terms you want to search on Google AI Mode. The AI Mode will respond in the same language as your query - for example, queries in German will receive answers in German, queries in Spanish will receive answers in Spanish. Note: not required if you use the
url
parameter. It can be used in combination with theurl
parameter as well.
-
- Name
-
url
- Required
- Optional
- Description
-
Parameter defines the image url. This is the direct link to the image you want Google AI Mode to analyze. Ensure the URL points to a valid image format (e.g., .jpg, .png) and is accessible publicly.
Geographic Location
-
- Name
-
location
- Required
- Optional
- Description
-
This parameter is used to specify the canonical location of the search. For exact targeting or to see all available options, check out the Locations API. If multiple locations match your input, the most popular one will be selected. For example -
location=New York
would selectNew York,United States
orlocation=London
would selectLondon TV Region,England,United Kingdom
.
-
- Name
-
uule
- Required
- Optional
- Description
-
This parameter sets the exact Google-encoded location for the search, and
uule
andlocation
cannot be used at the same time. SearchApi builds it for you when you use thelocation
parameter, but you can provide your own if you want precise control.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_ai_mode
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
Zero Data Retention
-
- Name
-
zero_retention
- Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
true
to disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Text Blocks

https://www.searchapi.io/api/v1/search?engine=google_ai_mode&q=Fiber+example+in+programming
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_ai_mode",
"q": "Fiber example in programming"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_a6KXlErN3Ej2f27ApYvP850b",
"status": "Success",
"created_at": "2025-09-30T14:22:26Z",
"request_time_taken": 4.71,
"parsing_time_taken": 0.02,
"total_time_taken": 4.73,
"request_url": "https://www.google.com/search?hl=en&gl=us&q=Fiber+example+in+programming&udm=50",
"html_url": "https://www.searchapi.io/api/v1/searches/search_a6KXlErN3Ej2f27ApYvP850b.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_a6KXlErN3Ej2f27ApYvP850b"
},
"search_parameters": {
"engine": "google_ai_mode",
"q": "Fiber example in programming",
"hl": "en",
"gl": "us"
},
"text_blocks": [
{
"type": "paragraph",
"answer": "A fiber is a lightweight, user-managed unit of execution that enables cooperative multitasking within a single operating system thread. Unlike OS-scheduled threads, a fiber must manually yield control to allow another fiber to run, giving the programmer precise control over the execution flow.",
"reference_indexes": [0, 7]
},
...
{
"type": "header",
"answer": "Example using Ruby"
},
{
"type": "paragraph",
"answer": "The following Ruby code demonstrates how to use fibers to interleave the execution of two separate tasks (fibers).",
"reference_indexes": [3, 2]
},
{
"type": "code_blocks",
"language": "ruby",
"code": "# Create the first fiber\nfiber1 = Fiber.new do\n puts \"Fiber 1 started.\"\n # Yields control back to the point where resume was called.\n Fiber.yield(\"message from fiber 1\")\n puts \"Fiber 1 resumed.\"\n # The fiber's block will exit after this line.\n \"end of fiber 1\"\nend\n\n# Create the second fiber\nfiber2 = Fiber.new do\n puts \"Fiber 2 started.\"\n Fiber.yield(\"message from fiber 2\")\n puts \"Fiber 2 resumed.\"\n \"end of fiber 2\"\nend\n\n# Main thread begins execution\nputs \"Main thread starting fibers.\"\n\n# Resume the first fiber, which runs until it yields\nresult1 = fiber1.resume\nputs \"Main thread received: #{result1}\"\n\n# Resume the second fiber\nresult2 = fiber2.resume\nputs \"Main thread received: #{result2}\"\n\n# Resume the first fiber again. It continues from where it yielded.\nresult3 = fiber1.resume\nputs \"Main thread received: #{result3}\"\n\n# Resume the second fiber again.\nresult4 = fiber2.resume\nputs \"Main thread received: #{result4}\"\n\nputs \"Main thread finished.\"\n"
},
...
{
"type": "unordered_list",
"items": [
{
"type": "paragraph",
"answer": "Creating fibers: Fiber.new creates a new fiber. The code block passed to it represents the fiber's body of work."
},
{
"type": "paragraph",
"answer": "Starting a fiber: A fiber doesn't run automatically. It must be explicitly started by calling resume."
},
...
],
"reference_indexes": [3, 2, 5]
},
...
],
"markdown": "A fiber is a lightweight, user-managed unit of execution that enables cooperative multitasking within a single operating system thread. Unlike OS-scheduled threads, ...)",
"reference_links": [
{
"index": 0,
"title": "Fiber (computer science) - Wikipedia",
"link": "https://en.wikipedia.org/wiki/Fiber_(computer_science)#:~:text=The%20key%20difference%20between%20fibers,vast%20performance%20and%20functionality%20differences.",
"snippet": "Fiber (computer science) ... In computer science, a fiber is a particularly lightweight thread of execution. Like threads, fibers share address space. However, ...",
"source": "Wikipedia"
},
...
]
}
URL Query Example

https://www.searchapi.io/api/v1/search?engine=google_ai_mode&q=What+is+this+picture+known+for%3F&url=https%3A%2F%2Fi.ibb.co%2F12qRDsk%2Ftower.png
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_ai_mode",
"q": "What is this picture known for?",
"url": "https://i.ibb.co/12qRDsk/tower.png"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_AxENYzjKgR4PcdZA3D0M4GJb",
"status": "Success",
"created_at": "2025-09-30T08:46:59Z",
"request_time_taken": 5.05,
"parsing_time_taken": 0.01,
"total_time_taken": 5.06,
"request_url": "https://lens.google.com/uploadbyurl?url=https%3A%2F%2Fi.ibb.co%2F12qRDsk%2Ftower.png&hl=en&gl=us&q=What+is+this+picture+known+for?",
"html_url": "https://www.searchapi.io/api/v1/searches/search_AxENYzjKgR4PcdZA3D0M4GJb.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_AxENYzjKgR4PcdZA3D0M4GJb"
},
"search_parameters": {
"engine": "google_ai_mode",
"url": "https://i.ibb.co/12qRDsk/tower.png",
"q": "What is this picture known for?",
"hl": "en",
"gl": "us"
},
"text_blocks": [
{
"type": "paragraph",
"answer": "The image you sent is known for featuring the Eiffel Tower, one of the most iconic and recognizable landmarks in the world.",
"reference_indexes": [4]
},
{
"type": "paragraph",
"answer": "The Eiffel Tower is famous for several reasons:"
},
{
"type": "unordered_list",
"items": [
{
"type": "paragraph",
"answer": "Symbol of Paris and France: It's a global symbol of Parisian elegance and French culture, featured in countless films, literature, and art."
},
...
],
"reference_indexes": [0, 2, 5, 8, 9]
}
],
"markdown": "The image you sent is known for featuring the Eiffel Tower, one of the most iconic and recognizable landmarks in the world. [4](https://www.getyourguide.com/explorer/paris-ttd16/facts-about-the-eiffel-tower/#:~:text=Why%20is%20the%20Eiffel%20Tower,it%20a%20must%2Dsee%20attraction.)\n\nThe Eiffel Tower is ...",
"reference_links": [
{
"index": 0,
"title": "The History of the Eiffel Tower and its Importance to France",
"link": "https://www.learnfrenchwithclemence.com/blog/the-history-of-the-eiffel-tower-and-its-importance-to-france#:~:text=Over%20the%20years%2C%20the%20Eiffel,celebrate%20French%20culture%20and%20history.",
"snippet": "Jun 1, 2023 — Let's delve into the fascinating history of the Eiffel Tower and explore why it holds such significance for France and the world. * The Birth of an Icon. The st...",
"source": "Learn French With Clemence"
},
...
]
}
Local Results

https://www.searchapi.io/api/v1/search?engine=google_ai_mode&location=New+York&q=Burgers+near+me
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_ai_mode",
"q": "Burgers near me",
"location": "New York"
}
response = requests.get(url, params=params)
print(response.text)
{
...
"local_results": [
{
"position": 1,
"title": "Burger By Day",
"link": "https://www.google.com/viewer/place?mid=%2Fg%2F11t76tjkhj",
"rating": 4.6,
"reviews": 360,
"price": "$10–20",
"type": "Hamburger",
"address": "242 Grand St",
"is_closed": true
},
...
]
}
Web Results

https://www.searchapi.io/api/v1/search?engine=google_ai_mode&q=The+Rock
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_ai_mode",
"q": "The Rock"
}
response = requests.get(url, params=params)
print(response.text)
{
...
"web_results": [
{
"title": "Dwayne Johnson - Wikipedia",
"link": "https://en.wikipedia.org/wiki/Dwayne_Johnson",
"displayed_link": "https://en.wikipedia.org",
"source": "Wikipedia",
"snippet": "Dwayne Douglas Johnson (born May 2, 1972), also known by his ring name the Rock, is an American actor and professional wrestler. He is signed to WWE, ..."
},
...
],
...
}
Inline Shopping

https://www.searchapi.io/api/v1/search?engine=google_ai_mode&q=Jordan+sneakers
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_ai_mode",
"q": "Jordan sneakers"
}
response = requests.get(url, params=params)
print(response.text)
{
"inline_shopping": [
{
"position": 1,
"title": "Men's Air Jordan 1 Mid",
"link": "https://www.google.com/search?prds=pvt:hg,pvo:29,mid:576462774943518495,imageDocid:16956387004828489444,gpcid:7423141884533942723,headlineOfferDocid:17919849217394455361,catalogid:9391495770452690259,productDocid:5027508637988147859,rds:PC_7423141884533942723%7CPROD_PC_7423141884533942723&ibp=oshop&q=product&sa=X&ved=2ahUKEwjSn7f1yICQAxWpRzABHWqVNQIQ8ccPegQICBAB",
"rating": 4.8,
"reviews": 6000,
"price": "$130.00",
"extracted_price": 130
},
{
"position": 2,
"title": "Men's Air Jordan 1 Retro High OG",
"link": "https://www.google.com/search?prds=pvt:hg,pvo:29,mid:576462852710066306,imageDocid:15075106281187606388,gpcid:15744374106956375189,headlineOfferDocid:13658842789017793359,catalogid:1786320408703880422,productDocid:17105793535651660968,rds:PC_15744374106956375189%7CPROD_PC_15744374106956375189&ibp=oshop&q=product&sa=X&ved=2ahUKEwia98b6zoCQAxW_KkQIHZF7Fp0Q8ccPegYIAQgFEAc",
"rating": 4.6,
"reviews": 4000,
"price": "$160.00",
"extracted_price": 160,
"original_price": "$185.00",
"extracted_original_price": 185
},
...
],
...
}