# Subreddit Audience Overlap & Lookalike Community Finder (`xyrelith-data/subreddit-audience-overlap`) Actor

Map where a subreddit's audience also spends time. Sample recent active authors from seed communities and rank lookalike subreddits by shared authors, overlap and size-adjusted lift. Also discovers communities by prefix or keyword and profiles user lists. No Reddit login, API key, cookie or proxy.

- **URL**: https://apify.com/xyrelith-data/subreddit-audience-overlap.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** Social media, Lead generation, Automation
- **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

## Subreddit Audience Overlap & Lookalike Community Finder

Reddit reach is fragmented. The people who read one community are also in five or ten others, and the names rarely make the relationship obvious. This actor samples the people who actually post and comment in a seed subreddit, reads where else each of them is active, and ranks the communities that share the largest part of that audience.

It also lists communities by name prefix or keyword, and profiles a list of usernames together. All counts come from the public **Arctic Shift** Reddit archive. Reddit's public **Atom RSS** feeds add live seed metadata, a fallback author sample and community-search fallback. No Reddit login, API key, cookie or proxy is needed, and Reddit's blocked `.json` endpoints are never used.

### Three ways to map an audience

| Mode | Question it answers | Example |
|---|---|---|
| **Audience overlap** | Where else does r/SaaS's audience hang out? | Rank lookalike communities by shared authors and lift |
| **Discover communities** | Which communities match this name prefix or keyword? | `machine learning`, `personal finance`, `pyth` |
| **User set** | Which communities does this group of usernames use most? | A list of 25 customers, creators or leads |

### Quick start

Keep the default mode (**Audience overlap**), leave the seed as `python`, and run. The default input samples 25 recent authors from the last 30 days and returns up to five related communities. A row looks like this:

```json
{
  "mode": "overlap",
  "recordType": "audienceOverlap",
  "seedSubreddit": "python",
  "relatedSubreddit": "learnpython",
  "rank": 1,
  "sharedAuthors": 11,
  "overlapPercent": 44.0,
  "lift": 2.41,
  "relatedActivityCount": 63,
  "relatedSubscribers": 761000,
  "sampleSize": 25,
  "authorsProfiled": 25,
  "contentType": "both",
  "activityWindowDays": 30,
  "exampleSharedAuthors": ["author_one", "author_two", "author_three"],
  "relatedDescription": "A place to learn and ask Python questions.",
  "relatedNsfw": false,
  "relatedType": "public",
  "relatedCreatedAt": "2011-06-30T00:00:00+00:00",
  "source": "arctic-shift+reddit-rss",
  "sourceUrl": "https://www.reddit.com/r/learnpython/",
  "scrapedAt": "2026-11-17T12:00:00+00:00"
}
```

### Inputs

| Input | Default | What it does |
|---|---|---|
| `mode` | `overlap` | `overlap`, `discover` or `userSet`. |
| `subreddits` | – | Seed communities for overlap mode. Bare names, `r/` names and Reddit URLs are accepted. |
| `usernames` | – | Authors for user-set mode. Bare names, `u/` names and profile URLs are accepted. |
| `query` | – | Discover mode: a name prefix or a keyword phrase. |
| `sampleAuthors` | `200` | Unique recent authors sampled per seed (10-2,000). |
| `activityWindow` | `90` | Days of recent activity: `7`, `30`, `90`, `180` or `365`. |
| `contentType` | `both` | Count `posts`, `comments` or `both`. |
| `excludeBots` | `true` | Skip AutoModerator and bot-looking names. Deleted authors are always skipped. |
| `excludeAuthors` | – | Extra usernames to skip, case-insensitive. |
| `minSharedUsers` | `1` | Keep a community only when at least this many sampled users are active there. |
| `maxLookalikes` | `20` | Related communities returned per seed (1-100). |
| `includeNsfw` | `false` | Include communities marked over-18. |
| `minSubscribers` | `0` | Skip smaller communities. |
| `maxSubscribers` | – | Skip larger communities. A maximum below the minimum matches nothing. |
| `excludeSubreddits` | – | Communities to leave out of related and user-set results. |
| `discoverSort` | `subscribers` | Discover ordering: `subscribers`, `created` or `name`. |
| `discoverSortOrder` | `desc` | `desc` or `asc`. |
| `maxItems` | `500` | Overall row cap. |

### What comes out

Every row is flat, omit-empty and carries `mode`, `recordType`, `source`, `sourceUrl` and `scrapedAt`.

#### `audienceOverlap`

