Tutorial

How to Extract People Also Ask Data from Google SERP

Pull People Also Ask questions and answers from Google SERP responses using the Scavio API. Great for content gap analysis and FAQ generation.

The People Also Ask (PAA) section in Google search results reveals the follow-up questions users have about a topic. This data is extremely valuable for content strategy — identifying what related questions you should answer on your page, building FAQ sections, and understanding user intent. The Scavio API includes the people_also_ask array in SERP responses when Google surfaces this box. This tutorial shows how to extract PAA data for any keyword and use it for content gap analysis.

Prerequisites

  • Python 3.8 or higher
  • requests library installed
  • A Scavio API key
  • Basic understanding of Python lists and dicts

Walkthrough

Step 1: Fetch SERP with PAA data

POST to the Scavio endpoint with your keyword. The response will include a people_also_ask array when Google shows the PAA box.

Python
data = search_google("how does retrieval augmented generation work")
paa = data.get("people_also_ask", [])
print(f"Found {len(paa)} PAA questions")

Step 2: Print questions and answers

Each PAA item contains a question, snippet answer, and source link. Iterate and print them.

Python
for item in paa:
    print("Q:", item["question"])
    print("A:", item.get("snippet", "No answer available"))
    print("Source:", item.get("link", ""))
    print()

Step 3: Extract questions for content gap analysis

Build a list of just the questions. These represent topics you should consider addressing in your content.

Python
questions = [item["question"] for item in paa]
print("Content gaps to address:")
for q in questions:
    print(f"  - {q}")

Step 4: Export to JSON for editorial review

Save the PAA data as JSON so it can be reviewed by a content team or fed into an LLM for FAQ generation.

Python
import json

with open("paa_data.json", "w") as f:
    json.dump({"keyword": keyword, "questions": paa}, f, indent=2)
print("Saved PAA data to paa_data.json")

Python Example

Python
import os
import json
import requests

API_KEY = os.environ.get("SCAVIO_API_KEY", "your_scavio_api_key")
ENDPOINT = "https://api.scavio.dev/api/v1/search"

def get_paa(keyword: str) -> list[dict]:
    r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
                      json={"query": keyword, "country_code": "us"})
    r.raise_for_status()
    return r.json().get("people_also_ask", [])

def analyze_content_gaps(keywords: list[str]) -> dict:
    all_questions = {}
    for kw in keywords:
        questions = [item["question"] for item in get_paa(kw)]
        all_questions[kw] = questions
    return all_questions

if __name__ == "__main__":
    keywords = ["vector database", "embedding models 2026"]
    gaps = analyze_content_gaps(keywords)
    print(json.dumps(gaps, indent=2))

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const ENDPOINT = "https://api.scavio.dev/api/v1/search";

async function getPAA(keyword) {
  const res = await fetch(ENDPOINT, {
    method: "POST",
    headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify({ query: keyword, country_code: "us" })
  });
  const data = await res.json();
  return data.people_also_ask || [];
}

async function main() {
  const keywords = ["vector database", "embedding models 2026"];
  for (const kw of keywords) {
    const paa = await getPAA(kw);
    console.log(`\n${kw}:`);
    paa.forEach(item => console.log(`  Q: ${item.question}`));
  }
}
main().catch(console.error);

Expected Output

JSON
{
  "people_also_ask": [
    {
      "question": "What is the difference between RAG and fine-tuning?",
      "snippet": "RAG retrieves external documents at inference time, while fine-tuning...",
      "link": "https://example.com/rag-vs-finetuning"
    },
    {
      "question": "How do vector databases work?",
      "snippet": "Vector databases store high-dimensional embeddings and retrieve...",
      "link": "https://example.com/vector-databases"
    }
  ]
}

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.8 or higher. requests library installed. A Scavio API key. Basic understanding of Python lists and dicts. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Pull People Also Ask questions and answers from Google SERP responses using the Scavio API. Great for content gap analysis and FAQ generation.