Skip to main content
POST
/
api
/
reddit
/
subreddits
/
posts
/reddit/subreddits/posts
curl --request POST \
  --url https://api.anysite.io/api/reddit/subreddits/posts \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "subreddit": "<string>",
  "count": 2,
  "timeout": 300,
  "sort": "hot",
  "time_filter": "all"
}
'
[
  {
    "id": "<string>",
    "title": "<string>",
    "url": "<string>",
    "@type": "@reddit_post",
    "author": {
      "id": "<string>",
      "name": "<string>",
      "@type": "@reddit_author"
    },
    "subreddit": "<string>",
    "subreddit_id": "<string>",
    "created_at": 123,
    "vote_count": 123,
    "comment_count": 123,
    "post_type": "<string>",
    "content_url": "<string>",
    "text": "<string>",
    "thumbnail_url": "<string>",
    "nsfw": false,
    "spoiler": false
  }
]

Documentation Index

Fetch the complete documentation index at: https://docs.anysite.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
subreddit
string
required

Subreddit name, prefixed name, or URL

Minimum string length: 1
Examples:

"technology"

"r/technology"

count
integer
required

Max result count

Required range: x >= 1
Example:

25

timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
sort
enum<string>
default:hot

Listing sort order

Available options:
hot,
new,
top,
rising
time_filter
enum<string>
default:all

Time window for the top sort order

Available options:
all,
year,
month,
week,
day,
hour

Response

Successful Response

id
string
required
title
string
required
url
string
required
@type
string
default:@reddit_post
author
RedditAuthor · object
subreddit
string | null
subreddit_id
string | null
created_at
integer | null
vote_count
integer | null
comment_count
integer | null
post_type
string | null
content_url
string | null
text
string | null
thumbnail_url
string | null
nsfw
boolean
default:false
spoiler
boolean
default:false