Reddit is a network of communities based on people's interests. Find communities you're interested in, and become part of an online community!
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
reddit: {
type: "app",
app: "reddit",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://oauth.reddit.com/api/v1/me`,
headers: {
Authorization: `Bearer ${this.reddit.$auth.oauth_access_token}`,
"User-Agent": `pipedream:v0.0.1 (by /u/pipedream-oauth)`,
},
})
},
})
Emit new event each time a new comment is added to a subreddit.
Emit new event each time a new hot post is added to the top 10 items in a subreddit.
Emit new event each time a new link is added to a subreddit
Reddit uses OAuth authentication. When you connect your Reddit account, Pipedream will open a popup window where you can sign into Reddit and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Reddit API.
Pipedream requests the following authorization scopes when you connect your account:
account
identity
edit
flair
history
read
report
save
structuredstyles
submit
subscribe
vote
flair
modflair
modconfig
modflair
modlog
modposts
modwiki
mysubreddits
wikiedit
wikiread
GET
https://www.reddit.com/api/v1/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
duration=permanent
POST
https://www.reddit.com/api/v1/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
User-Agent: pipedream:v0.0.1 (by /u/pipedream-oauth)
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://www.reddit.com/api/v1/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
User-Agent: pipedream:v0.0.1 (by /u/pipedream-oauth)
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}