Google AI Overview
Fetch a dedicated Google AI Overview for a query. Unlike Search Advanced, this endpoint always requests Google AI Mode and returns the generated answer as plain text plus customer-renderable markdown, structured text blocks (paragraphs, headings, lists, equations), cited sources/quotes, and header images when Google produces them. Queries that do not yield a parseable AI Overview after retries return an unbilled 503. This is a separate product from the best-effort ai_overview field on Search Advanced.
Run this endpoint
Endpoint
https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us
https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us
x-api-key
query
= how does photosynthesis work
{
"search_information": {
"query_displayed": "how does photosynthesis work",
"search_url": "https://www.google.com/search?udm=50&q=how+does+photosynthesis+work&hl=en&gl=us&complete=0&pws=0"
},
"ai_overview": {
"text_blocks": [
{
"type": "paragraph",
"snippet": "Photosynthesis is the process plants use to convert light energy into chemical energy.",
"snippet_markdown": "Photosynthesis is the process plants use to convert light energy into chemical energy."
},
{
"type": "heading",
...
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
1 required parameter needed before sending a request.
4 optional filters available.
string
Required
Search query sent to Google AI Mode
how does photosynthesis work
string
Optional
Interface language code (e.g. en, de)
en
string
Optional
Country code (e.g. us, de)
us
string
Optional
Google domain (e.g. google.de)
example
string
Optional
Encoded location (passed through when provided)
example
Request Examples
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: YOUR_API_KEY_HERE"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
use Illuminate\Support\Facades\Http;
$response = Http::timeout(30)
->withHeaders(['x-api-key' => 'YOUR_API_KEY_HERE'])
->get('https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us');
if ($response->successful()) {
echo $response->body();
} else {
echo "Error: " . $response->status();
}
const options = {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE'
}
};
fetch('https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us', options)
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.text();
})
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const axios = require('axios');
const options = {
method: 'GET',
url: 'https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us',
headers: {
x-api-key: 'YOUR_API_KEY_HERE',
}
};
try {
const response = await axios(options);
console.log(response.data);
} catch (error) {
console.error('Error:', error.message);
}
require 'net/http'
require 'uri'
uri = URI.parse("https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Get.new(uri.request_uri)
request['x-api-key'] = 'YOUR_API_KEY_HERE'
begin
response = http.request(request)
puts response.body
rescue => e
puts "Error: #{e.message}"
end
import http.client
import json
conn = http.client.HTTPSConnection("scrappa.co")
headers = {
'x-api-key': 'YOUR_API_KEY_HERE',
}
try:
conn.request("GET", "/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
except Exception as e:
print(f"Error: {e}")
finally:
conn.close()
import requests
headers = {
'x-api-key': 'YOUR_API_KEY_HERE',
}
try:
response = requests.get('https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us', headers=headers)
response.raise_for_status()
print(response.text)
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class ApiExample {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us")
.addHeader("x-api-key", "YOUR_API_KEY_HERE")
.build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
System.out.println(response.body().string());
} else {
System.out.println("Error: " + response.code());
}
} catch (IOException e) {
System.out.println("Error: " + e.getMessage());
}
}
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us", nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("x-api-key", "YOUR_API_KEY_HERE")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response:", err)
return
}
fmt.Println(string(body))
}
#!/bin/bash
curl -X GET \
-H "x-api-key: YOUR_API_KEY_HERE" \
"https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us"
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY_HERE");
try
{
var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us"));
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
import axios from 'axios';
async function run(): Promise<void> {
try {
const response = await axios({
method: 'GET',
url: 'https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
},
});
console.log(response.data);
} catch (error) {
console.error('Error:', error);
}
}
void run();
use reqwest::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let response = client
.get("https://scrappa.co/api/search-ai-overview?query=how+does+photosynthesis+work&hl=en&gl=us")
.header("x-api-key", "YOUR_API_KEY_HERE")
.send()
.await?;
println!("{}", response.text().await?);
Ok(())
}
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
search_information
ai_overview
text
markdown
service_used
{
"search_information": {
"query_displayed": "how does photosynthesis work",
"search_url": "https://www.google.com/search?udm=50&q=how+does+photosynthesis+work&hl=en&gl=us&complete=0&pws=0"
},
"ai_overview": {
"text_blocks": [
{
"type": "paragraph",
"snippet": "Photosynthesis is the process plants use to convert light energy into chemical energy.",
"snippet_markdown": "Photosynthesis is the process plants use to convert light energy into chemical energy."
},
{
"type": "heading",
"snippet": "The overall equation",
"snippet_markdown": "The overall equation"
},
{
"type": "paragraph",
"snippet": "The general balanced equation for photosynthesis is: 6CO\u2082 + 6H\u2082O + Light Energy \u2192 C\u2086H\u2081\u2082O\u2086 + 6O\u2082",
"snippet_markdown": "The general balanced equation for photosynthesis is: $6\\text{CO}_{2}+6\\text{H}_{2}\\text{O}+\\text{Light\\ Energy}\\rightarrow \\text{C}_{6}\\text{H}_{12}\\text{O}_{6}+6\\text{O}_{2}$",
"snippet_latex": [
"6\\text{CO}_{2}+6\\text{H}_{2}\\text{O}+\\text{Light\\ Energy}\\rightarrow \\text{C}_{6}\\text{H}_{12}\\text{O}_{6}+6\\text{O}_{2}"
]
},
{
"type": "list",
"snippet": "Reactants: Carbon dioxide (CO\u2082) and water (H\u2082O).\nProducts: Glucose (C\u2086H\u2081\u2082O\u2086) and oxygen (O\u2082).",
"snippet_markdown": "- **Reactants:** Carbon dioxide ($\\text{CO}_{2}$) and water ($\\text{H}_{2}\\text{O}$).\n- **Products:** Glucose ($\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}$) and oxygen ($\\text{O}_{2}$).",
"list": [
{
"title": "Reactants:",
"snippet": "Carbon dioxide (CO\u2082) and water (H\u2082O).",
"snippet_markdown": "Carbon dioxide ($\\text{CO}_{2}$) and water ($\\text{H}_{2}\\text{O}$).",
"snippet_latex": [
"\\text{CO}_{2}",
"\\text{H}_{2}\\text{O}"
]
},
{
"title": "Products:",
"snippet": "Glucose (C\u2086H\u2081\u2082O\u2086) and oxygen (O\u2082).",
"snippet_markdown": "Glucose ($\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}$) and oxygen ($\\text{O}_{2}$).",
"snippet_latex": [
"\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}",
"\\text{O}_{2}"
]
}
]
}
],
"header_images": [
{
"image": "https://www.science-sparks.com/wp-content/uploads/2020/04/Photosynthesis-Diagram-scaled.jpg",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcPhotosynthesisDiagram",
"title": "What is photosynthesis?",
"source": "www.science-sparks.com",
"link": "https://www.science-sparks.com/what-is-photosynthesis/"
}
],
"references": [
{
"title": "Photosynthesis - National Geographic Education",
"link": "https://education.nationalgeographic.org/resource/photosynthesis",
"snippet": "Photosynthesis is the process by which plants use sunlight, water, and carbon dioxide to create oxygen and energy.",
"source": "National Geographic Society",
"index": 0
}
],
"quotes": [
{
"snippet": "Photosynthesis is the process by which plants use sunlight, water, and carbon dioxide to create oxygen and energy.",
"title": "Photosynthesis - National Geographic Education",
"source": "National Geographic Society",
"link": "https://education.nationalgeographic.org/resource/photosynthesis"
}
]
},
"text": "Photosynthesis is the process plants use to convert light energy into chemical energy.\nThe overall equation\nThe general balanced equation for photosynthesis is: 6CO\u2082 + 6H\u2082O + Light Energy \u2192 C\u2086H\u2081\u2082O\u2086 + 6O\u2082\nReactants: Carbon dioxide (CO\u2082) and water (H\u2082O).\nProducts: Glucose (C\u2086H\u2081\u2082O\u2086) and oxygen (O\u2082).",
"markdown": "Photosynthesis is the process plants use to convert light energy into chemical energy.\n\n### The overall equation\n\nThe general balanced equation for photosynthesis is: $6\\text{CO}_{2}+6\\text{H}_{2}\\text{O}+\\text{Light\\ Energy}\\rightarrow \\text{C}_{6}\\text{H}_{12}\\text{O}_{6}+6\\text{O}_{2}$\n\n- **Reactants:** Carbon dioxide ($\\text{CO}_{2}$) and water ($\\text{H}_{2}\\text{O}$).\n- **Products:** Glucose ($\\text{C}_{6}\\text{H}_{12}\\text{O}_{6}$) and oxygen ($\\text{O}_{2}$).",
"service_used": "google"
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
One or more query parameters failed validation.
{
"message": "The request validation failed",
"errors": {
"query": [
"The query field is required."
]
}
}
AI Overview Unavailable
Google AI Overview is temporarily unable to return a valid answer.
{
"error": "Google AI Overview is temporarily unable to return a valid response."
}
Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Related reading
Pay-as-you-go scraping API
Compare flexible scraping API billing before scaling Google AI Overview traffic.
Best MCP servers for web scraping
Compare MCP server options for running structured scraping endpoints from AI agents.
Serper.dev alternative
Compare Google Search API pricing, free credits, request limits, and no-credit-card testing.