One row per seed and related community: `seedSubreddit`, `relatedSubreddit`, `rank`, `sharedAuthors`, `overlapPercent`, `lift`, `relatedActivityCount`, `sampleSize`, `authorsProfiled`, `contentType`, `activityWindowDays`, `exampleSharedAuthors`, `seedLatestPostAt`, plus the related community's `relatedSubscribers`, `relatedCreatedAt`, `relatedDescription`, `relatedNsfw`, `relatedType`, `relatedCategory`, `relatedLanguage`, archived post/comment totals and earliest dates.

#### `subredditDiscovery`

One row per matched community: `subreddit`, `rank`, `matchedQuery`, `title`, `publicDescription`, `subscribers`, `createdAt`, `nsfw`, `subredditType`, `category`, `language`, archived post/comment totals, earliest dates and `sourceUrl`.

#### `userAudience`

One row per community used by the supplied users: `subreddit`, `rank`, `activeUsers`, `activityCount`, `activitySharePercent`, `audienceSharePercent`, `lift`, `profiledUsers`, `activityWindowDays`, `contentType`, `exampleUsers`, the community metadata and `sourceUrl`.

### How the numbers are built

1. **Sample.** For each seed, the actor pages through recent comments (and posts when `contentType` is `both`) until it has enough unique authors. Bots, AutoModerator and deleted authors are filtered. If the archive has not indexed the seed yet, the public Atom feed supplies a small fallback sample.
2. **Footprint.** For each sampled author, the archive returns the subreddits they posted or commented in during the same window, with counts. One request per author; repeated authors across seeds are cached.
3. **Overlap.** A related community enters the result when at least `minSharedUsers` sampled authors are active there. `overlapPercent` is `sharedAuthors / authorsProfiled * 100`.
4. **Lift.** `lift` compares the community's share of the seed audience with its share of the candidate pool's subscribers: `(sharedAuthors / totalSharedAuthors) / (subscribers / totalCandidateSubscribers)`. A lift of 2 means the community attracts twice the audience share its size would predict. Communities without a subscriber count are ranked but have no lift.
5. **Rank.** Related communities are ordered by shared authors, then total activity, then name. The top `maxLookalikes` per seed are returned.

User-set mode does the same footprint step for every supplied username, then ranks communities by total activity and reports both activity share and audience share. Discover mode reads the archive's subreddit directory by name prefix; a keyword phrase also uses Reddit's public community-search RSS and an archive name/description fallback.

### Limits you should know

- **The sample is a sample.** `overlapPercent` describes the sampled authors, not every subscriber. Increase `sampleAuthors` for a steadier estimate; 25 is a quick look, 200-1,000 is a research run.
- **Recent archive lag.** New posts and comments can take hours to appear in Arctic Shift, and deleted content that was never archived cannot be counted.
- **Subreddit metadata refresh.** Subscriber counts and descriptions come from the archive's infrequently refreshed community directory. They can differ slightly from the live page.
- **Very broad keywords.** The archive has no global full-text search across every subreddit. Discover uses name prefixes, community-search RSS and name/description matching, so an unusual phrase can return fewer communities than Reddit's own search.
- **NSFW and size filters** are applied after metadata is read. If metadata is missing, the community is kept rather than invented.
- **Lift needs a trustworthy size.** Lift is omitted when a community has no subscriber count or fewer than 100 subscribers, because the archive's count is unreliable for very new or very small communities. The row still appears with its shared-author and overlap numbers.
- **Rate limits.** Arctic Shift is a free volunteer service. Requests are paced and retried; a very large `sampleAuthors` value takes longer because each author needs one footprint request.

### Data source

