# Perplexity Answer & Source Tracker (`xyrelith-data/perplexity-scraper`) Actor

Read public Perplexity answers and Discover articles without login. Get the full answer, every cited source, related questions, media and brand/domain visibility flags for GEO and AI search monitoring.

- **URL**: https://apify.com/xyrelith-data/perplexity-scraper.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** AI, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.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/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 Answer & Source Tracker

Read public Perplexity answers, every cited source, the follow-up questions Perplexity suggests, and the media shown with the answer — without a Perplexity login, cookie or API key.

Perplexity is a useful place to see how an AI answer engine describes a topic, a company or a product, and which pages it chooses to cite. This actor turns those public answers into clean, structured rows for AI visibility, GEO/AEO reporting, citation research and brand monitoring.

### What you get

Two kinds of public records:

- **Shared thread answers** (`recordType: threadAnswer`) — one row per answer turn in a public Perplexity share link.
- **Discover articles** (`recordType: discoverArticle` or `discoverArticlePreview`) — one row per article in Perplexity's public Discover feed, with sections and sources when details are enabled.

Every row is omit-empty: a field the public page does not contain is left out instead of being filled with `null` or a placeholder.

### Modes

| Mode | Input | What it reads |
|---|---|---|
| `threadUrls` (default) | `threadUrls` | Public Perplexity share links (`/search/...`, `/session/...`, `/thread/...`) or bare thread IDs/slugs. |
| `discover` | `discoverTopic` | Perplexity's public Discover feed by topic. Turn `includeArticleDetails` on to open each article. |
| `articleUrls` | `articleUrls` | Specific Discover/Page articles (`/discover/<topic>/<slug>`, `/page/<slug>`) or bare slugs. |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `threadUrls` | `threadUrls`, `discover` or `articleUrls`. |
| `threadUrls` | array | `[]` | Public share links, thread IDs or slugs (mode=`threadUrls`). |
| `discoverTopic` | string | `top` | `top`, `tech`, `finance`, `arts`, `sports` or `entertainment` (mode=`discover`). |
| `articleUrls` | array | – | Public Discover/Page links or slugs (mode=`articleUrls`). |
| `includeArticleDetails` | boolean | `true` | Open each Discover card for full sections and sources (mode=`discover`). |
| `brands` | array | – | Brand or product names to flag in each answer. |
| `domainsToTrack` | array | – | Domains to flag among cited sources; subdomains count. |
| `maxItems` | integer | `50` | Hard cap on emitted records (1–1000). One thread answer turn or one article is one record. |

#### Example: one public thread with brand tracking

```json
{
  "mode": "threadUrls",
  "threadUrls": [
    "https://www.perplexity.ai/search/4d728cec-ccaf-4118-98b8-a133d895bf8a"
  ],
  "brands": ["NIST"],
  "domainsToTrack": ["nist.gov"],
  "maxItems": 5
}
```

#### Example: today's Tech & Science Discover articles

```json
{
  "mode": "discover",
  "discoverTopic": "tech",
  "includeArticleDetails": true,
  "maxItems": 10
}
```

#### Example: specific articles

```json
{
  "mode": "articleUrls",
  "articleUrls": [
    "https://www.perplexity.ai/discover/top/kushner-says-us-now-aims-to-br-d5hpib8MTpy.vrKLT4hG6Q"
  ],
  "maxItems": 3
}
```

### Output

Fields common to every record:

- `recordType` — `threadAnswer`, `discoverArticle` or `discoverArticlePreview`
- `sourceUrl`, `scrapedAt`
- `title`, `answerMarkdown`, `answerText`, `answerHeadline`, `answerSummary`
- `answerCharCount`, `answerWordCount`
- `sources` — cited pages, each with `position`, `title`, `url`, `domain`, `snippet`, `publishedAt`, `sourceType` (`web`, `image`, `video` or `social`)
- `sourceCount`, `uniqueSourceCount`, `citationCount`, `citedDomains`
- `mediaItems` — images and videos shown with the answer (`type`, `title`, `url`, `imageUrl`, `thumbnailUrl`, dimensions, source)
- `brandMentions` — per tracked brand: `mentioned`, `mentionCount`, `firstMentionPosition`, `firstMentionContext`, `firstMentionParagraph`, `citedInSources`, `sourcePositions`
- `trackedDomainCitations` — per tracked domain: `cited`, source `positions`, matching `sourceUrls`

Thread-answer fields:

- `threadId`, `threadUrl`, `threadUrlSlug`, `entryId`, `turn`, `entryCount`
- `query` — the question that produced this answer
- `relatedQuestions` — Perplexity's suggested follow-ups
- `searchQueries` — the search queries Perplexity ran while answering, when the public thread exposes them
- `researchGoals` — the research goals shown in the public thread, when present
- `model`, `userSelectedModel`, `mode`, `searchFocus`, `searchMode`, `searchImplementationMode`, `status`
- `authorUsername`, `authorName`, `threadCreatedAt`, `threadUpdatedAt`, `entryCreatedAt`, `entryUpdatedAt`
- `threadViews`, `threadLikes`, `threadForks` when the public thread shows them

Discover article fields:

