# Perplexity Related Questions Scraper (`searchapi/perplexity-related-questions-scraper`) Actor

Scrapes related/follow-up questions from Perplexity search results (perplexity.ai/search). Extracts follow-up questions that appear alongside AI answers.

- **URL**: https://apify.com/searchapi/perplexity-related-questions-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** AI, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 7.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Perplexity Related Questions Scraper

Submit one or multiple questions through Perplexity's current search form and collect the follow-up or related questions rendered with each completed answer. Output includes stable question IDs, ranking and query-match context, the public result URL/thread ID, and useful parent-answer evidence such as excerpt length, word count, citation count, and reported source count.

Choose single or fair batch mode, current Perplexity search modes, question type, keyword filters, sort, global/per-query limits, concurrency, timeouts, and optional proxies. Legacy `focusMode: "web"` remains accepted as the current Search mode. Obsolete academic/social/YouTube/Reddit path modes are rejected because the current interface no longer exposes them as equivalent search modes.

Run locally with `apify run --purge --input-file INPUT.json`. Perplexity may show a Cloudflare challenge or an explicit sign-in wall depending on IP/session state. The Actor detects both and fails without solving CAPTCHAs or storing placeholders. If you are authorized to use an existing Perplexity session, store a Playwright cookie array in the secret environment variable `PERPLEXITY_COOKIES_JSON`; cookie names/values are never logged or written to the dataset. `GOOGLE_SERP` is incompatible with Perplexity browser traffic; use an authorized Residential or custom HTTPS proxy when appropriate.

The current public result page exposes questions in rendered DOM sections, not in a reliable public structured endpoint. Extraction therefore validates the initial status/content type, submits the visible form, waits for answer streaming to stabilize, then parses exact Follow-ups/Related surfaces with a bounded semantic fallback. Results are written atomically only after every requested query succeeds.

# Actor input Schema

## `mode` (type: `string`):

Single uses query; batch combines query and queries.

## `query` (type: `string`):

Question to enter in Perplexity's search form.

## `queries` (type: `array`):

Additional unique searches used in batch mode, up to ten total.

## `focusMode` (type: `string`):

Current search mode to choose in the Perplexity interface.

## `model` (type: `string`):

Optional exact model label to choose from the current Perplexity model menu.

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

Browser locale, for example en-US.

## `questionTypes` (type: `string`):

Return all discovered questions or restrict the output type.

## `includeKeywords` (type: `array`):

Keep questions containing at least one value, case-insensitively.

## `excludeKeywords` (type: `array`):

Remove questions containing any value, case-insensitively.

## `sortBy` (type: `string`):

Sort each query before fair batch allocation.

## `maxItems` (type: `integer`):

Global output limit allocated fairly across batch queries.

## `maxItemsPerQuery` (type: `integer`):

Additional output limit for each query.

## `maxConcurrency` (type: `integer`):

Maximum simultaneous Perplexity search sessions.

## `maxRequestRetries` (type: `integer`):

Retries for temporary browser or network failures.

## `navigationTimeoutSecs` (type: `integer`):

Maximum seconds for page navigation and result URL creation.

## `answerTimeoutSecs` (type: `integer`):

Maximum seconds to wait for answer streaming and question rendering.

## `requestHandlerTimeoutSecs` (type: `integer`):

Maximum processing seconds per query.

## `proxyConfiguration` (type: `object`):

Optional Apify Residential or custom HTTPS-capable proxy. No proxy is enabled implicitly.

## Actor input object example

```json
{
  "mode": "single",
  "query": "What are the main causes of climate change?",
  "queries": [],
  "focusMode": "search",
  "language": "en-US",
  "questionTypes": "all",
  "includeKeywords": [],
  "excludeKeywords": [],
  "sortBy": "sourceOrder",
  "maxItems": 20,
  "maxItemsPerQuery": 10,
  "maxConcurrency": 2,
  "maxRequestRetries": 1,
  "navigationTimeoutSecs": 45,
  "answerTimeoutSecs": 60,
  "requestHandlerTimeoutSecs": 120,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "query": "What are the main causes of climate change?",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/perplexity-related-questions-scraper").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 = {
    "query": "What are the main causes of climate change?",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/perplexity-related-questions-scraper").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 '{
  "query": "What are the main causes of climate change?",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call searchapi/perplexity-related-questions-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,searchapi/perplexity-related-questions-scraper"
        }
    }
}
```

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/w7t7eVhvY79Jj6u9y/builds/s6eLICwYRjp4wI8qu/openapi.json
