Back to APIs list

Reddit API examples & templates

Use these vals as a playground to view and fork Reddit API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
redditSaaS
Kutsua
redditSaaS
Remix of: valdottown/templateRedditAlert
Cron
Reddit_alert
Kutsua
Reddit_alert
// Customize your search parameters
Script
redditSearch
sarahxc
redditSearch
Use Browserbase and Puppeteer to monitor and scrape reddit search results.
HTTP
templateRedditAlert
valdottown
templateRedditAlert
Reddit Keyword Alerts [TEMPLATE] Get notifications when specific keywords appear in Reddit posts. This template will help you: Search Reddit for specific keywords within a defined time range. Send notifications to your preferred platform (Discord, Slack, email, etc.) Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, Serp . Example This val tracks mentions of "Val Town" and related terms on Reddit, filtering results from the last 7 days and sending alerts to a Discord webhook. Set Up 1. Fork this Val To start using this template, fork this val by clicking the fork button at the top-right corner of the page. 2. View Source Code The CODE box shows you the the full source code of this val, you may need to scroll down to see it. 3. Get a SerpApi Key This template requires a SerpApi key to search Reddit posts via Google search results. Get a SerpApi key : Sign up at SerpApi to create an account. Generate an API key from your account dashboard. Add the SerpApi key to your environment variables : Go to your Val Town environment variables . Add a new key: Key: SERP_API_KEY Value: Your SERP API key. Without this key, the val will not function correctly. 4. Customize Keyword In the CODE box below, update the terms or phrases you want to track: const KEYWORDS = "\"node\" OR \"node.js\""; 5. Set Up Your Notification Method This template uses a Discord webhook for notifications. You can update this to your preferred platform: Create a Discord webhook following this guide . Save your webhook URL in your Val Town environment variables: Key: mentionsDiscord Value: Your Discord webhook URL. Notifications will be sent using this function: await discordWebhook({ url: Deno.env.get("mentionsDiscord"), content, }); To switch to another platform (e.g., Slack, email, or custom webhooks), replace the discordWebhook call with the appropriate integration ((e.g., @std/email , Slack , or anywhere else ) 🎉 Congrats! You now have a val running that ensures you never miss another Reddit mention. 🎉 NOTE: Usage Limits SerpApi: Free SerpApi accounts have monthly call limits.
Cron
pr0n
roramigator
pr0n
@jsxImportSource https://esm.sh/react
HTTP
redditNew
stevekrouse
redditNew
An interactive, runnable TypeScript val by stevekrouse
Script
redditSearch
jasperfurniss
redditSearch
Remix of: sarahxc/redditSearch
HTTP
redditImageGrab
yawnxyz
redditImageGrab
Remix of: roramigator/pr0n
HTTP
googlePhotosMarketingRSS
Glench
googlePhotosMarketingRSS
An interactive, runnable TypeScript val by Glench
HTTP
subredditExample
andreterron
subredditExample
// Reddit recent posts from /r/aww (cute animals)
Script
redditNew
alexdmejias
redditNew
Remix of: stevekrouse/redditNew
Script
subredditExample
rcoady
subredditExample
// Reddit recent posts from /r/aww (cute animals)
Script
subredditExample
funkie
subredditExample
// Reddit recent posts from /r/aww (cute animals)
Script
check_reddit
bnorick
check_reddit
An interactive, runnable TypeScript val by bnorick
Script
subredditExample
tfiers
subredditExample
// Reddit recent posts from /r/aww (cute animals)
Script
slackScout
sarahxc
slackScout
Slack scout sends a slack notification every time your keywords are mentioned on Twitter, Hacker News, or Reddit. Get notified whenever you, your company, or topics of interest are mentioned online. Built with Browserbase . Inspired by f5bot.com . Full code tutorial . Getting Started To run Slack Scout, you’ll need a Browserbase API key Slack Webhook URL: setup here Twitter Developer API key Browserbase Browserbase is a developer platform to run, manage, and monitor headless browsers at scale. We’ll use Browserbase to navigate to, and scrape our different news sources. We’ll also use Browserbase’s Proxies to ensure we simulate authentic user interactions across multiple browser sessions . Get started with Browserbase for free here . Twitter We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. If you decide to use Browserbase, we can lend our token. Comment below for access. Once you have the SLACK_WEBHOOK_URL , BROWSERBASE_API_KEY , and TWITTER_BEARER_TOKEN , input all of these as Val Town Environment Variables . Project created by Sarah Chieng and Alex Phan 💌
Cron