Lodol Docs

Reddit

API actions for the Reddit integration.

Reddit

Create posts, add comments, and read the newest posts on Reddit.


Comment on a post

Add a comment to a Reddit post, or reply to another comment.

Parameters

ParameterTypeRequiredDescription
parent_idstringYesThe ID of the post or comment to reply to, including its prefix. Use t3_ for a post (for example t3_1a2b3c) or t1_ for a comment (for example t1_xyz789).
textstringYesThe text of your comment.

Response

{
  "comment": {
    "body": "Great point!",
    "id": "xyz789",
    "link_id": "t3_1a2b3c"
  }
}

Create text post

Publish a text post to a subreddit.

Parameters

ParameterTypeRequiredDescription
subredditstringYesThe name of the subreddit to post in, without the 'r/' prefix, for example programming.
titlestringYesThe title of the post.
textstringNoThe body text of the post. Leave blank to post a title only.

Response

{
  "post": {
    "id": "1a2b3c",
    "subreddit": "programming",
    "title": "Interesting Discussion",
    "url": "https://reddit.com/r/programming/comments/1a2b3c/"
  }
}

Get posts

Get posts from a subreddit, sorted the way you choose.

Parameters

ParameterTypeRequiredDescription
subredditstringYesThe name of the subreddit to read from, without the 'r/' prefix, for example programming.
sortstringNoWhich posts to return and how they are ordered.
limitnumberNoThe maximum number of posts to return, from 1 to 100. Defaults to 10.

Response

{
  "posts": [
    {
      "id": "1a2b3c",
      "subreddit": "technology",
      "title": "New Feature Announcement",
      "url": "https://reddit.com/r/technology/comments/1a2b3c/"
    }
  ]
}

On this page