People Also Ask Scraper avatar

People Also Ask Scraper

Pricing

Pay per usage

Go to Apify Store
People Also Ask Scraper

People Also Ask Scraper

Extract Google's People Also Ask questions for keywords, with optional tree expansion for multi-level questions. Perfect for SEO content research, topic cluster creation, FAQ generation, and content brief development.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

HappiTap

HappiTap

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

People Also Ask (PAA) SEO Scraper

Extract Google's People Also Ask questions for keywords, with optional tree expansion for multi-level questions. Perfect for SEO content research, topic cluster creation, FAQ generation, and content brief development.

๐Ÿš€ Features

  • PAA Extraction: Scrape People Also Ask questions from Google SERP
  • Tree Expansion: Expand questions to discover multi-level related questions
  • Multi-locale Support: Target specific countries and languages
  • Device Targeting: Desktop and mobile search simulation
  • Proxy Support: Built-in proxy rotation for reliability
  • Deduplication: Automatic duplicate question removal
  • Multiple Output Formats: Dataset, JSON, CSV export options
  • Rate Limiting: Configurable delays and retry logic
  • Answer Snippets: Optional answer extraction when available
  • Comprehensive Testing: Full test suite with 95%+ coverage

๐Ÿ“‹ Input Configuration

Keyword Inputs

  • keywords: Array of keywords to search
  • keywordsText: Multiline string with keywords (one per line)
  • inputDatasetId: Read keywords from existing dataset

Locale & Search Controls

  • country: Two-letter ISO country code (default: "US")
  • language: Language code (default: "en")
  • gl: Override Google "gl" parameter
  • hl: Override Google "hl" parameter
  • uule: Encoded location for city-level targeting
  • device: Device type - "desktop" or "mobile" (default: "desktop")

PAA Extraction Controls

  • mode: "paa_only" or "paa_tree" (default: "paa_only")
  • treeDepth: Maximum expansion depth for tree mode (default: 2)
  • maxQuestionsPerKeyword: Maximum questions per keyword (default: 80)
  • maxExpansions: Maximum expansions in tree mode (default: 40)

Rate & Reliability

  • proxyConfiguration: Apify proxy configuration (residential proxies recommended)
  • maxConcurrency: Maximum concurrent requests (default: 5)
  • requestRetries: Number of retries for failed requests (default: 5)
  • minDelayMs: Minimum delay between requests (default: 1000)
  • maxDelayMs: Maximum delay between requests (default: 4000)
  • timeoutSecs: Request timeout in seconds (default: 30)

Output Options

  • outputFormat: "dataset", "json", or "csv" (default: "dataset")
  • dedupe: Remove duplicate questions (default: true)
  • includeSerpMeta: Include SERP metadata (default: true)
  • includeAnswerSnippets: Extract answer snippets (default: false)

๐Ÿ“Š Output Schema

Question Records

Each extracted question includes:

  • keyword: Original search keyword
  • question: The PAA question text
  • questionNormalized: Normalized question for deduplication
  • depth: Question depth (0 for direct PAA, >0 for expanded)
  • parentQuestion: Parent question in tree mode
  • position: Question position in the block
  • answerSnippet: Answer snippet when available
  • sourceUrl: Google SERP URL used
  • country, language, device: Search parameters
  • scrapedAt: ISO timestamp
  • hash: Unique dedupe key

Keyword Summary

  • keyword: Search keyword
  • totalQuestions: Number of questions found
  • maxDepthReached: Maximum depth achieved in tree mode
  • status: "ok", "blocked", or "no_paa_found"
  • errorReason: Error details if failed

๐Ÿ’ก Usage Examples

Example 1: Basic PAA Extraction

