# Reddit Trending Posts Scraper (r/popular, r/all) (`scrapers_lat/reddit-trending-scraper`) Actor

Scrape trending Reddit posts from r/popular and r/all, globally or by country (US, GB, CA, AU, DE, IN, BR, MX). Get rank, title, selftext, author, subreddit, score, comments and awards. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/scrapers_lat/reddit-trending-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.15 / 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/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

[![Reddit Trending Posts Scraper (r/popular, r/all)](https://scrapers.lat/banners/reddit-trending-scraper.png)](https://console.apify.com/actors/aMGb79jBfEeD4hw1B/input)

## Reddit Trending Posts Scraper (r/popular, r/all)

Here is one real result, with every field the actor returns (the `galleryImageUrls` array is trimmed to its first 3 of 13 real URLs for readability):

```json
{
  "thumbnail": "https://preview.redd.it/lauan5y51jih1.png?width=140&height=140&crop=1:1,smart&auto=webp&s=cbdca351f771ddfffe1a5a41b067819b433b4177",
  "title": "Movie Night",
  "url": "https://www.reddit.com/gallery/1vkhbgl",
  "id": "1vkhbgl",
  "selftext": null,
  "subreddit": "comics",
  "author": "Miles_the_new_kid",
  "authorFullname": "t2_8rc4h",
  "score": 19000,
  "upvoteRatio": 0.96,
  "numComments": 344,
  "numCrossposts": 2,
  "totalAwards": 0,
  "linkFlairText": null,
  "permalink": "https://www.reddit.com/r/comics/comments/1vkhbgl/movie_night/",
  "domain": "old.reddit.com",
  "isSelf": false,
  "isVideo": true,
  "isNsfw": false,
  "isSpoiler": false,
  "isOriginalContent": false,
  "isPinned": false,
  "isLocked": false,
  "isArchived": false,
  "edited": "2026-08-10T13:53:11+00:00",
  "galleryImageUrls": [
    "https://preview.redd.it/lauan5y51jih1.png?width=108&crop=smart&auto=webp&s=47cd8d03de48b9c8d3bb470f800cf8243d13e6ba",
    "https://preview.redd.it/6vwxu5y51jih1.png?width=108&crop=smart&auto=webp&s=76f9f17c338cdf4aa144a091a89757808667d769",
    "https://preview.redd.it/qxao96y51jih1.png?width=108&crop=smart&auto=webp&s=4faa1bdd626212c229d71fb146b94026ea3d3e06"
  ],
  "createdAt": "2026-08-10T10:42:57.000Z",
  "rank": 1,
  "trendingSource": "popular",
  "observedAt": "2026-08-10T14:18:37.335Z",
  "error": null
}
```

The most complete Reddit trending scraper available. It reads the cross-Reddit trending feeds (r/popular and r/all), globally or by country, and returns every field Reddit exposes for each post, including its live `rank`, score, upvote ratio, comment and crosspost counts, award totals, gallery images and full flag set, so you can snapshot what is trending across all of Reddit in one run.

**📥 [Input](https://apify.com/scrapers_lat/reddit-trending-scraper/input-schema) · 📤 [Output](https://apify.com/scrapers_lat/reddit-trending-scraper/output-schema) · 💰 [Pricing](https://apify.com/scrapers_lat/reddit-trending-scraper/pricing) · ▶️ [Examples](https://apify.com/scrapers_lat/reddit-trending-scraper/examples)**

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify\&logoColor=white)
![Coverage](https://img.shields.io/badge/Coverage-Reddit-blue)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)
![Billing](https://img.shields.io/badge/Billing-Pay%20per%20result-brightgreen)

### Table of contents

- [What it does](#what-it-does)
- [Quickstart](#quickstart)
- [Input reference](#input-reference)
- [Output reference](#output-reference)
- [Example output record](#example-output-record)
- [Run via API and CLI](#run-via-api-and-cli)
- [Fetch results](#fetch-results)
- [Billing and limits](#billing-and-limits)
- [FAQ and troubleshooting](#faq-and-troubleshooting)

### What it does

The actor reads a cross-Reddit trending feed (r/popular, curated and SFW, or r/all, everything), optionally scoped to a country, applies the sort and time window you pass, and writes one normalized record per trending post to the run's dataset. Each record carries its live `rank` in the feed and the `trendingSource` it came from. When Fetch Full Post Text is enabled it opens each post to capture its full `selftext`, upvote ratio and gallery images. Timestamps are normalized to ISO 8601 and missing source values are returned as `null`.

### Quickstart

Open the actor, paste this into the input, and press Run. It returns the 10 hottest posts on r/popular right now.

```json
{
  "maxPosts": 10,
  "source": "popular",
  "sort": "hot",
  "timeFilter": "day",
  "withDetails": true
}
```

Set `source` to `all` for the unfiltered r/all feed. Set `country` (for example `US`, `GB`, `DE`) to read the geo-scoped r/popular feed. Set `withDetails` to `false` for a faster, listing-only run.

### Input reference

Every field is optional. With an empty input the actor reads the global r/popular hot feed.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `maxPosts` | integer | no | `10` | Maximum number of trending posts to collect. |
| `source` | enum | no | `popular` | Which cross-Reddit feed to read: `popular` (r/popular, curated, SFW) or `all` (r/all, everything). |
| `country` | string | no | (global) | Country code for the r/popular geo feed, for example `US`, `GB`, `CA`, `AU`, `DE`, `IN`, `BR`, `MX`. Empty reads the global feed. Applies to r/popular only. |
| `sort` | enum | no | `hot` | Trending order: `hot`, `top`, `rising`, `new`. |
| `timeFilter` | enum | no | `day` | Time window for the `top` sort: `hour`, `day`, `week`, `month`, `year`, `all`. Ignored for hot, rising and new. |
| `withDetails` | boolean | no | `true` | When enabled, opens each post to capture full self text, upvote ratio and gallery images. Disable for a faster, listing-only run. |

### Output reference

One dataset item per trending post. Types: `string`, `integer`, `number`, `boolean`, `string[]`, or `null` when the source value is absent.

| Field | Type | Description |
|---|---|---|
| `rank` | integer | Position of the post in the trending feed (1 = top). |
| `trendingSource` | string | Feed the post came from: `popular` or `all`. |
| `id` | string | Reddit post id. |
| `title` | string | Post title. |
| `selftext` | string | Full body text of a self (text) post, or `null`. Populated when `withDetails` is on. |
| `url` | string | Outbound or content URL of the post. |
| `subreddit` | string | Subreddit the post is in (without prefix). |
| `author` | string | Username of the post author. |
| `authorFullname` | string | Reddit author id (`t2_...`). |
| `score` | integer | Net vote score. |
| `upvoteRatio` | number | Fraction of votes that are upvotes. Populated when `withDetails` is on. |
| `numComments` | integer | Comment count on the post. |
| `numCrossposts` | integer | Number of crossposts. |
| `totalAwards` | integer | Total awards received. |
| `linkFlairText` | string | Link flair text, or `null`. |
| `permalink` | string | Full reddit.com permalink of the post. |
| `domain` | string | Domain of the linked content. |
| `thumbnail` | string | Thumbnail image URL, or `null`. |
| `isSelf` | boolean | `true` for text (self) posts. |
| `isVideo` | boolean | `true` for native video posts. |
| `isNsfw` | boolean | `true` when the post is flagged NSFW. |
| `isSpoiler` | boolean | `true` when marked spoiler. |
| `isOriginalContent` | boolean | `true` when marked OC. |
| `isPinned` | boolean | `true` when pinned. |
| `isLocked` | boolean | `true` when the post is locked. |
| `isArchived` | boolean | `true` when the post is archived. |
| `edited` | string | ISO 8601 edit timestamp, or `false` when never edited. |
| `galleryImageUrls` | string\[] | Image URLs for gallery posts, or `null`. Populated when `withDetails` is on. |
| `createdAt` | string | ISO 8601 creation timestamp. |
| `observedAt` | string | ISO 8601 timestamp of when the record was collected. |
| `error` | string | `null` on success. On a failed run, a single item with a populated `error` field is written instead. |

### Example output record

Real record (rank 2) from the same run (input `{"source": "popular", "sort": "hot"}`). The `galleryImageUrls` array is trimmed to its first 3 of 7 real URLs:

```json
{
  "thumbnail": "https://preview.redd.it/0qem30653jih1.jpg?width=140&height=140&crop=1:1,smart&auto=webp&s=af5a457419e8ba481629184188fff29eec4fc117",
  "title": "My boy works part time as a backdrop. Paid in chimkens",
  "url": "https://www.reddit.com/gallery/1vkhiji",
  "id": "1vkhiji",
  "selftext": null,
  "subreddit": "aww",
  "author": "Pa-hi-ma-kas",
  "authorFullname": "t2_v1znvynl",
  "score": 9086,
  "upvoteRatio": 0.98,
  "numComments": 78,
  "numCrossposts": 1,
  "totalAwards": 0,
  "linkFlairText": null,
  "permalink": "https://www.reddit.com/r/aww/comments/1vkhiji/my_boy_works_part_time_as_a_backdrop_paid_in/",
  "domain": "old.reddit.com",
  "isSelf": false,
  "isVideo": true,
  "isNsfw": false,
  "isSpoiler": false,
  "isOriginalContent": true,
  "isPinned": false,
  "isLocked": false,
  "isArchived": false,
  "edited": false,
  "galleryImageUrls": [
    "https://preview.redd.it/0qem30653jih1.jpg?width=108&crop=smart&auto=webp&s=1d312f61ff7dbeec1c95ef555e7b1837eb012f68",
    "https://preview.redd.it/t9qsc5j53jih1.png?width=108&crop=smart&auto=webp&s=9ba89f5c24ec4408494dd4738448d3da2d39495b",
    "https://preview.redd.it/01tmbunhbjih1.jpeg?width=2725&format=pjpg&auto=webp&s=ce943463643a3aed7c8ecd902116c8d00aaf5700"
  ],
  "createdAt": "2026-08-10T10:54:00.000Z",
  "rank": 2,
  "trendingSource": "popular",
  "observedAt": "2026-08-10T14:18:37.407Z",
  "error": null
}
```

### Run via API and CLI

Start a run and wait for it to finish, then read the dataset. Replace `<TOKEN>` with your Apify API token.

Run synchronously and get dataset items in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~reddit-trending-scraper/run-sync-get-dataset-items?token=<TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"source":"popular","sort":"hot","maxPosts":25,"withDetails":false}'
```

Start a run asynchronously:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~reddit-trending-scraper/runs?token=<TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"source":"all","sort":"top","timeFilter":"week","maxPosts":100}'
```

Apify CLI:

```bash
apify call scrapers_lat/reddit-trending-scraper \
  --input '{"source":"popular","country":"US","sort":"hot"}'
```

### Fetch results

Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing `format`:

```bash
## JSON
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"

## CSV
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"

## Paginate large datasets
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
```

`<DATASET_ID>` is returned as `defaultDatasetId` in the run object. Use `offset` and `limit` to page through large result sets. `clean=true` drops empty and internal fields.

### Billing and limits

- **Pay per result.** You are charged per trending post returned (`result` event). When `withDetails` is on and a post page is successfully enriched, an add-on `details` event is also charged. See the [pricing tab](https://apify.com/scrapers_lat/reddit-trending-scraper/pricing) for current prices.
- **No charge on failure.** If a run errors, the actor writes a single item with a populated `error` field and does not charge for it. Empty runs cost nothing.
- **Spend cap respected.** Set `maxTotalChargeUsd` on the run; once reached, the actor stops emitting and charging further billable results.
- **Free Apify plans** are capped at 10 posts per run. Upgrade for higher `maxPosts`.
- **Turn off enrichment to save.** Set `withDetails` to `false` for listing-only results with no `details` charge.

### FAQ and troubleshooting

**What is the difference between r/popular and r/all?**
`popular` is Reddit's curated, SFW cross-Reddit feed (and supports country scoping). `all` is the unfiltered feed of everything trending. Choose with `source`.

**Does the `country` filter work for r/all?**
No. Country scoping applies to r/popular only. For r/all the `country` value is ignored and the global feed is returned.

**A run returned fewer posts than `maxPosts`. Why?**
The feed had fewer items available for the chosen sort and time window, or a free-plan cap applied. Trending feeds are finite at any moment.

**Why is `selftext` null on some posts?**
Only self (text) posts carry `selftext`, and it is captured when `withDetails` is enabled. Link and gallery posts store their content in `url` and `galleryImageUrls`.

**How do I snapshot trends over time?**
Schedule the actor to run on an interval. Each run stamps `rank`, `observedAt` and the live score so you can track how posts rise and fall.

**Is this an official Reddit tool?**
No. This actor is independent and has no affiliation with Reddit. It reads only data that is publicly available on Reddit. Use it in accordance with Reddit's terms.

### Related scrapers

- [Reddit Posts & Comments Scraper](https://apify.com/scrapers_lat/reddit-scraper): full subreddit feeds and comment trees.
- [Reddit Keyword Search & Mentions Scraper](https://apify.com/scrapers_lat/reddit-search-scraper): Reddit search results and mention tracking.
- [Reddit User Scraper](https://apify.com/scrapers_lat/reddit-user-scraper): a user's posts, comments and profile.
- [Hacker News Scraper](https://apify.com/scrapers_lat/hacker-news-scraper): Hacker News stories, comments and points.
- [Google News Scraper](https://apify.com/scrapers_lat/google-news-scraper): news articles by keyword and topic.

### More scrapers at scrapers.lat

Built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at [scrapers.lat](https://scrapers.lat).

***

> Independent tool, not affiliated with Reddit. Accesses only publicly available Reddit data. Use in accordance with Reddit's terms.

# Actor input Schema

## `maxPosts` (type: `integer`):

Maximum number of trending posts to collect.

## `source` (type: `string`):

Which cross-Reddit trending feed to read: r/popular (curated, SFW) or r/all (everything).

## `country` (type: `string`):

Optional. Country code for the r/popular geo feed (for example US, GB, CA, AU, DE, IN, BR, MX). Leave empty for the global feed. Applies to r/popular only.

## `sort` (type: `string`):

Trending order.

## `timeFilter` (type: `string`):

Time window for the 'top' sort. Ignored for hot, rising and new.

## `withDetails` (type: `boolean`):

When enabled, opens each post to capture its full self text, upvote ratio and gallery images. Disable for a faster, listing-only run.

## Actor input object example

```json
{
  "maxPosts": 10,
  "source": "popular",
  "sort": "hot",
  "timeFilter": "day",
  "withDetails": true
}
```

# Actor output Schema

## `results` (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 = {
    "maxPosts": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/reddit-trending-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 = { "maxPosts": 10 }

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/reddit-trending-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 '{
  "maxPosts": 10
}' |
apify call scrapers_lat/reddit-trending-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapers_lat/reddit-trending-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/aMGb79jBfEeD4hw1B/builds/qZr5pbM2Z5GrHTAD0/openapi.json
