# Google People Also Ask Tree Explorer (`crawlyth-forge/google-paa-tree`) Actor

Expand Google's People Also Ask box into a recursive question tree. Enter seed keywords and get every question, parent, depth, answer snippet and answering domain per level, plus a nested tree and per-seed clusters for SEO and content research.

- **URL**: https://apify.com/crawlyth-forge/google-paa-tree.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** SEO tools, Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google People Also Ask Tree Explorer

Google's People Also Ask box is a map of what searchers ask next. Most tools stop at the four questions visible on the first page. This actor searches each question too, so the box grows into a real tree: every question keeps its parent, its depth, its order, and the answer Google shows for it.

Enter one or more seed keywords. For each seed you get flat question rows for CSV and spreadsheets, plus one nested tree record for JSON pipelines.

### What you get

One dataset row per question:

| Field | Meaning |
|---|---|
| `seed` | The keyword this tree started from |
| `question` | The question exactly as Google phrases it |
| `parentQuestion` | The question that revealed this one (`seed` at the first level) |
| `depth` | 1 for the first People Also Ask layer, 2 for the next, up to 4 |
| `position` | The question's order inside its parent's People Also Ask list |
| `answerSnippet` | The answer snippet Google returns for that question |
| `answerType` | `paragraph`, `list` or `table` |
| `answerSourceTitle` | Title of the page that answers it |
| `answerSourceUrl` | The answering page's site URL |
| `answerSourceDomain` | Domain only, ready for competitor tallies |
| `searchUrl` | The Google result page used to collect the row |
| `country`, `language`, `device` | The market settings used |

One extra `seedTree` row per seed adds:

| Field | Meaning |
|---|---|
| `summary.uniqueQuestionCount` | Unique questions in this tree |
| `summary.maxDepthReached` | Deepest layer that had questions |
| `summary.topAnsweringDomains` | Domains that answer the most questions, with counts |
| `summary.questionClusters` | Questions grouped by opening word (`what`, `how`, `why`, `can`, `is`, ...) |
| `tree` | The same questions as a nested JSON tree with `children` |
| `relatedSearches` | Google's related searches for the seed, with working URLs |

### Input

| Setting | Default | What it does |
|---|---|---|
| `seedKeywords` | – | The topics to build trees for. One tree per seed, up to 20 seeds. |
| `country` | `us` | The market to search from. 50 countries are available. |
| `language` | `en` | Result language. Match your keywords for the richest boxes. |
| `device` | `desktop` | Desktop or mobile. Google can show different questions on each. |
| `depth` | `2` | How many question layers to follow. `1` keeps the first People Also Ask layer. |
| `maxQuestionsPerSeed` | `30` | A hard stop so broad topics cannot run away. Maximum 200. One slot is reserved for each deeper level, so a small cap still reaches the requested depth. |
| `includeAnswers` | `true` | Adds the answer and its source to every question. |
| `includeRelatedSearches` | `true` | Adds Google's related searches to the tree record. |

No API key, cookie, login, or proxy setup is needed. The actor handles access automatically.

### Example

Input:

```json
{
  "seedKeywords": ["what is seo"],
  "country": "us",
  "language": "en",
  "device": "desktop",
  "depth": 2,
  "maxQuestionsPerSeed": 30
}
```

A question row:

```json
{
  "recordType": "question",
  "seed": "what is seo",
  "question": "What is SEO and how does it work?",
  "parentQuestion": "what is seo",
  "depth": 1,
  "position": 1,
  "answerSnippet": "SEO stands for search engine optimization. It is the practice of improving a website so search engines can find, understand and recommend it.",
  "answerType": "paragraph",
  "answerSourceTitle": "What Is SEO? A Beginner's Guide",
  "answerSourceUrl": "https://example.com",
  "answerSourceDomain": "example.com",
  "country": "us",
  "language": "en",
  "device": "desktop"
}
```

A tree record (shortened):

```json
{
  "recordType": "seedTree",
  "seed": "what is seo",
  "summary": {
    "uniqueQuestionCount": 18,
    "maxDepthReached": 2,
    "topAnsweringDomains": [
      {"domain": "developers.google.com", "count": 3},
      {"domain": "semrush.com", "count": 2}
    ],
    "questionClusters": [
      {"openingWord": "what", "count": 6},
      {"openingWord": "how", "count": 5}
    ]
  },
  "tree": {
    "question": "what is seo",
    "depth": 0,
    "children": [
      {
        "question": "What is SEO and how does it work?",
        "depth": 1,
        "children": [
          {"question": "What is SEO in simple words?", "depth": 2}
        ]
      }
    ]
  }
}
```

### How to use the tree