Primary: [Arctic Shift](https://arctic-shift.photon-reddit.com), a free public Reddit archive API. Secondary: Reddit's public Atom feeds (`/r/<name>/new/.rss`, `/user/<name>/.rss` and `/subreddits/search.rss`) for live metadata, fallback author samples and community-search fallback. Reddit's protected `.json` endpoints are not used.

### FAQ

**Do I need a Reddit account or API key?** No.

**Why does a related community have no `lift`?** The archive did not return a subscriber count for it. The row is still useful; lift needs a size to compare against.

**Why is the shared-author count lower than I expected?** The actor only sees archived public activity in the selected window, and it samples a limited number of seed authors. Raise `sampleAuthors` and widen `activityWindow` for a broader view.

**Can I compare several seeds in one run?** Yes. Add them to `subreddits`; each seed gets its own ranked list and every row names its seed.

**Can I schedule this?** Yes. Every row carries `scrapedAt`, `activityWindowDays` and the seed, so repeated runs line up in a warehouse or spreadsheet.

# Actor input Schema

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

Audience overlap finds lookalike communities for one or more seed subreddits. Discover lists communities by name prefix or keyword. User set profiles a list of usernames collectively.

## `subreddits` (type: `array`):

Overlap mode: communities whose audience you want to map. Accepts bare names (python), r/ names or full Reddit URLs. Each seed is analysed separately.

## `usernames` (type: `array`):

User-set mode: Reddit authors to profile together. Accepts bare names, u/ names or profile URLs.

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

Discover mode: a subreddit name prefix (python, data) or a keyword phrase (machine learning, personal finance). Prefixes search the archive directly; phrases also use Reddit's public community-search RSS and archive name/description matching.

## `sampleAuthors` (type: `integer`):

Overlap mode: how many recent unique authors to sample from each seed before reading their footprints. Larger samples are more stable but cost more archive requests. 200 is a good default; 25 is enough for a quick test.

## `activityWindow` (type: `string`):

How far back recent activity is sampled. The same window is used for the seed authors and their footprints.

## `contentType` (type: `string`):

Count posts, comments or both when sampling authors and building footprints. Comments usually give the largest sample.

## `excludeBots` (type: `boolean`):

Leave out AutoModerator and usernames that look like bots (names ending in bot or containing \_bot/-bot). Deleted and removed authors are always excluded.

## `excludeAuthors` (type: `array`):

Additional usernames to leave out of the sample, case-insensitive.

## `minSharedUsers` (type: `integer`):

Overlap mode: keep a related community only when at least this many sampled seed authors are active there. User-set mode: keep a community only when at least this many supplied users are active there. Raise it to cut one-off crossovers.

## `maxLookalikes` (type: `integer`):

Overlap mode: maximum related communities to return for each seed, ranked by shared authors.

## `includeNsfw` (type: `boolean`):

When off, communities marked over-18 by the archive are left out of related and discover results. Seed subreddits may still be NSFW.

## `minSubscribers` (type: `integer`):

Skip communities below this subscriber count. Applies to related communities, discover results and user-set results. Leave 0 for no minimum.

## `maxSubscribers` (type: `integer`):

Skip communities above this subscriber count. Leave empty for no maximum. A maximum below the minimum matches nothing.

## `excludeSubreddits` (type: `array`):

Subreddits to leave out of related and user-set results, for example a brand's own community or a known spam sub.

## `discoverSort` (type: `string`):

Discover mode only: order matched communities by subscriber count, creation date or name.

## `discoverSortOrder` (type: `string`):

Discover mode only: descending puts the largest, newest or last name first; ascending reverses it.

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

Overall cap on dataset rows. In overlap mode this covers every seed and every related community.

## Actor input object example

```json
{
  "mode": "overlap",
  "subreddits": [
    "python",
    "r/webdev",
    "https://www.reddit.com/r/SaaS/"
  ],
  "usernames": [
    "spez",
    "u/kn0thing"
  ],
  "query": "machine learning",
  "sampleAuthors": 25,
  "activityWindow": "30",
  "contentType": "both",
  "excludeBots": true,
  "excludeAuthors": [
    "example_bot",
    "brand_account"
  ],
  "minSharedUsers": 1,
  "maxLookalikes": 5,
  "includeNsfw": false,
  "minSubscribers": 0,
  "excludeSubreddits": [
    "selfpromotion",
    "freepromotion"
  ],
  "discoverSort": "subscribers",
  "discoverSortOrder": "desc",
  "maxItems": 5
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset containing the rows for the selected mode. Every row has a recordType field: audienceOverlap, subredditDiscovery or userAudience.

# 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": "overlap",
    "subreddits": [
        "python"
    ],
    "sampleAuthors": 25,
    "activityWindow": "30",
    "contentType": "both",
    "excludeBots": true,
    "minSharedUsers": 1,
    "maxLookalikes": 5,
    "includeNsfw": false,
    "minSubscribers": 0,
    "discoverSort": "subscribers",
    "discoverSortOrder": "desc",
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/subreddit-audience-overlap").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": "overlap",
    "subreddits": ["python"],
    "sampleAuthors": 25,
    "activityWindow": "30",
    "contentType": "both",
    "excludeBots": True,
    "minSharedUsers": 1,
    "maxLookalikes": 5,
    "includeNsfw": False,
    "minSubscribers": 0,
    "discoverSort": "subscribers",
    "discoverSortOrder": "desc",
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/subreddit-audience-overlap").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": "overlap",
  "subreddits": [
    "python"
  ],
  "sampleAuthors": 25,
  "activityWindow": "30",
  "contentType": "both",
  "excludeBots": true,
  "minSharedUsers": 1,
  "maxLookalikes": 5,
  "includeNsfw": false,
  "minSubscribers": 0,
  "discoverSort": "subscribers",
  "discoverSortOrder": "desc",
  "maxItems": 5
}' |
apify call xyrelith-data/subreddit-audience-overlap --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/subreddit-audience-overlap"
        }
    }
}
```

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/DgyD8lN65PsMqYcM8/builds/gfRVQhkdTSi9HUZw2/openapi.json