{
"keywordsText": "best crm for small business\nwhatsapp marketing automation\nhow to start ecommerce store",
"country": "IN",
"language": "en",
"mode": "paa_only",
"maxQuestionsPerKeyword": 50,
"proxyConfiguration": {
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

Example 2: PAA Tree Mode

{
"keywords": ["best seo tools"],
"country": "US",
"language": "en",
"mode": "paa_tree",
"treeDepth": 3,
"maxQuestionsPerKeyword": 100,
"maxExpansions": 50,
"includeAnswerSnippets": true,
"proxyConfiguration": {
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

Example 3: Large Scale Research

{
"inputDatasetId": "YOUR_DATASET_ID",
"country": "US",
"language": "en",
"mode": "paa_tree",
"treeDepth": 2,
"maxQuestionsPerKeyword": 80,
"maxConcurrency": 3,
"minDelayMs": 2000,
"maxDelayMs": 5000,
"outputFormat": "csv",
"proxyConfiguration": {
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

๐ŸŽฏ Use Cases

SEO Content Strategy

  • Topic Clusters: Discover related questions for content hub creation
  • Content Briefs: Generate comprehensive briefs with user questions
  • FAQ Generation: Create FAQ sections from real user queries
  • Schema Markup: Generate FAQ schema JSON-LD automatically

Market Research

  • User Intent: Understand what users are asking about topics
  • Content Gaps: Identify questions your competitors aren't answering
  • Keyword Expansion: Find long-tail question-based keywords

Content Marketing

  • Blog Ideas: Generate endless blog post ideas from questions
  • Video Topics: Create video content that answers specific questions
  • Social Media: Develop social content around user questions

โšก Performance & Limits

  • MVP: 50-200 keywords per run
  • Concurrency: 3-5 concurrent requests to avoid blocks
  • Proxies: Use residential proxies for large scale scraping

Rate Limiting

  • Built-in delays between requests (1-4 seconds default)
  • Automatic retry with exponential backoff
  • Session management for request rotation

Block Detection

  • Automatic detection of captchas and blocks
  • Graceful handling of blocked keywords
  • Continues processing remaining keywords

๐Ÿงช Testing

This actor includes a comprehensive test suite:

# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch

Test Coverage

  • Unit Tests: Core functionality (normalization, hashing, URL building)
  • Integration Tests: Full workflow testing
  • Schema Validation: Output data quality and structure
  • Error Handling: Edge cases and failure scenarios

๐Ÿ—๏ธ Development

Local Development

# Clone the actor
git clone https://github.com/apify/people-also-ask-scraper
# Install dependencies
npm install
# Run tests
npm test
# Run locally with sample input
node test-local.js

Project Structure

people-also-ask-scraper/
โ”œโ”€โ”€ main.js # Main scraper implementation
โ”œโ”€โ”€ tests/
โ”‚ โ”œโ”€โ”€ unit/ # Unit tests
โ”‚ โ”œโ”€โ”€ integration/ # Integration tests
โ”‚ โ””โ”€โ”€ validation/ # Schema validation tests
โ”œโ”€โ”€ .actor/
โ”‚ โ”œโ”€โ”€ INPUT_SCHEMA.json # Input schema definition
โ”‚ โ””โ”€โ”€ Dockerfile # Docker configuration
โ”œโ”€โ”€ example-input.json # Sample input
โ””โ”€โ”€ README.md # This file

๐Ÿ“ˆ Pricing Tiers

Starter

  • 100 keywords per run
  • Basic PAA extraction
  • Dataset output

Pro

  • 1,000 keywords per run
  • Tree mode expansion
  • CSV export + webhooks

Agency

  • 10,000 keywords per run
  • Priority support
  • Custom integrations

๐Ÿšจ Error Handling

Common Issues

  • Blocked by Google: Try reducing concurrency or using different proxies
  • No PAA Found: Some keywords don't trigger PAA results
  • Rate Limited: Increase delays between requests

Status Codes

  • ok: Successfully processed
  • blocked: Blocked by Google anti-bot
  • no_paa_found: No PAA questions detected

๐Ÿ”„ Version History

v1.0.0 (Current)

  • โœ… Initial release
  • โœ… PAA extraction functionality
  • โœ… Tree expansion mode
  • โœ… Multi-locale support
  • โœ… Proxy integration
  • โœ… Multiple output formats
  • โœ… Comprehensive test suite
  • โœ… Error handling improvements
  • โœ… Performance optimizations

๐Ÿ“„ License

ISC License - see LICENSE file for details

๐Ÿ†˜ Support

๐ŸŽ‰ Ready for Production

This actor has been thoroughly tested and is ready for production use:

  • โœ… 30+ passing tests with comprehensive coverage
  • โœ… Robust error handling for edge cases
  • โœ… Performance optimized for large-scale scraping
  • โœ… Schema validated output data
  • โœ… Production ready configuration

The scraper has been validated to handle various scenarios including network issues, rate limiting, and different Google SERP layouts.