Reddit

A subreddit's posts with their score and comment count, keyword search across Reddit or one subreddit, and comments by post or subreddit, as typed JSON.

Embed
Preview of the card
<a href="https://scrapelyserp.com/docs/reddit"><img src="https://scrapelyserp.com/docs/_api/public/orgs/affc5b0f-d3c2-423a-8143-9d10db5736ae/spaces/981e6275-da3f-446c-82de-889f59c83b6f/pages/5c3b014e-de01-42bf-84ab-ea562ae284ae/social-card.svg?v=3e7ae33eec8b" alt="Reddit" width="600" height="315"></a>

A subreddit's posts with their score and comment count, keyword search across Reddit or one subreddit, and comments by post or subreddit, as typed JSON.

At a glance

Three GET endpoints under /v1/structured/reddit/. Each answers { endpoint, url, credits, duration_ms, data }; data is described below and in the reference. Each call is charged for the data it moves; a page we could not read is 502 TARGET_FAILED and costs nothing, and a subreddit or post that does not exist is a free 404 NOT_FOUND.

Endpoint

What

Typical

GET /v1/structured/reddit/posts

A subreddit's posts, new (default), hot, top or rising

about 375,000 posts per credit, about 25 per call

GET /v1/structured/reddit/search

Posts matching query, across Reddit or in one subreddit

about 600,000 results per credit, up to 100 per call

GET /v1/structured/reddit/comments

One post's comments, or a subreddit's newest

about 2 million comments per credit, up to 100 per call

Subreddit posts

Parameter

Type

Default

Description

subreddit (required)

string

—

The subreddit, e.g. sneakers (also r/sneakers or its URL).

sort

new, hot, top, rising

new

Listing order.

time

hour, day, week, month, year, all

day

With sort=top: the window.

cursor

string

—

The next_cursor of the previous page.

curl -G "https://api.scrapelyserp.com/v1/structured/reddit/posts" \
  -H "Authorization: Bearer $SCRAPELY_API_KEY" \
  -d subreddit=webscraping \
  -d sort=new

Each post has id, subreddit, title, author, url, link (where a link post points), created_at, score, comments, upvote_ratio, type (text, link, image, video…), domain, flair and text. Promoted posts are left out. Pass next_cursor back as cursor for the next page.

Full reference → GET /v1/structured/reddit/posts

Parameter

Type

Default

Description

query (required)

string

—

The search terms.

subreddit

string

—

Search only this subreddit, e.g. sneakers.

sort

relevance, new, top, comments

relevance

Result order.

time

hour, day, week, month, year, all

all

Only posts from this window.

limit

integer

25

Results per page, 1–100.

cursor

string

—

The next_cursor of the previous page.

Results carry id, subreddit, title, author, url, created_at and text (score and comment counts are on posts). To be told about each new mention, put the query on a mention list.

Full reference → GET /v1/structured/reddit/search

Comments

Parameter

Type

Default

Description

post

string

—

A post's id (e.g. 1xn96sv) or URL: its comments.

subreddit

string

—

A subreddit, e.g. sneakers: its newest comments. Send this or post.

sort

best, top, new, old, controversial

best

With post: the thread's order.

limit

integer

25

Results per page, 1–100.

cursor

string

—

With subreddit: the previous page's next_cursor.

With post, data.post is the post itself and comments its comments. With subreddit, comments are its newest across every post, each with post_id and post_title, and next_cursor pages further back.

Full reference → GET /v1/structured/reddit/comments

Updated