# Perplexity AI Scraper (`ayen-data/perplexity-ai-scraper`) Actor

Asks Perplexity AI questions and returns the answer with its cited sources.

- **URL**: https://apify.com/ayen-data/perplexity-ai-scraper.md
- **Developed by:** [Anyx Solutions](https://apify.com/ayen-data) (community)
- **Categories:** AI, Agents, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.00 / 1,000 results

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

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

![banner](https://i.ibb.co/XZ48HSpZ/perplexity-scraper.png)

## Perplexity Scraper

**Ask Perplexity AI a question and get the answer with its cited sources.**

Give this scraper a list of questions and it returns Perplexity's AI answer for each, along with the sources it cited — full source URLs, their domains, and the cited-domain list. It waits for each answer to finish generating, expands the sources panel, and returns clean structured JSON. It suits research automation, source discovery, competitive and market monitoring, and feeding AI-answer data with citations into your own pipelines.

### ⚡ Quick start

```json
{
  "queries": [
    "When was OpenAI founded and by whom?",
    "What are the latest James Webb telescope discoveries?"
  ],
  "maxItems": 10
}
```

### 🧩 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `queries` | array | yes\* | — | Questions to ask Perplexity. One entry per question. |
| `startUrls` | array | no | — | Perplexity search URLs to scrape directly, e.g. `https://www.perplexity.ai/search?q=example`. Use instead of `queries` for full control. |
| `maxItems` | integer | yes | `10` | Maximum number of questions to answer in this run. |
| `proxyConfiguration` | object | no | Residential | Proxy settings. Perplexity sits behind Cloudflare, so residential proxies are the default. |

\* Provide either `queries` or `startUrls`.

### 📤 Output

Each question becomes one dataset item: the answer text, the list of cited sources with their URLs and domains, and the flat list of cited domains. Perplexity's answer is an AI synthesis, so treat `answer` as a summary and use the `sources` for anything you need to verify or process further. Fields a question does not produce are returned as `null` or an empty array rather than omitted.

#### Fields

| Field | Type | Description |
|---|---|---|
| `query` | string | The question that was asked. |
| `url` | string | The Perplexity thread URL for the answer. |
| `answer` | string | Perplexity's AI answer text. |
| `sources` | array | Cited sources, each `{ url, domain, snippet }`. |
| `citedDomains` | array | Flat list of unique domains Perplexity cited. |
| `sourceCount` | number | Number of sources returned. |
| `fetchedAt` | string | When the answer was scraped, ISO 8601. |

<details><summary>Example output</summary>

```json
{
  "query": "When was OpenAI founded and by whom?",
  "url": "https://www.perplexity.ai/search/b7772960-9e7f-4253-9279-c3c51eff77e4",
  "answer": "OpenAI was founded in December 2015. The founders include Sam Altman, Elon Musk, Ilya Sutskever, Greg Brockman, Wojciech Zaremba, John Schulman, and others.",
  "sources": [
    {
      "url": "https://en.wikipedia.org/wiki/OpenAI",
      "domain": "en.wikipedia.org",
      "snippet": "OpenAI - Wikipedia In December 2015, OpenAI was founded as the nonprofit organization OpenAI, Inc..."
    }
  ],
  "citedDomains": ["en.wikipedia.org", "britannica.com", "openai.com"],
  "sourceCount": 10,
  "fetchedAt": "2026-07-24T19:42:11.884Z"
}
```

</details>

### 💡 Use cases

- Automate research on a topic and keep the sources Perplexity cited.
- Discover authoritative pages for a company or subject, then fetch them for full detail.
- Monitor how questions about a brand or product are answered over time.
- Feed AI answers with citations into knowledge bases and LLM pipelines.
- Collect a domain list of what Perplexity considers credible for a topic.

### ❓ FAQ

- **Do I need a proxy?** Yes. Perplexity sits behind Cloudflare and blocks datacenter traffic, so residential proxies are the default and strongly recommended.
- **Are the answers reliable?** The `answer` is an AI synthesis and can be incomplete or wrong, so use it as a summary. The `sources` are the pages Perplexity cited — use those to verify or to fetch full content.
- **Why are source snippets a mix of title and description?** They are taken from the source cards as Perplexity displays them. The `url` and `domain` are always clean; fetch the page itself for a precise title and body.
- **What happens if Perplexity shows a Cloudflare challenge?** The scraper detects it, retires that session, and retries on a fresh one. If every attempt is blocked it fails with a clear error rather than returning the challenge page as an answer.
- **Can I control the AI model or mode?** No. It uses Perplexity's default search answer, the same one an anonymous visitor sees.

### 🔗 More scrapers by Anyx

- [Google AI Scraper](https://apify.com/anyxsolutions/google-ai-scraper)
- [Google Search Scraper](https://apify.com/anyxsolutions/google-search-scraper)
- [Bing Search Scraper](https://apify.com/anyxsolutions/bing-search-scraper)
- [Web Content Scraper](https://apify.com/anyxsolutions/web-content-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: thantosthor@gmail.com

### 🖼 Image credit

Image credit: [www.perplexity.ai](https://www.perplexity.ai/)

# Actor input Schema

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

Questions to ask Perplexity. One entry per question.

## `startUrls` (type: `array`):

Optional Perplexity search URLs to scrape directly, for example https://www.perplexity.ai/search?q=example. Use instead of Questions for full control.

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

Maximum number of questions to answer in this run.

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

Apify proxy settings. Perplexity sits behind Cloudflare and blocks datacenter traffic, so residential proxies are used by default and strongly recommended.

## Actor input object example

```json
{
  "queries": [
    "When was OpenAI founded and by whom?",
    "What are the latest James Webb telescope discoveries?"
  ],
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "queries": [
        "When was OpenAI founded and by whom?",
        "What are the latest James Webb telescope discoveries?"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ayen-data/perplexity-ai-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 = { "queries": [
        "When was OpenAI founded and by whom?",
        "What are the latest James Webb telescope discoveries?",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ayen-data/perplexity-ai-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "queries": [
    "When was OpenAI founded and by whom?",
    "What are the latest James Webb telescope discoveries?"
  ]
}' |
apify call ayen-data/perplexity-ai-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ayen-data/perplexity-ai-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/mplyVZeXikWiYvxfU/builds/QvktjZOeh9TfcFKRV/openapi.json
