Links

Reddit

Options for posting via the API to Reddit

Reddit API Endpoint

Overview

The following are required body parameters for posting to Reddit. Please be sure the subreddit allows automated posting.
{
"post": "Reddit post", // required
"platforms": ["reddit"], // required
"redditOptions": {
"title": "Reddit Post Title", // required
"subreddit": "test", // required (no "/r/" needed)
"link": "https://www.website.com", // optional: post a link
}
}
  • title (required): The title of the post on Reddit.
  • subreddit (required): The subreddit to send the post. Please be sure to follow the subreddit's posting guidelines. A good subreddit to use for testing is /r/test/ and can be viewed at: https://www.reddit.com/r/test/
  • link (optional): If posting to Reddit and you want to post a link instead of text to the subreddit. While the post parameter text is still required, it is not included in the post since Reddit links can't have a text body.
Always check the rules of the subreddit before posting. Some subreddits have a karma threshold, require membership for a time period, limit the frequency of posting, don't allow images, or require flair to be added. Also, most subreddits have specific rules on spam and self-promotion. Not following these rules can result in being banned by the subreddit or Reddit.

Posting an Image to Reddit

Post an image to Reddit either by including the image URL in the mediaUrl parameter or the link parameter of redditOptions. Images posted as a link will resolve to the full image.
The post parameter text is ignored, but is still required to successfully submit the post. Reddit restricts posting images and text together to their online "fancy pants" editor. This means either an image or text can be posted, but not both at the same time.
{
"post": "Reddit post", // required, but not added to the post
"platforms": ["reddit"], // required
"mediaUrls": "https://my-media-url.com",
"redditOptions": {
"title": "Reddit Post Title", // required
"subreddit": "test", // required (no "/r/" needed)
}
}

Add Reddit Flair

Some subreddits require flair. Subreddit moderators pre-define the flair and each flair has a unique ID. In the Reddit post to Ayrshare add the flair ID and an optional flair text if the text can be overridden.
"redditOptions": {
"flairId": "jM8nH92enjswas", // Id of the flair
"flairText": "My New Flair text", // Override the flair text if allowed by flair
}
You can find the flair ID of a given subreddit by logging into Reddit in a browser and opening the following URL:
https://www.reddit.com/r/SUBREDDIT/api/link_flair_v2.json?raw_json=1
Where SUBREDDIT is the name of the subreddit you want to get the flair. We suggest storing the IDs for later use.
For example, the following URL will get the flair for the firebase subreddit:

FAQ

How do I add rich text formatting to Reddit posts?

If you want to add bold, italic, or superscript text to a Reddit post, use Reddit-flavored Markdown.
{
"post": "For example, this can be *italic* or **bold** or ^super ",
"platforms": [
"reddit"
],
"redditOptions": {
"title": "Rich Text Post",
"subreddit": "test"
}
}
Last modified 6mo ago