- `articleId`, `articleUrl`, `topic`, `topicName`, `shortTitle`, `summary`, `description`
- `bulletSummaryMarkdown`, `firstAnswer`, `sections` (each with `heading`, `answerMarkdown`, `answerText`, `sourceCount`)
- `publishedAt`, `updatedAt`, `authorUsername`, `readTimeMinutes`, `audience`, `isLive`
- `reportedSourceCount` on preview-only records (the card's source count)
- `threadViews`, `threadLikes`, `threadForks` when shown

### Brand and citation tracking

Give `brands` and `domainsToTrack` to turn any public answer into a visibility row. Brand matching is whole-word and case-insensitive; domain matching is subdomain-aware, so `blog.example.com` counts for `example.com`.

The same fields work for thread answers and Discover articles, so you can compare your visibility across both public surfaces.

### Why public pages?

Perplexity now asks signed-out visitors to sign up before showing a freshly generated query answer, even though the query itself runs. Public share links and Discover articles remain readable without an account, and they carry the same answer text, citations, related questions and media. This actor reads those public pages only. It never asks for cookies, a Perplexity API key, or a proxy.

### Reliability

- A fresh browser session is used for each run, with retries when Perplexity briefly challenges the session.
- Private, deleted and malformed links are skipped with a clear run status message instead of failing the run.
- Search links, session links, bare IDs and slugs are all accepted; duplicates are folded.
- The daily test uses one public thread and `maxItems: 1`, so it is a small, credential-free run that always returns a record when Perplexity is reachable.

### FAQ

**Do I need a Perplexity account?**
No. The actor reads public share links and public Discover pages. It does not sign in and does not use cookies supplied by you.

**Can I ask Perplexity a brand-new question with this actor?**
Not without an account: Perplexity withholds new query answers from signed-out visitors. The actor reads answers that already exist on public share pages and Discover. If you have a public share link for a question, paste it into `threadUrls`.

**Why are some sources or related questions missing on a row?**
Perplexity only stores what was generated. Older or simple answers may cite no sources or have no suggested follow-ups; those fields are omitted instead of being fabricated.

**Why does a thread link return no record?**
The thread may be private, deleted, or the link may be incomplete. Share links must be set to be readable by anyone with the link. The run status message reports how many links were skipped.

**How current is the Discover feed?**
It is Perplexity's public editorial feed, ordered by the site. Re-run the actor on a schedule to keep a history of what was published and cited.

**Do you support other languages?**
Public threads are language-agnostic; the actor preserves non-English answers and sources. Discover topics follow Perplexity's public feed, which is primarily English.

**How many records can one run return?**
Up to 1,000 (`maxItems`). Each answer turn in a thread is one record; each Discover article is one record.

# Actor input Schema

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

What to read. `threadUrls` reads public shared answer threads, `discover` reads Perplexity's public Discover feed, and `articleUrls` reads specific Discover/Page articles.

## `threadUrls` (type: `array`):

Perplexity share links such as https://www.perplexity.ai/search/... or /session/... . Bare thread IDs and slugs are also accepted. Only public share links return data; private or deleted threads are skipped.

## `discoverTopic` (type: `string`):

Perplexity Discover topic to read. `top` is the main feed; the other topics match Perplexity's public topic tabs.

## `articleUrls` (type: `array`):

Perplexity Discover or Page links, e.g. https://www.perplexity.ai/discover/tech/<slug> or https://www.perplexity.ai/page/<slug>. Bare article slugs are also accepted.

## `includeArticleDetails` (type: `boolean`):

When enabled, each Discover card is opened to return its full section-by-section answer and complete source list. Turn off for a faster, lighter feed scan with the card summary and preview sources.

## `brands` (type: `array`):

Brand or product names to flag in each answer. The actor returns whether each brand is mentioned, how many times, where it first appears, the surrounding sentence, and whether it appears in a cited source.

## `domainsToTrack` (type: `array`):

Domains such as `example.com` or `https://example.com`. The actor returns whether each domain is cited and at which source positions. Subdomains count.

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

Hard cap on emitted records. In thread mode one record is one answer turn; in Discover and article modes one record is one article.

## Actor input object example

```json
{
  "mode": "threadUrls",
  "threadUrls": [
    "https://www.perplexity.ai/search/4d728cec-ccaf-4118-98b8-a133d895bf8a"
  ],
  "discoverTopic": "top",
  "articleUrls": [],
  "includeArticleDetails": false,
  "brands": [],
  "domainsToTrack": [],
  "maxItems": 1
}
```

# Actor output Schema

## `answers` (type: `string`):

Dataset containing public Perplexity thread answers and Discover articles.

# 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 = {
    "mode": "threadUrls",
    "threadUrls": [
        "https://www.perplexity.ai/search/4d728cec-ccaf-4118-98b8-a133d895bf8a"
    ],
    "discoverTopic": "top",
    "articleUrls": [],
    "includeArticleDetails": false,
    "brands": [],
    "domainsToTrack": [],
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/perplexity-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 = {
    "mode": "threadUrls",
    "threadUrls": ["https://www.perplexity.ai/search/4d728cec-ccaf-4118-98b8-a133d895bf8a"],
    "discoverTopic": "top",
    "articleUrls": [],
    "includeArticleDetails": False,
    "brands": [],
    "domainsToTrack": [],
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/perplexity-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 '{
  "mode": "threadUrls",
  "threadUrls": [
    "https://www.perplexity.ai/search/4d728cec-ccaf-4118-98b8-a133d895bf8a"
  ],
  "discoverTopic": "top",
  "articleUrls": [],
  "includeArticleDetails": false,
  "brands": [],
  "domainsToTrack": [],
  "maxItems": 1
}' |
apify call xyrelith-data/perplexity-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/perplexity-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/mVv8EeQWwY91umbmh/builds/qPyc21yQsldEqyIgs/openapi.json