- **Content briefs:** each branch is an H2 and FAQ section, in the order people actually ask.
- **FAQ schema:** turn question and answer pairs into FAQPage markup.
- **Featured-snippet targeting:** `answerSourceDomain` shows who owns each answer today.
- **Keyword research:** questions are long-tail keywords with proven demand.
- **Chatbots and AI training:** real questions with sourced answers.
- **Market comparison:** run the same seeds per country and compare the trees.

### Data source and honest limits

- The actor reads public Google search result pages without cookies or accounts.
- Google renders the four first-level People Also Ask questions in the result page. The next layer is collected by searching each question, which is what the expand-on-click action does in the browser too.
- The answer snippet is the best answer Google returns for that exact question in the static result page: the top organic result's snippet, title and domain. Google's generated AI Overview text is produced by client-side JavaScript and is not exposed in the static page, so it is not included or invented.
- `answerSourceUrl` is the source site URL (scheme plus domain). Google obfuscates the exact outbound link in the static page; the domain in `answerSourceDomain` is the real answering site.
- People Also Ask boxes vary by country, language, device, and time. A seed with no box produces a tree record with zero questions instead of an error.
- Hard stops: 20 seeds per run, depth 1-4, 200 questions per seed, and 1,000 questions per run. These are safety limits, not source limits.

### FAQ

**Does every keyword have a People Also Ask box?**
No. Navigational, local, and very narrow queries often have none. Those seeds return a tree record with `uniqueQuestionCount: 0` so you can tell "no box" apart from a failed run.

**Why is the answer sometimes missing?**
The answer fields are added only when Google returns an organic result with a real source domain for that question. The question, parent, depth, and position are still collected.

**Can I export this to a spreadsheet?**
Yes. Every question is its own row with flat fields. Choose CSV or Excel in the dataset export.

**Can I compare countries?**
Run the actor once per country. A single run uses one country, language, and device so the trees stay comparable.

**How do I keep a run small?**
Use `depth: 1` and a small `maxQuestionsPerSeed`, such as 5. Each unique question costs one search.

**Does the actor need an Apify proxy or any credentials?**
No. It works with the default account setup and needs no token, cookie, or proxy configuration from you.

# Actor input Schema

## `seedKeywords` (type: `array`):

Topics or questions to start each tree from, e.g. "what is seo", "best crm for small business". One tree is built per seed.

## `country` (type: `string`):

Market to search from. People Also Ask questions and answers vary by country.

## `language` (type: `string`):

Interface and result language. Match the language of your seed keywords for the richest boxes.

## `device` (type: `string`):

Desktop and mobile can show different questions and orderings. Pick the one your audience uses.

## `depth` (type: `integer`):

How many question layers to expand below each seed. 1 keeps only the first People Also Ask questions; 4 follows the tree four levels deep.

## `maxQuestionsPerSeed` (type: `integer`):

Stop expanding a seed after this many unique questions. Keeps large or ambiguous topics from running away.

## `includeAnswers` (type: `boolean`):

Add the best available answer snippet, source title, source URL and domain for every question. Uses the same search request, so it does not add cost.

## `includeRelatedSearches` (type: `boolean`):

Add Google's related searches to each seed's tree record. Uses the same search request.

## Actor input object example

```json
{
  "seedKeywords": [
    "what is seo"
  ],
  "country": "us",
  "language": "en",
  "device": "desktop",
  "depth": 1,
  "maxQuestionsPerSeed": 2,
  "includeAnswers": true,
  "includeRelatedSearches": false
}
```

# Actor output Schema

## `questions` (type: `string`):

Dataset containing one row per question plus one nested tree record per seed keyword.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "seedKeywords": [
        "what is seo"
    ],
    "country": "us",
    "language": "en",
    "device": "desktop",
    "depth": 1,
    "maxQuestionsPerSeed": 2,
    "includeAnswers": true,
    "includeRelatedSearches": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/google-paa-tree").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "seedKeywords": ["what is seo"],
    "country": "us",
    "language": "en",
    "device": "desktop",
    "depth": 1,
    "maxQuestionsPerSeed": 2,
    "includeAnswers": True,
    "includeRelatedSearches": False,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/google-paa-tree").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "seedKeywords": [
    "what is seo"
  ],
  "country": "us",
  "language": "en",
  "device": "desktop",
  "depth": 1,
  "maxQuestionsPerSeed": 2,
  "includeAnswers": true,
  "includeRelatedSearches": false
}' |
apify call crawlyth-forge/google-paa-tree --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/google-paa-tree"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/JogwWRwHsfO1UYgQo/builds/DaZRQ07Gc6PeXaJWF/openapi.json
